Skip to content

Commit 59d496f

Browse files
authored
Fix oneapi-default workflow (#801)
* Set `SYCL_FLAGS` when oneapi-default is used * Use `NOT` instead of `NOT DEFINED` The former returns FALSE if the variable is defined but empty (which is the case when using `cmake-presets`).
1 parent be11bab commit 59d496f

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

CMakePresets.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@
104104
"CXX": "icpx",
105105
"FC": "ifx",
106106
"CXXFLAGS": "-Wno-uninitialized",
107-
"OCCA_ENABLE_DPCPP": "ON"
107+
"OCCA_ENABLE_DPCPP": "ON",
108+
"OCCA_DPCPP_COMPILER": "icpx",
109+
"OCCA_DPCPP_COMPILER_FLAGS": "-fsycl"
108110
}
109111
}
110112
],

cmake/FindDPCPP.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ find_library(
3939
lib
4040
)
4141

42-
if(NOT DEFINED SYCL_FLAGS)
43-
if(DEFINED ENV{SYCL_FLAGS})
44-
set(SYCL_FLAGS $ENV{SYCL_FLAGS})
42+
if(NOT OCCA_DPCPP_COMPILER_FLAGS)
43+
if(DEFINED ENV{OCCA_DPCPP_COMPILER_FLAGS})
44+
set(SYCL_FLAGS $ENV{OCCA_DPCPP_COMPILER_FLAGS})
4545
else()
4646
set(SYCL_FLAGS -fsycl)
4747
endif()

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ macro(compile_example target file mode)
5151
install(TARGETS ${target} DESTINATION ${install_dir})
5252
install(FILES ${OKLS} DESTINATION ${install_dir})
5353

54-
if (NOT DEFINED OCCA_ENABLE_TESTS)
54+
if (NOT OCCA_ENABLE_TESTS)
5555
return()
5656
endif()
5757
if (${mode})

examples/cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ add_subdirectory(19_stream_tags)
2020
add_subdirectory(20_native_dpcpp_kernel)
2121
add_subdirectory(30_device_function)
2222

23-
if (NOT DEFINED OCCA_CLANG_BASED_TRANSPILER)
23+
if (NOT OCCA_CLANG_BASED_TRANSPILER)
2424
add_subdirectory(31_oklt_v3_moving_avg)
2525
endif()

0 commit comments

Comments
 (0)