From 925e83577b419ac619d856f3db5b31d517ae9eba Mon Sep 17 00:00:00 2001 From: Paul Sutton Date: Thu, 28 Apr 2016 15:42:12 +0100 Subject: [PATCH 1/3] Adding support for MKL fft --- cmake/modules/FindMKL.cmake | 27 +++++++++++++++++++++++++++ srslte/CMakeLists.txt | 17 ++++++++++++----- srslte/lib/CMakeLists.txt | 8 +++++++- 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 cmake/modules/FindMKL.cmake diff --git a/cmake/modules/FindMKL.cmake b/cmake/modules/FindMKL.cmake new file mode 100644 index 000000000..2320cf065 --- /dev/null +++ b/cmake/modules/FindMKL.cmake @@ -0,0 +1,27 @@ +# - Try to find mkl - the Intel Math Kernel Library +# Once done this will define +# MKL_FOUND - System has mkl +# MKL_INCLUDE_DIRS - The mkl include directories +# MKL_LIBRARIES - The libraries needed to use mkl +# MKL_DEFINITIONS - Compiler switches required for using mkl + +find_path(MKL_INCLUDE_DIR + NAMES mkl.h + HINTS $ENV{MKL_DIR}/include + PATHS) + +find_library(MKL_LIBRARY + NAMES mkl_rt + HINTS $ENV{MKL_DIR}/lib/intel64 + PATHS) + +set(MKL_LIBRARIES ${MKL_LIBRARY} ) +set(MKL_INCLUDE_DIRS ${MKL_INCLUDE_DIR} ) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set MKL_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(mkl DEFAULT_MSG + MKL_LIBRARY MKL_INCLUDE_DIR) + +mark_as_advanced(MKL_INCLUDE_DIR MKL_LIBRARY ) diff --git a/srslte/CMakeLists.txt b/srslte/CMakeLists.txt index 87779de46..0ecf9ddf6 100644 --- a/srslte/CMakeLists.txt +++ b/srslte/CMakeLists.txt @@ -42,11 +42,18 @@ add_custom_target (add_srslte_headers SOURCES ${HEADERS_ALL}) ######################################################################## # Find Dependencies ######################################################################## -find_package(FFTW3F REQUIRED) -if(FFTW3F_FOUND) - include_directories(${FFTW3F_INCLUDE_DIRS}) - link_directories(${FFTW3F_LIBRARY_DIRS}) -endif(FFTW3F_FOUND) + +find_package(MKL) +if(MKL_FOUND) + include_directories(${MKL_INCLUDE_DIRS}) + link_directories(${MKL_LIBRARY_DIRS}) +else(MKL_FOUND) + find_package(FFTW3F REQUIRED) + if(FFTW3F_FOUND) + include_directories(${FFTW3F_INCLUDE_DIRS}) + link_directories(${FFTW3F_LIBRARY_DIRS}) + endif(FFTW3F_FOUND) +endif(MKL_FOUND) find_package(UHD) if(UHD_FOUND) diff --git a/srslte/lib/CMakeLists.txt b/srslte/lib/CMakeLists.txt index d5c1e0feb..daa60ac5a 100644 --- a/srslte/lib/CMakeLists.txt +++ b/srslte/lib/CMakeLists.txt @@ -76,10 +76,16 @@ if(NOT DisableMEX) ) endif(NOT DisableMEX) -target_link_libraries(srslte pthread m ${FFTW3F_LIBRARIES}) +target_link_libraries(srslte pthread m) set_target_properties(srslte PROPERTIES VERSION ${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR}) +if(MKL_FOUND) + target_link_libraries(srslte ${MKL_LIBRARIES}) +else(MKL_FOUND) + target_link_libraries(srslte ${FFTW3F_LIBRARIES}) +endif(MKL_FOUND) + if(RF_FOUND) if(UHD_FOUND) target_link_libraries(srslte ${UHD_LIBRARIES}) From e6809b4ada5001cd82d9b1650eea302d3cd54cb4 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 22 Jun 2016 16:53:14 +0300 Subject: [PATCH 2/3] cmake: fixed not linking fftw in srslte_static --- srslte/lib/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/srslte/lib/CMakeLists.txt b/srslte/lib/CMakeLists.txt index b23016b65..0b4c41d64 100644 --- a/srslte/lib/CMakeLists.txt +++ b/srslte/lib/CMakeLists.txt @@ -82,8 +82,14 @@ set_target_properties(srslte PROPERTIES if(MKL_FOUND) target_link_libraries(srslte ${MKL_LIBRARIES}) + if(NOT DisableMEX) + target_link_libraries(srslte_static ${MKL_LIBRARIES}) + endif(NOT DisableMEX) else(MKL_FOUND) target_link_libraries(srslte ${FFTW3F_LIBRARIES}) + if(NOT DisableMEX) + target_link_libraries(srslte_static ${FFTW3F_LIBRARIES}) + endif(NOT DisableMEX) endif(MKL_FOUND) if(RF_FOUND) From 267f7db85598c3d9fe862c3084d2efd01d0b355a Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 6 Jul 2016 19:04:46 +0200 Subject: [PATCH 3/3] plots to a single window --- srslte/examples/pdsch_ue.c | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index d9e209aee..6fb9013ee 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -67,7 +67,6 @@ uint32_t plot_sf_idx=0; bool plot_track = true; #endif -#define PLOT_CHEST_ARGUMENT #define PRINT_CHANGE_SCHEDULIGN //#define CORRECT_SAMPLE_OFFSET @@ -652,8 +651,7 @@ int main(int argc, char **argv) { #ifndef DISABLE_GRAPHICS -//plot_waterfall_t poutfft; -plot_real_t p_sync, pce, pce_arg; +plot_real_t p_sync, pce; plot_scatter_t pscatequal, pscatequal_pdcch; float tmp_plot[110*15*2048]; @@ -667,22 +665,18 @@ void *plot_thread_run(void *arg) { sdrgui_init(); - //plot_waterfall_init(&poutfft, SRSLTE_NRE * ue_dl.cell.nof_prb, 1000); - //plot_waterfall_setTitle(&poutfft, "Output FFT - Magnitude"); - //plot_waterfall_setPlotYAxisScale(&poutfft, -40, 40); + plot_scatter_init(&pscatequal); + plot_scatter_setTitle(&pscatequal, "PDSCH - Equalized Symbols"); + plot_scatter_setXAxisScale(&pscatequal, -4, 4); + plot_scatter_setYAxisScale(&pscatequal, -4, 4); + + plot_scatter_addToWindowGrid(&pscatequal, (char*)"pdsch_ue", 0, 0); if (!prog_args.disable_plots_except_constellation) { plot_real_init(&pce); plot_real_setTitle(&pce, "Channel Response - Magnitude"); plot_real_setLabels(&pce, "Index", "dB"); plot_real_setYAxisScale(&pce, -40, 40); - - #ifdef PLOT_CHEST_ARGUMENT - plot_real_init(&pce_arg); - plot_real_setTitle(&pce_arg, "Channel Response - Argument"); - plot_real_setLabels(&pce_arg, "Index", "rad"); - plot_real_setYAxisScale(&pce_arg, -1.1*M_PI, 1.1*M_PI); - #endif plot_real_init(&p_sync); plot_real_setTitle(&p_sync, "PSS Cross-Corr abs value"); @@ -692,13 +686,11 @@ void *plot_thread_run(void *arg) { plot_scatter_setTitle(&pscatequal_pdcch, "PDCCH - Equalized Symbols"); plot_scatter_setXAxisScale(&pscatequal_pdcch, -4, 4); plot_scatter_setYAxisScale(&pscatequal_pdcch, -4, 4); - } - - plot_scatter_init(&pscatequal); - plot_scatter_setTitle(&pscatequal, "PDSCH - Equalized Symbols"); - plot_scatter_setXAxisScale(&pscatequal, -4, 4); - plot_scatter_setYAxisScale(&pscatequal, -4, 4); + plot_real_addToWindowGrid(&pce, (char*)"pdsch_ue", 0, 1); + plot_real_addToWindowGrid(&pscatequal_pdcch, (char*)"pdsch_ue", 1, 0); + plot_real_addToWindowGrid(&p_sync, (char*)"pdsch_ue", 1, 1); + } while(1) { sem_wait(&plot_sem); @@ -739,13 +731,6 @@ void *plot_thread_run(void *arg) { } } - - #ifdef PLOT_CHEST_ARGUMENT - for (i = 0; i < 12*ue_dl.cell.nof_prb; i++) { - tmp_plot2[i] = cargf(ue_dl.ce[0][i]); - } - plot_real_setNewData(&pce_arg, tmp_plot2, i); - #endif plot_scatter_setNewData(&pscatequal_pdcch, ue_dl.pdcch.d, 36*ue_dl.pdcch.nof_cce); }