mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-30 10:54:50 +00:00
Fixing puppets
In kernels which output is shorter than num_points, memory is firtly filled bu zeros and then the kernel is executed.
This commit is contained in:
commit
e400885800
@ -40,8 +40,6 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define ROTATOR_RELOAD 512
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef LV_HAVE_GENERIC
|
#ifdef LV_HAVE_GENERIC
|
||||||
|
|
||||||
@ -56,20 +54,9 @@
|
|||||||
static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points)
|
static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points)
|
||||||
{
|
{
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
int j = 0;
|
|
||||||
lv_16sc_t tmp16;
|
lv_16sc_t tmp16;
|
||||||
lv_32fc_t tmp32;
|
lv_32fc_t tmp32;
|
||||||
for(i = 0; i < (unsigned int)(num_points / ROTATOR_RELOAD); ++i)
|
for(i = 0; i < (unsigned int)(num_points); ++i)
|
||||||
{
|
|
||||||
for(j = 0; j < ROTATOR_RELOAD; ++j)
|
|
||||||
{
|
|
||||||
tmp16 = *inVector++;
|
|
||||||
tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase);
|
|
||||||
*outVector++ = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32)));
|
|
||||||
(*phase) *= phase_inc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(i = 0; i < num_points % ROTATOR_RELOAD; ++i)
|
|
||||||
{
|
{
|
||||||
tmp16 = *inVector++;
|
tmp16 = *inVector++;
|
||||||
tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase);
|
tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase);
|
||||||
|
@ -51,6 +51,7 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_generic(lv_16sc_t*
|
|||||||
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment());
|
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment());
|
||||||
memcpy(in_a[n], in, sizeof(lv_16sc_t) * num_points);
|
memcpy(in_a[n], in, sizeof(lv_16sc_t) * num_points);
|
||||||
}
|
}
|
||||||
|
result = (lv_16sc_t*)calloc(num_points, sizeof(lv_16sc_t));
|
||||||
volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_generic(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_generic(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
||||||
|
|
||||||
for(unsigned int n = 0; n < num_a_vectors; n++)
|
for(unsigned int n = 0; n < num_a_vectors; n++)
|
||||||
@ -72,6 +73,7 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_a_sse2(lv_16sc_t* r
|
|||||||
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment());
|
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment());
|
||||||
memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points);
|
memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points);
|
||||||
}
|
}
|
||||||
|
result = (lv_16sc_t*)calloc(num_points, sizeof(lv_16sc_t));
|
||||||
volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_sse2(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_a_sse2(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
||||||
|
|
||||||
for(unsigned int n = 0; n < num_a_vectors; n++)
|
for(unsigned int n = 0; n < num_a_vectors; n++)
|
||||||
@ -94,6 +96,7 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_u_sse2(lv_16sc_t* r
|
|||||||
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t)*num_points, volk_gnsssdr_get_alignment());
|
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t)*num_points, volk_gnsssdr_get_alignment());
|
||||||
memcpy(in_a[n], in, sizeof(lv_16sc_t)*num_points);
|
memcpy(in_a[n], in, sizeof(lv_16sc_t)*num_points);
|
||||||
}
|
}
|
||||||
|
result = (lv_16sc_t*)calloc(num_points, sizeof(lv_16sc_t));
|
||||||
volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_sse2(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_sse2(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
||||||
|
|
||||||
for(unsigned int n = 0; n < num_a_vectors; n++)
|
for(unsigned int n = 0; n < num_a_vectors; n++)
|
||||||
@ -116,6 +119,7 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon(lv_16sc_t* res
|
|||||||
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t)*num_points, volk_gnsssdr_get_alignment());
|
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t)*num_points, volk_gnsssdr_get_alignment());
|
||||||
memcpy(in_a[n], in, sizeof(lv_16sc_t)*num_points);
|
memcpy(in_a[n], in, sizeof(lv_16sc_t)*num_points);
|
||||||
}
|
}
|
||||||
|
result = (lv_16sc_t*)calloc(num_points, sizeof(lv_16sc_t));
|
||||||
volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(result, local_code, (const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
||||||
|
|
||||||
for(unsigned int n = 0; n < num_a_vectors; n++)
|
for(unsigned int n = 0; n < num_a_vectors; n++)
|
||||||
|
@ -59,6 +59,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_generic(lv_
|
|||||||
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment());
|
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment());
|
||||||
memcpy(in_a[n], in, sizeof(lv_16sc_t) * num_points);
|
memcpy(in_a[n], in, sizeof(lv_16sc_t) * num_points);
|
||||||
}
|
}
|
||||||
|
result = (lv_16sc_t*)calloc(num_points, sizeof(lv_16sc_t));
|
||||||
volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_generic(result, local_code, phase_inc[0], phase,(const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_generic(result, local_code, phase_inc[0], phase,(const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
||||||
|
|
||||||
for(unsigned int n = 0; n < num_a_vectors; n++)
|
for(unsigned int n = 0; n < num_a_vectors; n++)
|
||||||
@ -88,6 +89,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_a_sse3(lv_1
|
|||||||
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment());
|
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t) * num_points, volk_gnsssdr_get_alignment());
|
||||||
memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points);
|
memcpy((lv_16sc_t*)in_a[n], (lv_16sc_t*)in, sizeof(lv_16sc_t) * num_points);
|
||||||
}
|
}
|
||||||
|
result = (lv_16sc_t*)calloc(num_points, sizeof(lv_16sc_t));
|
||||||
volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_sse3(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
||||||
|
|
||||||
for(unsigned int n = 0; n < num_a_vectors; n++)
|
for(unsigned int n = 0; n < num_a_vectors; n++)
|
||||||
@ -118,6 +120,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_u_sse3(lv_1
|
|||||||
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t)*num_points, volk_gnsssdr_get_alignment());
|
in_a[n] = (lv_16sc_t*)volk_gnsssdr_malloc(sizeof(lv_16sc_t)*num_points, volk_gnsssdr_get_alignment());
|
||||||
memcpy(in_a[n], in, sizeof(lv_16sc_t)*num_points);
|
memcpy(in_a[n], in, sizeof(lv_16sc_t)*num_points);
|
||||||
}
|
}
|
||||||
|
result = (lv_16sc_t*)calloc(num_points, sizeof(lv_16sc_t));
|
||||||
volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_u_sse3(result, local_code, phase_inc[0], phase, (const lv_16sc_t**) in_a, num_a_vectors, num_points);
|
||||||
|
|
||||||
for(unsigned int n = 0; n < num_a_vectors; n++)
|
for(unsigned int n = 0; n < num_a_vectors; n++)
|
||||||
|
Loading…
Reference in New Issue
Block a user