diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b598bf8..52049b4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,7 @@ set(LEVEL1_ROUTINES xaxpy) set(LEVEL2_ROUTINES xgemv xhemv xsymv) set(LEVEL3_ROUTINES xgemm xsymm xhemm xsyrk xherk xsyr2k xher2k xtrmm) set(ROUTINES ${LEVEL1_ROUTINES} ${LEVEL2_ROUTINES} ${LEVEL3_ROUTINES}) +set(PRECISIONS 32 3232 64 6464) # ================================================================================================== @@ -135,6 +136,17 @@ install(FILES include/clblast_c.h DESTINATION include) # ================================================================================================== +# Sets a default platform and device to run tuners and/or tests on +set(DEVICEPLATFORM ) +if(DEFINED ENV{DEFAULT_DEVICE}) + set(DEVICEPLATFORM ${DEVICEPLATFORM} -device $ENV{DEFAULT_DEVICE}) +endif() +if(DEFINED ENV{DEFAULT_PLATFORM}) + set(DEVICEPLATFORM ${DEVICEPLATFORM} -platform $ENV{DEFAULT_PLATFORM}) +endif() + +# ================================================================================================== + # This section contains all the code related to the examples if(SAMPLES) @@ -163,16 +175,24 @@ if(TUNERS) # Includes CLTune include_directories(${CLTUNE_INCLUDE_DIRS}) - # Creates the common tuner objects (requires CMake 2.8.8) - add_library(tuners_common OBJECT src/tuning/tuning.cc) - # Adds tuning executables foreach(KERNEL ${KERNELS}) - add_executable(tuner_${KERNEL} $<TARGET_OBJECTS:tuners_common> src/tuning/${KERNEL}.cc) + add_executable(tuner_${KERNEL} src/tuning/${KERNEL}.cc) target_link_libraries(tuner_${KERNEL} clblast ${CLTUNE_LIBRARIES} ${OPENCL_LIBRARIES}) install(TARGETS tuner_${KERNEL} DESTINATION bin) endforeach() + # Adds 'alltuners' target: runs all tuners for all precisions + set(ALLTUNERS ) + set(ALLTUNERSDEPENDS ) + foreach(KERNEL ${KERNELS}) + foreach(PRECISION ${PRECISIONS}) + set(ALLTUNERS ${ALLTUNERS} COMMAND tuner_${KERNEL} -precision ${PRECISION} ${DEVICEPLATFORM}) + endforeach() + set(ALLTUNERSDEPENDS tuner_${KERNEL}) + endforeach() + add_custom_target(alltuners ${ALLTUNERS} DEPENDS ${ALLTUNERSDEPENDS}) + endif() # ================================================================================================== |