|
| 1 | +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl -Xarch_device -fsanitize=address -g -O2") |
| 2 | +# Set default build type to RelWithDebInfo if not specified |
| 3 | +if (NOT CMAKE_BUILD_TYPE) |
| 4 | + message (STATUS "Default CMAKE_BUILD_TYPE not set using Release with Debug Info") |
| 5 | + set (CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE |
| 6 | + STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel" |
| 7 | + FORCE) |
| 8 | +endif() |
| 9 | + |
| 10 | +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") |
| 11 | +set(ENV{ONEAPI_DEVICE_SELECTOR} "level_zero:cpu") |
| 12 | +# set(ENV{ONEAPI_DEVICE_SELECTOR} "level_zero:gpu") |
| 13 | + |
| 14 | +add_executable(array_reduction array_reduction.cpp) |
| 15 | +add_executable(bad_free bad_free.cpp) |
| 16 | +add_executable(device_global device_global.cpp) |
| 17 | +add_executable(group_local group_local.cpp) |
| 18 | +add_executable(local_stencil local_stencil.cpp) |
| 19 | +add_executable(map map.cpp) |
| 20 | +add_executable(matmul_broadcast matmul_broadcast.cpp) |
| 21 | +add_executable(misalign-long misalign-long.cpp) |
| 22 | +add_executable(nd_range_reduction nd_range_reduction.cpp) |
| 23 | + |
| 24 | +target_link_libraries(array_reduction OpenCL sycl) |
| 25 | +target_link_libraries(bad_free OpenCL sycl) |
| 26 | +target_link_libraries(device_global OpenCL sycl) |
| 27 | +target_link_libraries(group_local OpenCL sycl) |
| 28 | +target_link_libraries(local_stencil OpenCL sycl) |
| 29 | +target_link_libraries(map OpenCL sycl) |
| 30 | +target_link_libraries(matmul_broadcast OpenCL sycl) |
| 31 | +target_link_libraries(misalign-long OpenCL sycl) |
| 32 | +target_link_libraries(nd_range_reduction OpenCL sycl) |
| 33 | + |
| 34 | +add_custom_target(run_all array_reduction |
| 35 | + COMMAND bad_free |
| 36 | + COMMAND device_global |
| 37 | + COMMAND group_local |
| 38 | + COMMAND local_stencil |
| 39 | + COMMAND map |
| 40 | + COMMAND matmul_broadcast |
| 41 | + COMMAND misalign-long |
| 42 | + COMMAND nd_range_reduction) |
| 43 | + |
| 44 | +add_custom_target(run_array_reduction array_reduction) |
| 45 | +add_custom_target(run_bad_free bad_free) |
| 46 | +add_custom_target(run_device_global device_global) |
| 47 | +add_custom_target(run_group_local group_local) |
| 48 | +add_custom_target(run_local_stencil local_stencil) |
| 49 | +add_custom_target(run_map map) |
| 50 | +add_custom_target(run_matmul_broadcast matmul_broadcast) |
| 51 | +add_custom_target(run_misalign-long misalign-long) |
| 52 | +add_custom_target(run_nd_range_reduction nd_range_reduction) |
0 commit comments