forked from unisa-hpc/sycl-bench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
98 lines (84 loc) · 2.75 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
cmake_minimum_required (VERSION 3.5)
project(sycl-bench)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake Build Type" FORCE)
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(CMAKE_GENERATOR STREQUAL "Ninja")
set(CMAKE_SYCL_FLAGS "${CMAKE_SYCL_FLAGS} -fdiagnostics-color=always")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
set(COMPUTECPP_USER_FLAGS "${COMPUTECPP_USER_FLAGS} -fdiagnostics-color=always")
endif()
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_SOURCE_DIR}/polybench/common)
set(supported_implementations
ComputeCpp
hipSYCL
triSYCL
)
list(FIND supported_implementations ${SYCL_IMPL} impl_idx)
if(NOT SYCL_IMPL OR impl_idx EQUAL -1)
message(FATAL_ERROR "Please specify SYCL_IMPL (one of: ${supported_implementations})")
endif()
if(SYCL_IMPL STREQUAL "ComputeCpp")
find_package(ComputeCpp MODULE REQUIRED)
elseif(SYCL_IMPL STREQUAL "hipSYCL")
find_package(hipSYCL CONFIG REQUIRED)
elseif(SYCL_IMPL STREQUAL "triSYCL")
find_package(TriSYCL MODULE REQUIRED)
endif()
set(benchmarks
micro/pattern_arith.cpp
micro/pattern_DRAM.cpp
micro/pattern_L2.cpp
micro/pattern_sf.cpp
micro/pattern_shared.cpp
single-kernel/median.cpp
single-kernel/scalar_prod.cpp
single-kernel/sobel.cpp
single-kernel/sobel5.cpp
single-kernel/sobel7.cpp
single-kernel/vec_add.cpp
single-kernel/lin_reg_error.cpp
single-kernel/lin_reg_coeff.cpp
single-kernel/kmeans.cpp
single-kernel/mol_dyn.cpp
pattern/segmentedreduction.cpp
pattern/reduction.cpp
runtime/dag_task_throughput_sequential.cpp
runtime/dag_task_throughput_independent.cpp
runtime/blocked_transform.cpp
polybench/2DConvolution.cpp
polybench/2mm.cpp
polybench/3DConvolution.cpp
polybench/3mm.cpp
polybench/atax.cpp
polybench/bicg.cpp
polybench/correlation.cpp
polybench/covariance.cpp
polybench/fdtd2d.cpp
polybench/gemm.cpp
polybench/gesummv.cpp
polybench/gramschmidt.cpp
polybench/mvt.cpp
polybench/syr2k.cpp
polybench/syrk.cpp
)
foreach(benchmark IN LISTS benchmarks)
get_filename_component(target ${benchmark} NAME_WE)
add_executable(${target} ${benchmark})
if(SYCL_IMPL STREQUAL "triSYCL")
add_sycl_to_target(${target})
else()
add_sycl_to_target(TARGET ${target} SOURCES ${benchmark})
endif()
install(TARGETS ${target} RUNTIME DESTINATION bin/)
get_filename_component(dir ${benchmark} DIRECTORY)
set_property(TARGET ${target} PROPERTY FOLDER ${dir})
endforeach(benchmark)
install(PROGRAMS bin/run-suite DESTINATION bin/)
install(FILES ${PROJECT_SOURCE_DIR}/Brommy.bmp DESTINATION share/)