Skip to content

Commit be11bab

Browse files
authored
Add clang-sycl-nvidia workflow (#800)
* Add clang-sycl-nvidia workflow preset * Update CMakePresets.json * Use compiler root in find_path() for DPCPP * Delete configure-sycl-nv-cmake.sh * Use 16 parallel jobs for build
1 parent 8a2d22e commit be11bab

4 files changed

Lines changed: 66 additions & 66 deletions

File tree

CMakePresets.json

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
"name": "base",
1111
"hidden": true,
12-
"description": "OCCA configure base",
12+
"displayName": "Configure base",
1313
"generator": "Unix Makefiles",
1414
"binaryDir": "$env{OCCA_BUILD_DIR}",
1515
"installDir": "$env{OCCA_INSTALL_DIR}",
@@ -30,7 +30,10 @@
3030
"OCCA_ENABLE_FORTRAN": "$env{OCCA_ENABLE_FORTRAN}",
3131
"OCCA_ENABLE_TESTS": "$env{OCCA_ENABLE_TESTS}",
3232
"OCCA_ENABLE_EXAMPLES": "$env{OCCA_ENABLE_EXAMPLES}",
33-
"OCCA_ENABLE_CLANG_TRANSPILER": "$env{OCCA_ENABLE_CLANG_TRANSPILER}"
33+
"OCCA_ENABLE_CLANG_TRANSPILER": "$env{OCCA_ENABLE_CLANG_TRANSPILER}",
34+
"OCCA_DPCPP_COMPILER": "$env{OCCA_DPCPP_COMPILER}",
35+
"OCCA_DPCPP_COMPILER_FLAGS": "$env{OCCA_DPCPP_COMPILER_FLAGS}",
36+
"SYCL_FLAGS": "$env{OCCA_DPCPP_COMPILER_FLAGS}"
3437
},
3538
"environment": {
3639
"OCCA_BUILD_DIR": "${sourceDir}/build",
@@ -49,7 +52,7 @@
4952
},
5053
{
5154
"name": "system-default",
52-
"description": "OCCA configure with system default compilers",
55+
"displayName": "Configure with system default compilers",
5356
"inherits": "base",
5457
"environment": {
5558
"CC": "$penv{CC}",
@@ -62,7 +65,7 @@
6265
},
6366
{
6467
"name": "gnu-default",
65-
"description": "OCCA configure with GNU compilers",
68+
"displayName": "Configure with GNU compilers",
6669
"inherits": "base",
6770
"environment": {
6871
"CC": "gcc",
@@ -73,7 +76,7 @@
7376
},
7477
{
7578
"name": "clang-default",
76-
"description": "OCCA configure with LLVM/Clang compilers",
79+
"displayName": "Configure with LLVM/Clang compilers",
7780
"inherits": "base",
7881
"environment": {
7982
"CC": "clang",
@@ -82,9 +85,19 @@
8285
"OCCA_ENABLE_FORTRAN": "OFF"
8386
}
8487
},
88+
{
89+
"name" : "clang-sycl-nvidia",
90+
"displayName": "Configure with SYCL using LLVM/Clang compilers on Nvidia hardware",
91+
"inherits": "clang-default",
92+
"environment": {
93+
"OCCA_ENABLE_DPCPP": "ON",
94+
"OCCA_DPCPP_COMPILER": "clang++",
95+
"OCCA_DPCPP_COMPILER_FLAGS": "-fsycl -fsycl-targets=nvptx64-nvidia-cuda"
96+
}
97+
},
8598
{
8699
"name": "oneapi-default",
87-
"description": "OCCA configure with oneAPI compilers",
100+
"displayName": "Configure with oneAPI compilers",
88101
"inherits": "base",
89102
"environment": {
90103
"CC": "icx",
@@ -98,26 +111,32 @@
98111
"buildPresets": [
99112
{
100113
"name": "system-default",
101-
"description": "OCCA build with system default compilers",
114+
"displayName": "Build with system default compilers",
102115
"configurePreset": "system-default",
103116
"targets": ["install"],
104-
"jobs": 8
117+
"jobs": 16
105118
},
106119
{
107120
"name": "gnu-default",
108-
"description": "OCCA build with GNU compilers",
121+
"displayName": "Build with GNU compilers",
109122
"inherits": "system-default",
110123
"configurePreset": "gnu-default"
111124
},
112125
{
113126
"name": "clang-default",
114-
"description": "OCCA build with LLVM/Clang compilers",
127+
"displayName": "Build with LLVM/Clang compilers",
115128
"inherits": "system-default",
116129
"configurePreset": "clang-default"
117130
},
131+
{
132+
"name": "clang-sycl-nvidia",
133+
"displayName": "Build with SYCL using LLVM/Clang compilers on Nvidia hardware",
134+
"inherits": "clang-default",
135+
"configurePreset": "clang-sycl-nvidia"
136+
},
118137
{
119138
"name": "oneapi-default",
120-
"description": "OCCA build with oneAPI compilers",
139+
"displayName": "Build with oneAPI compilers",
121140
"inherits": "system-default",
122141
"configurePreset": "oneapi-default"
123142
}
@@ -145,6 +164,12 @@
145164
"inherits": "system-default",
146165
"configurePreset": "clang-default"
147166
},
167+
{
168+
"name": "clang-sycl-nvidia",
169+
"displayName": "Run tests with SYCL using LLVM/Clang compilers on Nvidia hardware",
170+
"inherits": "clang-default",
171+
"configurePreset": "clang-sycl-nvidia"
172+
},
148173
{
149174
"name": "gnu-default",
150175
"displayName": "Run tests with GNU compilers",
@@ -166,7 +191,7 @@
166191
"workflowPresets": [
167192
{
168193
"name": "system-default",
169-
"displayName": "Configure, build and install with system default compilers",
194+
"displayName": "Configure, build, install and test with system default compilers",
170195
"steps": [
171196
{
172197
"type": "configure",
@@ -184,7 +209,7 @@
184209
},
185210
{
186211
"name": "gnu-default",
187-
"displayName": "Configure, build and install with GNU compilers",
212+
"displayName": "Configure, build, install and test with GNU compilers",
188213
"steps": [
189214
{
190215
"type": "configure",
@@ -202,7 +227,7 @@
202227
},
203228
{
204229
"name": "clang-default",
205-
"displayName": "Configure, build and install with LLVM/Clang compilers",
230+
"displayName": "Configure, build, install and test with LLVM/Clang compilers",
206231
"steps": [
207232
{
208233
"type": "configure",
@@ -218,9 +243,27 @@
218243
}
219244
]
220245
},
246+
{
247+
"name": "clang-sycl-nvidia",
248+
"displayName": "Configure, build, install and test with SYCL using LLVM/Clang compilers on Nvidia hardware",
249+
"steps": [
250+
{
251+
"type": "configure",
252+
"name": "clang-sycl-nvidia"
253+
},
254+
{
255+
"type": "build",
256+
"name": "clang-sycl-nvidia"
257+
},
258+
{
259+
"type": "test",
260+
"name": "clang-sycl-nvidia"
261+
}
262+
]
263+
},
221264
{
222265
"name": "oneapi-default",
223-
"displayName": "Configure, build and install with oneAPI compilers",
266+
"displayName": "Configure, build, install and test with oneAPI compilers",
224267
"steps": [
225268
{
226269
"type": "configure",

CMakeUserPresets.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
{
2121
"name": "my-local-build",
2222
"inherits": "gnu-default",
23-
"configurePreset": "my-local-config",
24-
"jobs": 16
23+
"configurePreset": "my-local-config"
2524
}
2625
],
2726
"testPresets": [

cmake/FindDPCPP.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
message(CHECK_START "Looking for DPC++")
77
unset(missingDpcppComponents)
88

9+
cmake_path(CONVERT "${CMAKE_CXX_COMPILER}" TO_CMAKE_PATH_LIST compiler_path)
10+
cmake_path(GET compiler_path PARENT_PATH compiler_bin_dir)
11+
cmake_path(GET compiler_bin_dir PARENT_PATH compiler_root_dir)
12+
913
find_path(
1014
SYCL_INCLUDE_DIRS
1115
NAMES
@@ -14,7 +18,9 @@ find_path(
1418
ENV SYCL_ROOT
1519
/opt/intel/oneapi/compiler/latest/linux
1620
${SYCL_ROOT}
21+
${compiler_root_dir}
1722
PATH_SUFFIXES
23+
include
1824
include/sycl
1925
include/CL
2026
include/sycl/CL
@@ -28,6 +34,7 @@ find_library(
2834
ENV SYCL_ROOT
2935
/opt/intel/oneapi/compiler/latest/linux
3036
${SYCL_ROOT}
37+
${compiler_root_dir}
3138
PATH_SUFFIXES
3239
lib
3340
)

configure-sycl-nv-cmake.sh

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)