Skip to content

Commit 367e948

Browse files
authored
[SYCL] Rename SYCL_ENABLE_PLUGINS to SYCL_ENABLE_BACKENDS (intel#14931)
Rename `SYCL_ENABLE_PLUGINS` to `SYCL_ENABLE_BACKENDS` Also rename `SYCL_PI_UR_USE_FETCH_CONTENT` to `SYCL_UR_USE_FETCH_CONTENT` and `SYCL_PI_UR_SOURCE_DIR` to `SYCL_UR_SOURCE_DIR` For intel#14927
1 parent a9a7852 commit 367e948

File tree

7 files changed

+55
-50
lines changed

7 files changed

+55
-50
lines changed

buildbot/configure.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ def do_configure(args):
5959
llvm_enable_sphinx = "OFF"
6060
llvm_build_shared_libs = "OFF"
6161
llvm_enable_lld = "OFF"
62-
sycl_enabled_plugins = ["opencl"]
62+
sycl_enabled_backends = ["opencl"]
6363
sycl_preview_lib = "ON"
6464

6565
sycl_enable_xpti_tracing = "ON"
6666
xpti_enable_werror = "OFF"
6767

6868
if sys.platform != "darwin":
69-
sycl_enabled_plugins.append("level_zero")
69+
sycl_enabled_backends.append("level_zero")
7070

7171
# lld is needed on Windows or for the HIP plugin on AMD
7272
if platform.system() == "Windows" or (args.hip and args.hip_platform == "AMD"):
@@ -80,7 +80,7 @@ def do_configure(args):
8080
llvm_targets_to_build += ";NVPTX"
8181
libclc_targets_to_build = libclc_nvidia_target_names
8282
libclc_gen_remangled_variants = "ON"
83-
sycl_enabled_plugins.append("cuda")
83+
sycl_enabled_backends.append("cuda")
8484

8585
if args.hip:
8686
if args.hip_platform == "AMD":
@@ -93,15 +93,15 @@ def do_configure(args):
9393
libclc_gen_remangled_variants = "ON"
9494

9595
sycl_build_pi_hip_platform = args.hip_platform
96-
sycl_enabled_plugins.append("hip")
96+
sycl_enabled_backends.append("hip")
9797

9898
if args.native_cpu:
9999
if args.native_cpu_libclc_targets:
100100
libclc_targets_to_build += ";" + args.native_cpu_libclc_targets
101101
else:
102102
libclc_build_native = "ON"
103103
libclc_gen_remangled_variants = "ON"
104-
sycl_enabled_plugins.append("native_cpu")
104+
sycl_enabled_backends.append("native_cpu")
105105

106106
# all llvm compiler targets don't require 3rd party dependencies, so can be
107107
# built/tested even if specific runtimes are not available
@@ -153,7 +153,7 @@ def do_configure(args):
153153
libclc_gen_remangled_variants = "ON"
154154

155155
if args.enable_plugin:
156-
sycl_enabled_plugins += args.enable_plugin
156+
sycl_enabled_backends += args.enable_plugin
157157

158158
if args.disable_preview_lib:
159159
sycl_preview_lib = "OFF"
@@ -188,7 +188,7 @@ def do_configure(args):
188188
"-DLLVM_ENABLE_LLD={}".format(llvm_enable_lld),
189189
"-DXPTI_ENABLE_WERROR={}".format(xpti_enable_werror),
190190
"-DSYCL_CLANG_EXTRA_FLAGS={}".format(sycl_clang_extra_flags),
191-
"-DSYCL_ENABLE_PLUGINS={}".format(";".join(set(sycl_enabled_plugins))),
191+
"-DSYCL_ENABLE_BACKENDS={}".format(";".join(set(sycl_enabled_backends))),
192192
"-DSYCL_ENABLE_EXTENSION_JIT={}".format(sycl_enable_jit),
193193
"-DSYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB={}".format(sycl_preview_lib),
194194
"-DBUG_REPORT_URL=https://github.com/intel/llvm/issues",

libdevice/cmake/modules/SYCLLibdevice.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ if (NOT MSVC)
167167
sycl-compiler)
168168
endif()
169169

