summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2015-08-20 08:38:18 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2015-08-20 08:38:18 +0200
commitcf168fca7088fb050a10b2e82789c6cd9356716b (patch)
tree0f6a96976c6f74f816bfc9d53dc7c7e323e7d43d /CMakeLists.txt
parent85bd783e0d80de9aec0a4bcd49ab4acd88ab07d0 (diff)
parent15db2bcc208d8e5bccf0464396431c7d8e6f3f28 (diff)
Merge pull request #23 from CNugteren/tuner_database
Added initial version of a tuner-database
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt28
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()
# ==================================================================================================