Skip to content

Commit b1d2e37

Browse files
committed
Add CmakeLists
1 parent 8bd7228 commit b1d2e37

21 files changed

+61
-11
lines changed

DirectProgramming/C++SYCL/DenseLinearAlgebra/address_sanitizer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (NOT CMAKE_BUILD_TYPE)
99
STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel"
1010
FORCE)
1111
endif()
12-
project(Jacobi_Iterative_Solver)
12+
project(address_sanitizer)
1313

1414
option(GPU_SELECTOR "Option description" OFF)
1515
option(CPU_SELECTOR "Option description" OFF)

DirectProgramming/C++SYCL/DenseLinearAlgebra/address_sanitizer/sample.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"guid": "E3626FAB-DCD8-465F-A4E7-BF4A858D6583",
3-
"name": "Jacobi Iterative Solver",
2+
"guid": "198ADB7C-9E6E-4714-ACD3-E869C86CB174",
3+
"name": "Address Sanitizer",
44
"categories": ["Toolkit/oneAPI Direct Programming/C++SYCL/Dense Linear Algebra"],
5-
"description": "Jacobi Iterative Solver provides step by step instructions for CPU, GPU and multiple GPU offload",
5+
"description": "Address Sanitizer sample provides examples of error memory detection in SYCL",
66
"toolchain": ["dpcpp"],
77
"os": ["linux"],
88
"targetDevice": ["CPU", "GPU"],
@@ -17,9 +17,7 @@
1717
"cd build",
1818
"cmake ..",
1919
"make",
20-
"make run_1_cpu",
21-
"make run_2_gpu",
22-
"make run_3_multi_gpu"
20+
"make run_all"
2321
]
2422
}
2523
]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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

Comments
 (0)