170-
if("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS)
170+
if("native_cpu" IN_LIST SYCL_ENABLE_BACKENDS)
171171
if (NOT DEFINED NATIVE_CPU_DIR)
172172
message( FATAL_ERROR "Undefined UR variable NATIVE_CPU_DIR. The name may have changed." )
173173
endif()

llvm/lib/SYCLNativeCPUUtils/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ option(NATIVECPU_OCK_USE_FETCHCONTENT "Use FetchContent to acquire oneAPI Constr
2626
option(NATIVECPU_USE_OCK "Use the oneAPI Construction Kit for Native CPU" ON)
2727

2828
# Don't fetch OCK if Native CPU is not enabled.
29-
if(NOT "native_cpu" IN_LIST SYCL_ENABLE_PLUGINS)
29+
if(NOT "native_cpu" IN_LIST SYCL_ENABLE_BACKENDS)
3030
set(NATIVECPU_USE_OCK Off CACHE BOOL "Use the oneAPI Construction Kit for Native CPU" FORCE)
3131
endif()
3232

sycl/CMakeLists.txt

+16-11
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ if (NOT SYCL_COVERAGE_PATH)
1616
set(SYCL_COVERAGE_PATH "${CMAKE_CURRENT_BINARY_DIR}/profiles")
1717
endif()
1818

19-
# If SYCL_ENABLE_PLUGINS is undefined, we default to enabling OpenCL and Level
20-
# Zero plugins.
21-
if (NOT DEFINED SYCL_ENABLE_PLUGINS)
22-
set(SYCL_ENABLE_PLUGINS "opencl;level_zero")
19+
if (SYCL_ENABLE_PLUGINS)
20+
message(WARNING "SYCL_ENABLE_PLUGINS has been renamed, please use SYCL_ENABLE_BACKENDS instead")
21+
set(SYCL_ENABLE_BACKENDS "${SYCL_ENABLE_PLUGINS}" CACHE STRING "Backends enabled for SYCL" FORCE)
22+
endif()
23+
24+
# If SYCL_ENABLE_BACKENDS is undefined, we default to enabling OpenCL and Level
25+
# Zero backends.
26+
if (NOT DEFINED SYCL_ENABLE_BACKENDS)
27+
set(SYCL_ENABLE_BACKENDS "opencl;level_zero")
2328
endif()
2429

2530
# Option to enable JIT, this in turn makes kernel fusion and spec constant
@@ -167,19 +172,19 @@ install(DIRECTORY ${OpenCL_INCLUDE_DIR}/CL
167172
option(SYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB "Enable build of the SYCL major release preview library" ON)
168173

169174
# Needed for feature_test.hpp
170-
if ("cuda" IN_LIST SYCL_ENABLE_PLUGINS)
175+
if ("cuda" IN_LIST SYCL_ENABLE_BACKENDS)
171176
set(SYCL_BUILD_BACKEND_CUDA ON)
172177
endif()
173-
if ("hip" IN_LIST SYCL_ENABLE_PLUGINS)
178+
if ("hip" IN_LIST SYCL_ENABLE_BACKENDS)
174179
set(SYCL_BUILD_BACKEND_HIP ON)
175180
endif()
176-
if ("opencl" IN_LIST SYCL_ENABLE_PLUGINS)
181+
if ("opencl" IN_LIST SYCL_ENABLE_BACKENDS)
177182
set(SYCL_BUILD_BACKEND_OPENCL ON)
178183
endif()
179-
if ("level_zero" IN_LIST SYCL_ENABLE_PLUGINS)
184+
if ("level_zero" IN_LIST SYCL_ENABLE_BACKENDS)
180185
set(SYCL_BUILD_BACKENDLEVEL_ZERO ON)
181186
endif()
182-
if ("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS)
187+
if ("native_cpu" IN_LIST SYCL_ENABLE_BACKENDS)
183188
set(SYCL_BUILD_BACKEND_NATIVE_CPU ON)
184189
endif()
185190

@@ -483,7 +488,7 @@ if("libclc" IN_LIST LLVM_ENABLE_PROJECTS)
483488
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS libspirv-builtins)
484489
endif()
485490

486-
if("cuda" IN_LIST SYCL_ENABLE_PLUGINS)
491+
if("cuda" IN_LIST SYCL_ENABLE_BACKENDS)
487492
# Ensure that libclc is enabled.
488493
list(FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND)
489494
if( LIBCLC_FOUND EQUAL -1 )
@@ -495,7 +500,7 @@ if("cuda" IN_LIST SYCL_ENABLE_PLUGINS)
495500
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS ur_adapter_cuda)
496501
endif()
497502

498-
if("hip" IN_LIST SYCL_ENABLE_PLUGINS)
503+
if("hip" IN_LIST SYCL_ENABLE_BACKENDS)
499504
# Ensure that libclc is enabled.
500505
list(FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND)
501506
if( LIBCLC_FOUND EQUAL -1 )

sycl/cmake/modules/FetchUnifiedRuntime.cmake

+22-22
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ set(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_TAG
1818

1919
# Options to disable use of FetchContent to include Unified Runtime source code
2020
# to improve developer workflow.
21-
option(SYCL_PI_UR_USE_FETCH_CONTENT
21+
option(SYCL_UR_USE_FETCH_CONTENT
2222
"Use FetchContent to acquire the Unified Runtime source code" ON)
23-
set(SYCL_PI_UR_SOURCE_DIR
23+
set(SYCL_UR_SOURCE_DIR
2424
"" CACHE PATH "Path to root of Unified Runtime repository")
2525

2626
option(SYCL_UMF_DISABLE_HWLOC
@@ -33,24 +33,24 @@ set(UR_BUILD_XPTI_LIBS OFF)
3333
set(UR_ENABLE_SYMBOLIZER ON CACHE BOOL "Enable symbolizer for sanitizer layer.")
3434
set(UR_ENABLE_TRACING ON)
3535

36-
if("level_zero" IN_LIST SYCL_ENABLE_PLUGINS)
36+
if("level_zero" IN_LIST SYCL_ENABLE_BACKENDS)
3737
set(UR_BUILD_ADAPTER_L0 ON)
3838
endif()
39-
if("cuda" IN_LIST SYCL_ENABLE_PLUGINS)
39+
if("cuda" IN_LIST SYCL_ENABLE_BACKENDS)
4040
set(UR_BUILD_ADAPTER_CUDA ON)
4141
endif()
42-
if("hip" IN_LIST SYCL_ENABLE_PLUGINS)
42+
if("hip" IN_LIST SYCL_ENABLE_BACKENDS)
4343
set(UR_BUILD_ADAPTER_HIP ON)
4444
if (SYCL_ENABLE_EXTENSION_JIT)
4545
set(UR_ENABLE_COMGR ON)
4646
endif()
4747
endif()
48-
if("opencl" IN_LIST SYCL_ENABLE_PLUGINS)
48+
if("opencl" IN_LIST SYCL_ENABLE_BACKENDS)
4949
set(UR_BUILD_ADAPTER_OPENCL ON)
5050
set(UR_OPENCL_ICD_LOADER_LIBRARY OpenCL-ICD CACHE FILEPATH
5151
"Path of the OpenCL ICD Loader library" FORCE)
5252
endif()
53-
if("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS)
53+
if("native_cpu" IN_LIST SYCL_ENABLE_BACKENDS)
5454
set(UR_BUILD_ADAPTER_NATIVE_CPU ON)
5555
endif()
5656

@@ -70,15 +70,15 @@ else()
7070
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error")
7171
endif()
7272

73-
if(SYCL_PI_UR_USE_FETCH_CONTENT)
73+
if(SYCL_UR_USE_FETCH_CONTENT)
7474
include(FetchContent)
7575

7676
# The fetch_adapter_source function can be used to perform a separate content
77-
# fetch for a UR adapter, this allows development of adapters to be decoupled
77+
# fetch for a UR adapter (backend), this allows development of adapters to be decoupled
7878
# from each other.
7979
#
8080
# A separate content fetch will not be performed if:
81-
# * The adapter name is not present in the SYCL_ENABLE_PLUGINS variable.
81+
# * The adapter name is not present in the SYCL_ENABLE_BACKENDS variable.
8282
# * The repo and tag provided match the values of the
8383
# UNIFIED_RUNTIME_REPO/UNIFIED_RUNTIME_TAG variables
8484
#
@@ -87,7 +87,7 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
8787
# * repo - A valid Git URL of a Unified Runtime repo
8888
# * tag - A valid Git branch/tag/commit in the Unified Runtime repo
8989
function(fetch_adapter_source name repo tag)
90-
if(NOT ${name} IN_LIST SYCL_ENABLE_PLUGINS)
90+
if(NOT ${name} IN_LIST SYCL_ENABLE_BACKENDS)
9191
return()
9292
endif()
9393
if(repo STREQUAL UNIFIED_RUNTIME_REPO AND
@@ -179,24 +179,24 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
179179
set(UNIFIED_RUNTIME_SOURCE_DIR
180180
"${unified-runtime_SOURCE_DIR}" CACHE PATH
181181
"Path to Unified Runtime Headers" FORCE)
182-
elseif(SYCL_PI_UR_SOURCE_DIR)
183-
# SYCL_PI_UR_USE_FETCH_CONTENT is OFF and SYCL_PI_UR_SOURCE_DIR has been set,
182+
elseif(SYCL_UR_SOURCE_DIR)
183+
# SYCL_UR_USE_FETCH_CONTENT is OFF and SYCL_UR_SOURCE_DIR has been set,
184184
# use the external Unified Runtime source directory.
185185
set(UNIFIED_RUNTIME_SOURCE_DIR
186-
"${SYCL_PI_UR_SOURCE_DIR}" CACHE PATH
186+
"${SYCL_UR_SOURCE_DIR}" CACHE PATH
187187
"Path to Unified Runtime Headers" FORCE)
188188
add_subdirectory(
189189
${UNIFIED_RUNTIME_SOURCE_DIR}
190190
${CMAKE_CURRENT_BINARY_DIR}/unified-runtime)
191191
else()
192-
# SYCL_PI_UR_USE_FETCH_CONTENT is OFF and SYCL_PI_UR_SOURCE_DIR has not been
192+
# SYCL_UR_USE_FETCH_CONTENT is OFF and SYCL_UR_SOURCE_DIR has not been
193193
# set, check if the fallback local directory exists.
194194
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/unified-runtime)
195195
message(FATAL_ERROR
196-
"SYCL_PI_UR_USE_FETCH_CONTENT is disabled but no alternative Unified \
196+
"SYCL_UR_USE_FETCH_CONTENT is disabled but no alternative Unified \
197197
Runtime source directory has been provided, either:
198198
199-
* Set -DSYCL_PI_UR_SOURCE_DIR=/path/to/unified-runtime
199+
* Set -DSYCL_UR_SOURCE_DIR=/path/to/unified-runtime
200200
* Clone the UR repo in ${CMAKE_CURRENT_SOURCE_DIR}/unified-runtime")
201201
endif()
202202
# The fallback local directory for the Unified Runtime repository has been
@@ -269,26 +269,26 @@ function(add_sycl_ur_adapter NAME)
269269
SYCL_TOOLCHAIN_INSTALL_COMPONENTS ur_adapter_${NAME})
270270
endfunction()
271271

272-
if("level_zero" IN_LIST SYCL_ENABLE_PLUGINS)
272+
if("level_zero" IN_LIST SYCL_ENABLE_BACKENDS)
273273
add_sycl_ur_adapter(level_zero)
274274

275275
# TODO: L0 adapter does other... things in its cmake - make sure they get
276276
# added to the new build system
277277
endif()
278278

279-
if("cuda" IN_LIST SYCL_ENABLE_PLUGINS)
279+
if("cuda" IN_LIST SYCL_ENABLE_BACKENDS)
280280
add_sycl_ur_adapter(cuda)
281281
endif()
282282

283-
if("hip" IN_LIST SYCL_ENABLE_PLUGINS)
283+
if("hip" IN_LIST SYCL_ENABLE_BACKENDS)
284284
add_sycl_ur_adapter(hip)
285285
endif()
286286

287-
if("opencl" IN_LIST SYCL_ENABLE_PLUGINS)
287+
if("opencl" IN_LIST SYCL_ENABLE_BACKENDS)
288288
add_sycl_ur_adapter(opencl)
289289
endif()
290290

291-
if("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS)
291+
if("native_cpu" IN_LIST SYCL_ENABLE_BACKENDS)
292292
add_sycl_ur_adapter(native_cpu)
293293

294294
# Deal with OCK option

sycl/doc/GetStartedGuide.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -354,16 +354,16 @@ control which revision of Unified Runtime should be used when building DPC++:
354354
* `SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_TAG` is a variable which can be used to
355355
override the `UNIFIED_RUNTIME_TAG` variable used by `FetchContent` to attain
356356
the Unified Runtime source code.
357-
* `SYCL_PI_UR_USE_FETCH_CONTENT` is an option to control if CMake should use
357+
* `SYCL_UR_USE_FETCH_CONTENT` is an option to control if CMake should use
358358
`FetchContent` to pull in the Unified Runtime repository, it defaults to `ON`.
359359
When set to `OFF`, `FetchContent` will not be used, instead:
360-
* The path specified by variable `SYCL_PI_UR_SOURCE_DIR` will be used with
360+
* The path specified by variable `SYCL_UR_SOURCE_DIR` will be used with
361361
`add_directory()`. This can be used to point at an adjacent directory
362362
containing a clone of the Unified Runtime repository.
363363
* The path `sycl/plugins/unified_runtime/unified-runtime` will be used, if it
364364
exists. This can be used as-if an in-tree build.
365-
* `SYCL_PI_UR_SOURCE_DIR` is a variable used to specify the path to the Unified
366-
Runtime repository when `SYCL_PI_UR_USE_FETCH_CONTENT` is set of `OFF`.
365+
* `SYCL_UR_SOURCE_DIR` is a variable used to specify the path to the Unified
366+
Runtime repository when `SYCL_UR_USE_FETCH_CONTENT` is set of `OFF`.
367367

368368
### Build DPC++ libclc with a custom toolchain
369369

@@ -784,7 +784,7 @@ ONEAPI_DEVICE_SELECTOR=cuda:* ./simple-sycl-app-cuda.exe
784784
The default is the OpenCL backend if available.
785785
786786
**NOTE**: `nvptx64-nvidia-cuda` is usable with `-fsycl-targets`
787-
if clang was built with the cmake option `SYCL_ENABLE_PLUGINS=cuda`.
787+
if clang was built with the cmake option `SYCL_ENABLE_BACKENDS=cuda`.
788788
789789
### Build DPC++ application with CMake
790790

sycl/tools/sycl-trace/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ link_llvm_libs(sycl-trace
1010
LLVMSupport
1111
)
1212

13-
if ("level_zero" IN_LIST SYCL_ENABLE_PLUGINS)
13+
if ("level_zero" IN_LIST SYCL_ENABLE_BACKENDS)
1414
add_library(ze_trace_collector SHARED
1515
ze_trace_collector.cpp
1616
)
@@ -20,7 +20,7 @@ if ("level_zero" IN_LIST SYCL_ENABLE_PLUGINS)
2020
add_dependencies(sycl-trace ze_trace_collector)
2121
endif()
2222

23-
if ("cuda" IN_LIST SYCL_ENABLE_PLUGINS)
23+
if ("cuda" IN_LIST SYCL_ENABLE_BACKENDS)
2424
add_library(cuda_trace_collector SHARED
2525
cuda_trace_collector.cpp
2626
)
@@ -41,7 +41,7 @@ add_library(sycl_ur_trace_collector SHARED
4141
find_package(Python3 REQUIRED)
4242

4343
# To get L0 loader
44-
if ("level_zero" IN_LIST SYCL_ENABLE_PLUGINS)
44+
if ("level_zero" IN_LIST SYCL_ENABLE_BACKENDS)
4545
target_link_libraries(ze_trace_collector PRIVATE LevelZeroLoader-Headers)
4646
target_compile_definitions(ze_trace_collector PRIVATE SYCL_HAS_LEVEL_ZERO)
4747
target_link_libraries(ze_trace_collector PRIVATE xptifw)

0 commit comments

Comments
 (0)