Merge branch 'next'

master
Andre Puschmann 7 years ago
commit fa508f07fa

@ -110,7 +110,7 @@ typedef enum {SRSLTE_SF_NORM, SRSLTE_SF_MBSFN} srslte_sf_t;
#define SRSLTE_SF_LEN_MAX (SRSLTE_SF_LEN(SRSLTE_SYMBOL_SZ_MAX))
#define SRSLTE_SLOT_LEN_PRB(nof_prb) (SRSLTE_SLOT_LEN(srslte_symbol_sz(nof_prb)))
#define SRSLTE_SF_LEN_PRB(nof_prb) (SRSLTE_SF_LEN(srslte_symbol_sz(nof_prb)))
#define SRSLTE_SF_LEN_PRB(nof_prb) (nof_prb > 0 ? SRSLTE_SF_LEN(srslte_symbol_sz(nof_prb)) : 0)
#define SRSLTE_SLOT_LEN_RE(nof_prb, cp) (nof_prb*SRSLTE_NRE*SRSLTE_CP_NSYMB(cp))
#define SRSLTE_SF_LEN_RE(nof_prb, cp) (2*SRSLTE_SLOT_LEN_RE(nof_prb, cp))

@ -201,14 +201,13 @@ int rf_soapy_open_multi(char *args, void **h, uint32_t nof_rx_antennas)
printf("No Soapy devices found.\n");
return SRSLTE_ERROR;
}
char* devname;
char* devname = NULL;
for (size_t i = 0; i < length; i++) {
printf("Soapy has Found device #%d: ", (int)i);
printf("Soapy has found device #%d: ", (int)i);
for (size_t j = 0; j < soapy_args[i].size; j++) {
printf("%s=%s, ", soapy_args[i].keys[j], soapy_args[i].vals[j]);
if(!strcmp(soapy_args[i].keys[j],"name") && !strcmp(soapy_args[i].vals[j], "LimeSDR-USB")){
devname = DEVNAME_LIME;
}
}
printf("\n");
@ -411,7 +410,7 @@ void rf_soapy_get_time(void *h, time_t *secs, double *frac_secs)
//TODO: add multi-channel support
int rf_soapy_recv_with_time_multi(void *h,
void **data,
void *data[SRSLTE_MAX_PORTS],
uint32_t nsamples,
bool blocking,
time_t *secs,

@ -49,8 +49,8 @@ bool verbose = false;
#define RANDOM_F() ((float)rand())/((float)RAND_MAX)
#define RANDOM_S() ((int16_t)(rand() && 0x800F))
#define RANDOM_B() ((int8_t)(rand() && 0x8008))
#define RANDOM_S() ((int16_t)(rand() & 0x800F))
#define RANDOM_B() ((int8_t)(rand() & 0x8008))
#define RANDOM_CF() (RANDOM_F() + _Complex_I*RANDOM_F())
#define TEST_CALL(TEST_CODE) gettimeofday(&start, NULL);\
@ -137,7 +137,7 @@ TEST(srslte_vec_dot_prod_sss,
MALLOC(int16_t, y);
int16_t z;
cf_t gold = 0.0f;
int16_t gold = 0.0f;
for (int i = 0; i < block_size; i++) {
x[i] = RANDOM_S();
y[i] = RANDOM_S();
@ -149,7 +149,7 @@ TEST(srslte_vec_dot_prod_sss,
gold += x[i] * y[i];
}
mse += cabsf(gold - z) / cabsf(gold);
mse = (gold - z) / abs(gold);
free(x);
free(y);
@ -160,7 +160,7 @@ TEST(srslte_vec_sum_sss,
MALLOC(int16_t, y);
MALLOC(int16_t, z);
cf_t gold = 0.0f;
int16_t gold = 0;
for (int i = 0; i < block_size; i++) {
x[i] = RANDOM_S();
y[i] = RANDOM_S();
@ -170,7 +170,7 @@ TEST(srslte_vec_sum_sss,
for (int i = 0; i < block_size; i++) {
gold = x[i] + y[i];
mse += cabsf(gold - z[i]);
mse += abs(gold - z[i]);
}
free(x);
@ -183,7 +183,7 @@ TEST(srslte_vec_sub_sss,
MALLOC(int16_t, y);
MALLOC(int16_t, z);
cf_t gold = 0.0f;
int16_t gold = 0.0f;
for (int i = 0; i < block_size; i++) {
x[i] = RANDOM_S();
y[i] = RANDOM_S();
@ -193,7 +193,7 @@ TEST(srslte_vec_sub_sss,
for (int i = 0; i < block_size; i++) {
gold = x[i] - y[i];
mse += cabsf(gold - z[i]);
mse += abs(gold - z[i]);
}
free(x);
@ -206,7 +206,7 @@ TEST(srslte_vec_prod_sss,
MALLOC(int16_t, y);
MALLOC(int16_t, z);
cf_t gold = 0.0f;
int16_t gold = 0.0f;
for (int i = 0; i < block_size; i++) {
x[i] = RANDOM_S();
y[i] = RANDOM_S();
@ -216,7 +216,7 @@ TEST(srslte_vec_prod_sss,
for (int i = 0; i < block_size; i++) {
gold = x[i] * y[i];
mse += cabsf(gold - z[i]);
mse += abs(gold - z[i]);
}
free(x);
@ -802,16 +802,18 @@ int main(int argc, char **argv) {
size_count++;
}
char fname[68];
char fname[69];
FILE *f = NULL;
void * p = popen("(date +%g%m%d && hostname) | tr '\\r\\n' '__'", "r");
if (p) {
fgets(fname, 64, p);
strncpy(fname + strnlen(fname, 64) - 1, ".tsv", 4);
strncpy(fname + strnlen(fname, 64) - 1, ".tsv", 5);
f = fopen(fname, "w");
if (f) printf("Saving benchmark results in '%s'\n", fname);
if (f) {
printf("Saving benchmark results in '%s'\n", fname);
}
pclose(p);
}
printf("\n");

Loading…
Cancel
Save