Skip to content

Commit 2011829

Browse files
authored
[UR] Decouple adapter tags & bump OpenCL 3609afc (#13278)
This patch makes use of the recently introduced `fetch_adapter_source()` utility function to decouple fetching all UR adapter source in the event that a different repo/tag pair is used. To facilitate this `fetch_adapter_source()` was updated to only perform a fetch if the adapter name is present in the `SYCL_ENABLE_PLUGINS` variable and the repo/tag pair does not match the values set in the `UNFIED_RUNTIME_REPO` and `UNIFIED_RUNTIME_TAG` variables. To exercise the newly decoupled adapter source mechanism the OpenCL adapter is bumped to 3609afc.
1 parent c74a144 commit 2011829

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

sycl/plugins/unified_runtime/CMakeLists.txt

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,25 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
6060
# fetch for a UR adapter, this allows development of adapters to be decoupled
6161
# from each other.
6262
#
63+
# A separate content fetch will not be performed if:
64+
# * The adapter name is not present in the SYCL_ENABLE_PLUGINS variable.
65+
# * The repo and tag provided match the values of the
66+
# UNIFIED_RUNTIME_REPO/UNIFIED_RUNTIME_TAG variables
67+
#
6368
# Args:
6469
# * name - Must be the directory name of the adapter
6570
# * repo - A valid Git URL of a Unified Runtime repo
6671
# * tag - A valid Git branch/tag/commit in the Unified Runtime repo
6772
function(fetch_adapter_source name repo tag)
68-
message(STATUS "Will fetch Unified Runtime ${name} adapter from ${repo} at ${tag}")
73+
if(NOT ${name} IN_LIST SYCL_ENABLE_PLUGINS)
74+
return()
75+
endif()
76+
if(repo STREQUAL UNIFIED_RUNTIME_REPO AND
77+
tag STREQUAL UNIFIED_RUNTIME_TAG)
78+
return()
79+
endif()
80+
message(STATUS
81+
"Will fetch Unified Runtime ${name} adapter from ${repo} at ${tag}")
6982
set(fetch-name unified-runtime-${name})
7083
FetchContent_Declare(${fetch-name}
7184
GIT_REPOSITORY ${repo} GIT_TAG ${tag})
@@ -90,6 +103,36 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
90103
# [L0] Fix DeviceInfo global mem free to report unsupported given MemCount==0
91104
set(UNIFIED_RUNTIME_TAG 065bf2dd97b58a4ceeb2fb83eed1df9319e61c59)
92105

106+
fetch_adapter_source(level_zero
107+
"https://github.com/oneapi-src/unified-runtime.git"
108+
${UNIFIED_RUNTIME_TAG}
109+
)
110+
111+
fetch_adapter_source(opencl
112+
"https://github.com/oneapi-src/unified-runtime.git"
113+
# Merge: e60c3c22 9287547e
114+
# Author: Kenneth Benzie (Benie) <[email protected]>
115+
# Date: Thu Apr 4 10:23:33 2024 +0200
116+
# Merge pull request #1448 from steffenlarsen/steffen/make_ext_func_fail_unsupported
117+
# [OpenCL] Make extension function lookup return unusupported error
118+
3609afc7f8781f2eae5de74deaf50ba52b1bb344
119+
)
120+
121+
fetch_adapter_source(cuda
122+
"https://github.com/oneapi-src/unified-runtime.git"
123+
${UNIFIED_RUNTIME_TAG}
124+
)
125+
126+
fetch_adapter_source(hip
127+
"https://github.com/oneapi-src/unified-runtime.git"
128+
${UNIFIED_RUNTIME_TAG}
129+
)
130+
131+
fetch_adapter_source(native_cpu
132+
"https://github.com/oneapi-src/unified-runtime.git"
133+
${UNIFIED_RUNTIME_TAG}
134+
)
135+
93136
if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)
94137
set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")
95138
endif()

0 commit comments

Comments
 (0)