|
|
@ -408,6 +408,30 @@ TEST(srslte_vec_convert_fi, MALLOC(float, x); MALLOC(short, z); float scale = 10
|
|
|
|
free(x);
|
|
|
|
free(x);
|
|
|
|
free(z);)
|
|
|
|
free(z);)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST(
|
|
|
|
|
|
|
|
srslte_vec_convert_conj_cs, MALLOC(cf_t, x); int16_t* z = srslte_vec_i16_malloc(block_size * 2);
|
|
|
|
|
|
|
|
float scale = 1000.0f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
short gold_re;
|
|
|
|
|
|
|
|
short gold_im;
|
|
|
|
|
|
|
|
for (int i = 0; i < block_size; i++) { x[i] = (float)RANDOM_CF(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST_CALL(srslte_vec_convert_conj_cs(x, scale, z, block_size))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < block_size; i++) {
|
|
|
|
|
|
|
|
gold_re = (short)(crealf(x[i]) * scale);
|
|
|
|
|
|
|
|
gold_im = (short)(cimagf(-x[i]) * scale);
|
|
|
|
|
|
|
|
cf_t t1 = (float)gold_re + I * (float)gold_im;
|
|
|
|
|
|
|
|
cf_t t2 = (float)z[2 * i] + I * (float)z[2 * i + 1];
|
|
|
|
|
|
|
|
double err = cabsf(t1 - t2);
|
|
|
|
|
|
|
|
if (err > mse) {
|
|
|
|
|
|
|
|
mse = err;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
free(x);
|
|
|
|
|
|
|
|
free(z);)
|
|
|
|
|
|
|
|
|
|
|
|
TEST(srslte_vec_convert_if, MALLOC(int16_t, x); MALLOC(float, z); float scale = 1000.0f;
|
|
|
|
TEST(srslte_vec_convert_if, MALLOC(int16_t, x); MALLOC(float, z); float scale = 1000.0f;
|
|
|
|
|
|
|
|
|
|
|
|
float gold;
|
|
|
|
float gold;
|
|
|
@ -591,6 +615,22 @@ TEST(
|
|
|
|
free(y);
|
|
|
|
free(y);
|
|
|
|
free(z);)
|
|
|
|
free(z);)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST(
|
|
|
|
|
|
|
|
srslte_vec_conj_cc, MALLOC(cf_t, x); MALLOC(cf_t, z);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cf_t gold;
|
|
|
|
|
|
|
|
for (int i = 0; i < block_size; i++) { x[i] = RANDOM_CF(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST_CALL(srslte_vec_conj_cc(x, z, block_size))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < block_size; i++) {
|
|
|
|
|
|
|
|
gold = conjf(x[i]);
|
|
|
|
|
|
|
|
mse += cabsf(gold - z[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
free(x);
|
|
|
|
|
|
|
|
free(z);)
|
|
|
|
|
|
|
|
|
|
|
|
TEST(
|
|
|
|
TEST(
|
|
|
|
srslte_vec_max_fi, MALLOC(float, x);
|
|
|
|
srslte_vec_max_fi, MALLOC(float, x);
|
|
|
|
|
|
|
|
|
|
|
@ -802,6 +842,10 @@ int main(int argc, char** argv)
|
|
|
|
test_srslte_vec_convert_fi(func_names[func_count], &timmings[func_count][size_count], block_size);
|
|
|
|
test_srslte_vec_convert_fi(func_names[func_count], &timmings[func_count][size_count], block_size);
|
|
|
|
func_count++;
|
|
|
|
func_count++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
passed[func_count][size_count] =
|
|
|
|
|
|
|
|
test_srslte_vec_convert_conj_cs(func_names[func_count], &timmings[func_count][size_count], block_size);
|
|
|
|
|
|
|
|
func_count++;
|
|
|
|
|
|
|
|
|
|
|
|
passed[func_count][size_count] =
|
|
|
|
passed[func_count][size_count] =
|
|
|
|
test_srslte_vec_convert_if(func_names[func_count], &timmings[func_count][size_count], block_size);
|
|
|
|
test_srslte_vec_convert_if(func_names[func_count], &timmings[func_count][size_count], block_size);
|
|
|
|
func_count++;
|
|
|
|
func_count++;
|
|
|
@ -858,6 +902,10 @@ int main(int argc, char** argv)
|
|
|
|
test_srslte_vec_div_fff(func_names[func_count], &timmings[func_count][size_count], block_size);
|
|
|
|
test_srslte_vec_div_fff(func_names[func_count], &timmings[func_count][size_count], block_size);
|
|
|
|
func_count++;
|
|
|
|
func_count++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
passed[func_count][size_count] =
|
|
|
|
|
|
|
|
test_srslte_vec_conj_cc(func_names[func_count], &timmings[func_count][size_count], block_size);
|
|
|
|
|
|
|
|
func_count++;
|
|
|
|
|
|
|
|
|
|
|
|
passed[func_count][size_count] =
|
|
|
|
passed[func_count][size_count] =
|
|
|
|
test_srslte_vec_max_fi(func_names[func_count], &timmings[func_count][size_count], block_size);
|
|
|
|
test_srslte_vec_max_fi(func_names[func_count], &timmings[func_count][size_count], block_size);
|
|
|
|
func_count++;
|
|
|
|
func_count++;
|
|
|
|