1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 04:00:34 +00:00

Adds the option to avoid the use of OpenCL by doing 'cmake ../ -DDISABLE_OPENCL=1'

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@485 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Carles Fernandez 2014-03-15 01:21:17 +00:00
parent f73137e736
commit 26d2bc70b3
5 changed files with 30 additions and 7 deletions

View File

@ -657,6 +657,17 @@ endif(NOT ARMADILLO_FOUND)
# OpenCL
###############################################################################
find_package(OpenCL)
if($ENV{DISABLE_OPENCL})
set(DISABLE_OPENCL TRUE)
endif($ENV{DISABLE_OPENCL})
if(DISABLE_OPENCL)
set(OPENCL_FOUND FALSE)
else(DISABLE_OPENCL)
if(OPENCL_FOUND)
message(STATUS "OpenCL has been found and will be used by some processing blocks")
message(STATUS "You can disable OpenCL use by doing 'cmake -DDISABLE_OPENCL=1 ../' ")
endif(OPENCL_FOUND)
endif(DISABLE_OPENCL)
if(NOT OPENCL_FOUND)
message(STATUS "Processing blocks using OpenCL will not be built.")
endif(NOT OPENCL_FOUND)

View File

@ -98,10 +98,12 @@ if( RTLSDR_DRIVER )
endif( RTLSDR_DRIVER )
#Enable OpenCL if found in the system
if ( OPENCL_FOUND )
if(OPENCL_FOUND)
message(STATUS "Adding processing blocks implemented using OpenCL" )
add_definitions(-DOPENCL=1)
endif( OPENCL_FOUND )
add_definitions(-DOPENCL_BLOCKS=1)
else(OPENCL_FOUND)
add_definitions(-DOPENCL_BLOCKS=0)
endif(OPENCL_FOUND)
add_library(gnss_rx ${GNSS_RECEIVER_SOURCES})

View File

@ -79,7 +79,7 @@
#include "gps_l1_ca_pvt.h"
#include "galileo_e1_pvt.h"
#if OPENCL
#if OPENCL_BLOCKS
#include "gps_l1_ca_pcps_opencl_acquisition.h"
#endif
@ -403,7 +403,7 @@ GNSSBlockInterface* GNSSBlockFactory::GetBlock(
out_streams, queue);
}
#if OPENCL
#if OPENCL_BLOCKS
else if (implementation.compare("GPS_L1_CA_PCPS_OpenCl_Acquisition") == 0)
{
block = new GpsL1CaPcpsOpenClAcquisition(configuration, role, in_streams,

View File

@ -80,6 +80,7 @@ else(NOT GTEST_DIR_LOCAL)
set(GTEST_LIBRARIES gtest)
endif(NOT GTEST_DIR_LOCAL)
include_directories(
${GTEST_INCLUDE_DIRECTORIES}
@ -104,6 +105,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/output_filter/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/pvt/libs
${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
@ -120,6 +122,10 @@ if(OS_IS_MACOSX)
endif(MACOSX_MAVERICKS)
endif(OS_IS_MACOSX)
if(OPENCL_FOUND)
add_definitions(-DOPENCL_BLOCKS_TEST=1)
endif(OPENCL_FOUND)
add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc)
target_link_libraries(run_tests ${MAC_LIBRARIES}
@ -135,6 +141,8 @@ target_link_libraries(run_tests ${MAC_LIBRARIES}
gnss_rx
signal_generator_blocks
signal_generator_adapters
out_adapters
pvt_gr_blocks
)
install(TARGETS run_tests DESTINATION ${CMAKE_SOURCE_DIR}/install)
@ -168,7 +176,7 @@ add_executable(gnss_block_test EXCLUDE_FROM_ALL
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_acquisition_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_multithread_acquisition_gsoc2013_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc
# ${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/galileo_e1_pcps_ambiguous_acquisition_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc
@ -187,6 +195,7 @@ target_link_libraries(gnss_block_test ${Boost_LIBRARIES}
gnss_sp_libs
gnss_rx
signal_generator_blocks
out_adapters
)
add_test(gnss_block_test gnss_block_test)

View File

@ -78,6 +78,7 @@
#include "string_converter/string_converter_test.cc"
//#include "flowgraph/gnss_flowgraph_test.cc"
#include "gnss_block/rtcm_printer_test.cc"
#include "gnss_block/file_output_filter_test.cc"
#include "gnss_block/file_signal_source_test.cc"
#include "gnss_block/fir_filter_test.cc"
@ -85,7 +86,7 @@
#include "gnss_block/gps_l1_ca_pcps_acquisition_test.cc"
#include "gnss_block/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc"
//#include "gnss_block/gps_l1_ca_pcps_multithread_acquisition_gsoc2013_test.cc"
#if OPENCL
#if OPENCL_BLOCKS_TEST
#include "gnss_block/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc"
#endif
#include "gnss_block/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc"