Commit 18951bad authored by Laurent THOMAS's avatar Laurent THOMAS

remove-cblas-oai-5g

parent 82597e7e
......@@ -1879,8 +1879,6 @@ set (SIMUSRC
)
add_library(SIMU STATIC ${SIMUSRC} )
target_include_directories(SIMU PUBLIC ${OPENAIR1_DIR}/SIMULATION/TOOLS ${OPENAIR1_DIR}/SIMULATION/RF)
target_link_libraries(SIMU PRIVATE ${blas_LIBRARIES} ${cblas_LIBRARIES} ${lapacke_LIBRARIES})
target_include_directories(SIMU PRIVATE ${blas_INCLUDE_DIRS} ${lapacke_INCLUDE_DIRS})
# Qt-based scope
add_boolean_option(ENABLE_NRQTSCOPE OFF "Build the Qt-Scope" OFF)
......
......@@ -20,7 +20,6 @@
*/
#include <math.h>
#include <cblas.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -20,7 +20,6 @@
*/
#include <math.h>
#include <cblas.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -527,15 +526,13 @@ double get_normalization_ch_factor(channel_desc_t *desc)
bzero(acorr, desc->nb_tx * desc->nb_rx * sizeof(struct complexd));
for (int aatx = 0; aatx < desc->nb_tx; aatx++) {
for (int aarx = 0; aarx < desc->nb_rx; aarx++) {
cblas_zaxpy(desc->nb_tx * desc->nb_rx,
(void *)&anew[aarx + (aatx * desc->nb_rx)],
(void *)desc->R_sqrt[aarx + (aatx * desc->nb_rx)],
1,
(void *)acorr,
1);
for (int inside = 0; inside < desc->nb_tx * desc->nb_rx; inside++) {
const cd_t tmp = cdMul(anew[aarx + aatx * desc->nb_rx], desc->R_sqrt[aarx + aatx * desc->nb_rx][inside]);
csum(acorr[inside], tmp, acorr[inside]);
}
} // for (int aarx = 0; aarx < desc->nb_rx; aarx++)
} // for (int aatx = 0; aatx < desc->nb_tx; aatx++)
cblas_zcopy(desc->nb_tx * desc->nb_rx, (void *)acorr, 1, (void *)a[l], 1);
memcpy(a[l], acorr, desc->nb_tx * desc->nb_rx * sizeof(*acorr));
} // for (int l = 0; l < (int)desc->nb_taps; l++)
for (int aarx = 0; aarx < desc->nb_rx; aarx++) {
......@@ -1759,7 +1756,7 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) {
acorr[aarx+(aatx*desc->nb_rx)].i = desc->ch[aarx+(aatx*desc->nb_rx)][0].i;
}
}
cblas_zcopy(desc->nb_tx*desc->nb_rx, (void *) acorr, 1, (void *) desc->a[0], 1);
memcpy(desc->a[0], acorr, desc->nb_tx * desc->nb_rx * sizeof(*acorr));
stop_meas(&desc->random_channel);
desc->first_run = 0;
return 0;
......@@ -1810,16 +1807,17 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) {
if (desc->modelid >= TDL_A && desc->modelid <= TDL_E) {
for (aatx = 0; aatx < desc->nb_tx; aatx++) {
for (aarx=0; aarx<desc->nb_rx; aarx++) {
cblas_zaxpy(desc->nb_tx*desc->nb_rx,
(void *) &anew[aarx+(aatx*desc->nb_rx)],
(void *) desc->R_sqrt[aarx+(aatx*desc->nb_rx)],
1,
(void *) acorr,
1);
for (int inside = 0; inside < desc->nb_tx * desc->nb_rx; inside++) {
const cd_t tmp = cdMul(anew[aarx + aatx * desc->nb_rx], desc->R_sqrt[aarx + aatx * desc->nb_rx][inside]);
csum(acorr[inside], tmp, acorr[inside]);
}
}
}
} else {
cblas_zaxpy(desc->nb_tx*desc->nb_rx, (void *) desc->R_sqrt[i/3], (void *) anew, 1, (void *) acorr, 1);
for (int inside = 0; inside < desc->nb_tx * desc->nb_rx; inside++) {
const cd_t tmp = cdMul(desc->R_sqrt[i / 3][0], anew[inside]);
csum(acorr[inside], tmp, acorr[inside]);
}
}
/*
......@@ -1844,7 +1842,7 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) {
*/
if (desc->first_run==1) {
cblas_zcopy(desc->nb_tx*desc->nb_rx, (void *) acorr, 1, (void *) desc->a[i], 1);
memcpy(desc->a[i], acorr, desc->nb_tx * desc->nb_rx * sizeof(*acorr));
} else {
// a = alpha*acorr+beta*a
// a = beta*a
......@@ -1853,8 +1851,11 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) {
alpha.i = 0;
beta.r = sqrt(desc->forgetting_factor);
beta.i = 0;
cblas_zscal(desc->nb_tx*desc->nb_rx, (void *) &beta, (void *) desc->a[i], 1);
cblas_zaxpy(desc->nb_tx*desc->nb_rx, (void *) &alpha, (void *) acorr, 1, (void *) desc->a[i], 1);
for (int inside = 0; inside < desc->nb_tx * desc->nb_rx; inside++) {
desc->a[i][inside] = cdMul(beta, desc->a[i][inside]);
const cd_t tmp = cdMul(alpha, acorr[inside]);
csum(desc->a[i][inside], tmp, desc->a[i][inside]);
}
// desc->a[i][aarx+(aatx*desc->nb_rx)].x = (sqrt(desc->forgetting_factor)*desc->a[i][aarx+(aatx*desc->nb_rx)].x) + sqrt(1-desc->forgetting_factor)*anew.x;
// desc->a[i][aarx+(aatx*desc->nb_rx)].y = (sqrt(desc->forgetting_factor)*desc->a[i][aarx+(aatx*desc->nb_rx)].y) + sqrt(1-desc->forgetting_factor)*anew.y;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment