Files
triton/bench/CMakeLists.txt

45 lines
1.3 KiB
CMake
Raw Normal View History

2014-11-06 07:07:27 -05:00
set(CMAKE_BUILD_TYPE Release)
set(BLAS_DEF)
2015-01-27 15:32:59 -05:00
set(BLAS_LIBS atidlas ${OPENCL_LIBRARIES})
#CUBLAS
2014-11-06 07:07:27 -05:00
find_package(CUDA)
if(CUDA_FOUND)
2015-01-27 15:12:08 -05:00
set(BLAS_DEF ${BLAS_DEF} "-DBENCH_CUBLAS")
endif()
2015-01-27 15:12:08 -05:00
#CLAMDBLAS
2015-01-27 15:12:08 -05:00
find_package(CLAMDBLAS)
if(CLAMDBLAS_FOUND)
set(BLAS_DEF ${BLAS_DEF} "-DBENCH_CLAMDBLAS")
include_directories(${CLAMDBLAS_INCLUDE_DIR})
set(BLAS_LIBS ${BLAS_LIBS} ${CLAMDBLAS_LIBRARIES} )
endif()
2015-01-27 15:12:08 -05:00
#CBLAS
find_package(MKL)
if(MKL_FOUND)
set(BLAS_DEF ${BLAS_DEF} "-DBENCH_CBLAS")
include_directories(${MKL_INCLUDE_DIR})
set(BLAS_LIBS ${BLAS_LIBS} ${MKL_LIBRARIES} )
endif()
string(REPLACE ";" " " BLAS_DEF_STR "${BLAS_DEF}")
2014-11-06 07:07:27 -05:00
foreach(PROG blas overhead)
2015-01-27 21:42:52 +01:00
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
2015-01-27 15:32:59 -05:00
if(CUDA_FOUND)
2015-01-29 22:40:41 +01:00
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} " ${BLAS_DEF_STR}")
2015-01-27 21:42:52 +01:00
set(CUPROG ${CMAKE_CURRENT_BINARY_DIR}/${PROG}.cu)
file(COPY ${PROG}.cpp DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/${PROG}.cpp ${CUPROG})
2015-01-27 15:32:59 -05:00
cuda_add_executable(${PROG}-bench ${CUPROG})
2015-01-29 22:40:41 +01:00
cuda_add_cublas_to_target(${PROG}-bench)
2015-01-27 15:32:59 -05:00
else()
add_executable(${PROG}-bench ${PROG}.cpp)
2015-02-01 15:58:05 -05:00
set_target_properties(${PROG}-bench PROPERTIES COMPILE_FLAGS "-Wall -Wextra ${BLAS_DEF_STR} -std=c++11")
2015-01-27 15:32:59 -05:00
endif()
target_link_libraries(${PROG}-bench ${BLAS_LIBS})
2014-11-06 07:07:27 -05:00
endforeach(PROG)