Skip to content

Commit 41ec405

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into pushed
2 parents b9a0b9f + bfc783f commit 41ec405

26 files changed

+302
-462
lines changed

sycl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ if(MSVC)
8383
endif()
8484

8585
include(FetchEmhash)
86-
include(FetchUnifiedRuntime)
86+
include(BuildUnifiedRuntime)
8787

8888
# The change in SYCL_MAJOR_VERSION must be accompanied with the same update in
8989
# llvm/clang/lib/Driver/CMakeLists.txt.

sycl/cmake/modules/FetchUnifiedRuntime.cmake renamed to sycl/cmake/modules/BuildUnifiedRuntime.cmake

Lines changed: 15 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Either fetches UR from the appropriate repo or sets up variables based on user
2-
# preference.
1+
# Builds in-tree UR
32

43
# TODO: taken from sycl/plugins/CMakeLists.txt - maybe we should handle this
54
# within UR (although it is an obscure warning that the build system here
@@ -9,20 +8,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang|IntelLLVM" )
98
endif()
109

1110

12-
# Options to override the default behaviour of the FetchContent to include UR
13-
# source code.
14-
set(SYCL_UR_OVERRIDE_FETCH_CONTENT_REPO
15-
"" CACHE STRING "Override the Unified Runtime FetchContent repository")
16-
set(SYCL_UR_OVERRIDE_FETCH_CONTENT_TAG
17-
"" CACHE STRING "Override the Unified Runtime FetchContent tag")
18-
19-
# Options to disable use of FetchContent to include Unified Runtime source code
20-
# to improve developer workflow.
21-
option(SYCL_UR_USE_FETCH_CONTENT
22-
"Use FetchContent to acquire the Unified Runtime source code" ON)
23-
set(SYCL_UR_SOURCE_DIR
24-
"" CACHE PATH "Path to root of Unified Runtime repository")
25-
2611
option(SYCL_UR_BUILD_TESTS "Build tests for UR" OFF)
2712
set(UR_BUILD_TESTS "${SYCL_UR_BUILD_TESTS}" CACHE BOOL "" FORCE)
2813
# UR tests require the examples to be built
@@ -80,154 +65,26 @@ endif()
8065
set(UR_INTREE_SOURCE_DIR "${LLVM_SOURCE_DIR}/../unified-runtime")
8166
cmake_path(NORMAL_PATH UR_INTREE_SOURCE_DIR OUTPUT_VARIABLE UR_INTREE_SOURCE_DIR)
8267

83-
if(IS_DIRECTORY "${UR_INTREE_SOURCE_DIR}")
84-
set(UR_INTREE_BINARY_DIR ${LLVM_BINARY_DIR}/unified-runtime)
85-
set(UNIFIED_RUNTIME_SOURCE_DIR
86-
"${UR_INTREE_SOURCE_DIR}" CACHE PATH
87-
"Path to Unified Runtime Headers" FORCE)
88-
set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
89-
# Due to the use of dependentloadflag and no installer for UMF and hwloc we need
90-
# to link statically on windows
91-
if(WIN32)
92-
set(UMF_BUILD_SHARED_LIBRARY OFF CACHE INTERNAL "Build UMF shared library")
93-
set(UMF_LINK_HWLOC_STATICALLY ON CACHE INTERNAL "static HWLOC")
94-
endif()
95-
add_subdirectory(${UNIFIED_RUNTIME_SOURCE_DIR} ${UR_INTREE_BINARY_DIR})
96-
elseif(SYCL_UR_USE_FETCH_CONTENT)
97-
include(FetchContent)
98-
99-
# The fetch_adapter_source function can be used to perform a separate content
100-
# fetch for a UR adapter (backend), this allows development of adapters to be decoupled
101-
# from each other.
102-
#
103-
# A separate content fetch will not be performed if:
104-
# * The adapter name is not present in the SYCL_ENABLE_BACKENDS variable.
105-
# * The repo and tag provided match the values of the
106-
# UNIFIED_RUNTIME_REPO/UNIFIED_RUNTIME_TAG variables
107-
#
108-
# Args:
109-
# * name - Must be the directory name of the adapter
110-
# * repo - A valid Git URL of a Unified Runtime repo
111-
# * tag - A valid Git branch/tag/commit in the Unified Runtime repo
112-
function(fetch_adapter_source name repo tag)
113-
if(NOT ${name} IN_LIST SYCL_ENABLE_BACKENDS)
114-
return()
115-
endif()
116-
if(repo STREQUAL UNIFIED_RUNTIME_REPO AND
117-
tag STREQUAL UNIFIED_RUNTIME_TAG)
118-
# If the adapter sources are taken from the main checkout, reset the
119-
# adapter specific source path.
120-
string(TOUPPER ${name} NAME)
121-
set(UR_ADAPTER_${NAME}_SOURCE_DIR ""
122-
CACHE PATH "Path to external '${name}' adapter source dir" FORCE)
123-
return()
124-
endif()
125-
message(STATUS
126-
"Will fetch Unified Runtime ${name} adapter from ${repo} at ${tag}")
127-
set(fetch-name ur-${name})
128-
FetchContent_Declare(${fetch-name}
129-
GIT_REPOSITORY ${repo} GIT_TAG ${tag})
130-
# We don't want to add this repo to the build, only fetch its source.
131-
FetchContent_Populate(${fetch-name})
132-
# Get the path to the source directory
133-
string(TOUPPER ${name} NAME)
134-
set(source_dir_var UR_ADAPTER_${NAME}_SOURCE_DIR)
135-
FetchContent_GetProperties(${fetch-name} SOURCE_DIR UR_ADAPTER_${NAME}_SOURCE_DIR)
136-
# Set the variable which informs UR where to get the adapter source from.
137-
set(UR_ADAPTER_${NAME}_SOURCE_DIR
138-
"${UR_ADAPTER_${NAME}_SOURCE_DIR}/source/adapters/${name}"
139-
CACHE PATH "Path to external '${name}' adapter source dir" FORCE)
140-
endfunction()
141-
142-
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
143-
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/UnifiedRuntimeTag.cmake)
144-
145-
set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
146-
# Due to the use of dependentloadflag and no installer for UMF and hwloc we need
147-
# to link statically on windows
148-
if(WIN32)
149-
set(UMF_BUILD_SHARED_LIBRARY OFF CACHE INTERNAL "Build UMF shared library")
150-
set(UMF_LINK_HWLOC_STATICALLY ON CACHE INTERNAL "static HWLOC")
151-
endif()
152-
153-
fetch_adapter_source(level_zero
154-
${UNIFIED_RUNTIME_REPO}
155-
${UNIFIED_RUNTIME_TAG}
156-
)
157-
158-
fetch_adapter_source(opencl
159-
${UNIFIED_RUNTIME_REPO}
160-
${UNIFIED_RUNTIME_TAG}
161-
)
162-
163-
fetch_adapter_source(cuda
164-
${UNIFIED_RUNTIME_REPO}
165-
${UNIFIED_RUNTIME_TAG}
166-
)
167-
168-
fetch_adapter_source(hip
169-
${UNIFIED_RUNTIME_REPO}
170-
${UNIFIED_RUNTIME_TAG}
171-
)
172-
173-
fetch_adapter_source(native_cpu
174-
${UNIFIED_RUNTIME_REPO}
175-
${UNIFIED_RUNTIME_TAG}
176-
)
177-
178-
if(SYCL_UR_OVERRIDE_FETCH_CONTENT_REPO)
179-
set(UNIFIED_RUNTIME_REPO "${SYCL_UR_OVERRIDE_FETCH_CONTENT_REPO}")
180-
endif()
181-
if(SYCL_UR_OVERRIDE_FETCH_CONTENT_TAG)
182-
set(UNIFIED_RUNTIME_TAG "${SYCL_UR_OVERRIDE_FETCH_CONTENT_TAG}")
183-
endif()
184-
185-
message(STATUS "Will fetch Unified Runtime from ${UNIFIED_RUNTIME_REPO}")
186-
FetchContent_Declare(unified-runtime
187-
GIT_REPOSITORY ${UNIFIED_RUNTIME_REPO}
188-
GIT_TAG ${UNIFIED_RUNTIME_TAG}
189-
)
68+
if(NOT IS_DIRECTORY "${UR_INTREE_SOURCE_DIR}")
69+
message(FATAL_ERROR "unified-runtime folder not found at repo root")
70+
endif()
19071

191-
FetchContent_GetProperties(unified-runtime)
192-
FetchContent_MakeAvailable(unified-runtime)
193-
194-
set(UNIFIED_RUNTIME_SOURCE_DIR
195-
"${unified-runtime_SOURCE_DIR}" CACHE PATH
196-
"Path to Unified Runtime Headers" FORCE)
197-
elseif(SYCL_UR_SOURCE_DIR)
198-
# SYCL_UR_USE_FETCH_CONTENT is OFF and SYCL_UR_SOURCE_DIR has been set,
199-
# use the external Unified Runtime source directory.
200-
set(UNIFIED_RUNTIME_SOURCE_DIR
201-
"${SYCL_UR_SOURCE_DIR}" CACHE PATH
202-
"Path to Unified Runtime Headers" FORCE)
203-
add_subdirectory(
204-
${UNIFIED_RUNTIME_SOURCE_DIR}
205-
${CMAKE_CURRENT_BINARY_DIR}/unified-runtime)
206-
else()
207-
# SYCL_UR_USE_FETCH_CONTENT is OFF and SYCL_UR_SOURCE_DIR has not been
208-
# set, check if the fallback local directory exists.
209-
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/unified-runtime)
210-
message(FATAL_ERROR
211-
"SYCL_UR_USE_FETCH_CONTENT is disabled but no alternative Unified \
212-
Runtime source directory has been provided, either:
213-
214-
* Set -DSYCL_UR_SOURCE_DIR=/path/to/unified-runtime
215-
* Clone the UR repo in ${CMAKE_CURRENT_SOURCE_DIR}/unified-runtime")
216-
endif()
217-
# The fallback local directory for the Unified Runtime repository has been
218-
# found, use it.
219-
set(UNIFIED_RUNTIME_SOURCE_DIR
220-
"${CMAKE_CURRENT_SOURCE_DIR}/unified-runtime" CACHE PATH
221-
"Path to Unified Runtime Headers" FORCE)
222-
add_subdirectory(${UNIFIED_RUNTIME_SOURCE_DIR})
72+
set(UR_INTREE_BINARY_DIR ${LLVM_BINARY_DIR}/unified-runtime)
73+
set(UNIFIED_RUNTIME_SOURCE_DIR
74+
"${UR_INTREE_SOURCE_DIR}" CACHE PATH
75+
"Path to Unified Runtime Headers" FORCE)
76+
set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
77+
# Due to the use of dependentloadflag and no installer for UMF and hwloc we need
78+
# to link statically on windows
79+
if(WIN32)
80+
set(UMF_BUILD_SHARED_LIBRARY OFF CACHE INTERNAL "Build UMF shared library")
81+
set(UMF_LINK_HWLOC_STATICALLY ON CACHE INTERNAL "static HWLOC")
22382
endif()
83+
add_subdirectory(${UNIFIED_RUNTIME_SOURCE_DIR} ${UR_INTREE_BINARY_DIR})
22484

22585
# Restore original flags
22686
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BAK}")
22787

228-
message(STATUS
229-
"Using Unified Runtime source directory: ${UNIFIED_RUNTIME_SOURCE_DIR}")
230-
23188
set(UNIFIED_RUNTIME_INCLUDE_DIR "${UNIFIED_RUNTIME_SOURCE_DIR}/include")
23289
set(UNIFIED_RUNTIME_SRC_INCLUDE_DIR "${UNIFIED_RUNTIME_SOURCE_DIR}/source")
23390
set(UNIFIED_RUNTIME_COMMON_INCLUDE_DIR "${UNIFIED_RUNTIME_SOURCE_DIR}/source/common")

sycl/cmake/modules/UnifiedRuntimeTag.cmake

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

sycl/doc/GetStartedGuide.md

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ and a wide range of compute accelerators such as GPU and FPGA.
1414
* [Build DPC++ toolchain with support for HIP NVIDIA](#build-dpc-toolchain-with-support-for-hip-nvidia)
1515
* [Build DPC++ toolchain with support for ARM processors](#build-dpc-toolchain-with-support-for-arm-processors)
1616
* [Build DPC++ toolchain with additional features enabled that require runtime/JIT compilation](#build-dpc-toolchain-with-additional-features-enabled-that-require-runtimejit-compilation)
17-
* [Build DPC++ toolchain with a custom Unified Runtime](#build-dpc-toolchain-with-a-custom-unified-runtime)
1817
* [Build DPC++ toolchain with device image compression support](#build-dpc-toolchain-with-device-image-compression-support)
1918
* [Build Doxygen documentation](#build-doxygen-documentation)
2019
* [Deployment](#deployment)
@@ -369,36 +368,6 @@ After CMake cache is generated, build the documentation with `doxygen-sycl`
369368
target. It will be put to `$DPCPP_HOME/llvm/build/tools/sycl/doc/html`
370369
directory.
371370

372-
### Build DPC++ toolchain with a custom Unified Runtime
373-
374-
DPC++ uses the [Unified Runtime](https://github.com/oneapi-src/unified-runtime)
375-
under the hood to provide implementations of various SYCL backends. By default
376-
the source code for the Unified Runtime will be acquired using CMake's
377-
[FetchCotent](https://cmake.org/cmake/help/latest/module/FetchContent.html). The
378-
specific repository URL and revision tag used can be found in the file
379-
`sycl/cmake/modules/FetchUnifiedRuntime.cmake` searching for the variables
380-
`UNIFIED_RUNTIME_REPO` and `UNIFIED_RUNTIME_TAG`.
381-
382-
In order to enable developers, a number of CMake variables are available to
383-
control which revision of Unified Runtime should be used when building DPC++:
384-
385-
* `SYCL_UR_OVERRIDE_FETCH_CONTENT_REPO` is a variable which can be used to
386-
override the `UNIFIED_RUNTIME_REPO` variable used by `FetchContent` to attain
387-
the Unified Runtime source code.
388-
* `SYCL_UR_OVERRIDE_FETCH_CONTENT_TAG` is a variable which can be used to
389-
override the `UNIFIED_RUNTIME_TAG` variable used by `FetchContent` to attain
390-
the Unified Runtime source code.
391-
* `SYCL_UR_USE_FETCH_CONTENT` is an option to control if CMake should use
392-
`FetchContent` to pull in the Unified Runtime repository, it defaults to `ON`.
393-
When set to `OFF`, `FetchContent` will not be used, instead:
394-
* The path specified by variable `SYCL_UR_SOURCE_DIR` will be used with
395-
`add_directory()`. This can be used to point at an adjacent directory
396-
containing a clone of the Unified Runtime repository.
397-
* The path `sycl/unified-runtime` will be used, if it
398-
exists. This can be used as-if an in-tree build.
399-
* `SYCL_UR_SOURCE_DIR` is a variable used to specify the path to the Unified
400-
Runtime repository when `SYCL_UR_USE_FETCH_CONTENT` is set of `OFF`.
401-
402371
### Build DPC++ libclc with a custom toolchain
403372

404373
libclc is an implementation of the OpenCL required libraries, as described in

sycl/doc/Releases.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,26 @@ ordered from the newest to the oldest.
2727

2828
Release branches are prefixed with `sycl-rel-`
2929

30-
### **[Upcoming]** `6.2.0` release
30+
### _[Upcoming]_ `6.3.0` release
3131

32-
This release will be made from
33-
the [`sycl-rel-6_2`](https://github.com/intel/llvm/tree/sycl-rel-6_2) branch.
32+
This release will be made from the
33+
[`sycl-rel-6_3`](https://github.com/intel/llvm/tree/sycl-rel-6_3) branch.
34+
35+
### **[Latest]** `6.2.0` release
36+
37+
This release was made from
38+
the [`sycl-rel-6_2`](https://github.com/intel/llvm/tree/sycl-rel-6_2) branch and
39+
we have the following tags published:
40+
- **[Latest]** [`v6.2.0`](https://github.com/intel/llvm/releases/tag/v6.2.0)
41+
- [`v6.2.0-rc1`](https://github.com/intel/llvm/releases/tag/v6.2.0-rc1) -
42+
release candidate 1 for 6.2.0 release
3443

3544
### `6.1.0` release
3645

3746
This release was made from
3847
the [`sycl-rel-6_1_0`](https://github.com/intel/llvm/tree/sycl-rel-6_1_0)
3948
branch and we have the following tags published:
40-
- **[Latest]** [`v6.1.0`](https://github.com/intel/llvm/releases/tag/v6.1.0)
49+
- [`v6.1.0`](https://github.com/intel/llvm/releases/tag/v6.1.0)
4150

4251
### `6.0.X` releases
4352

sycl/doc/extensions/template.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ https://github.com/intel/llvm/issues
3737

3838
== Dependencies
3939

40-
This extension is written against the SYCL 2020 revision 9 specification. All
40+
This extension is written against the SYCL 2020 revision 10 specification. All
4141
references below to the "core SYCL specification" or to section numbers in the
4242
SYCL specification refer to that revision.
4343

sycl/source/detail/buffer_impl.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
namespace sycl {
1919
inline namespace _V1 {
2020
namespace detail {
21-
#ifdef XPTI_ENABLE_INSTRUMENTATION
22-
uint8_t GBufferStreamID;
23-
#endif
2421
void *buffer_impl::allocateMem(context_impl *Context, bool InitFromUserData,
2522
void *HostPtr,
2623
ur_event_handle_t &OutEventToWait) {

sycl/source/detail/event_impl.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <chrono>
2020

2121
#ifdef XPTI_ENABLE_INSTRUMENTATION
22-
#include "xpti/xpti_trace_framework.hpp"
2322
#include <atomic>
2423
#include <detail/xpti_registry.hpp>
2524
#include <sstream>
@@ -28,10 +27,6 @@
2827
namespace sycl {
2928
inline namespace _V1 {
3029
namespace detail {
31-
#ifdef XPTI_ENABLE_INSTRUMENTATION
32-
extern xpti::trace_event_data_t *GSYCLGraphEvent;
33-
#endif
34-
3530
// If we do not yet have a context, use the default one.
3631
void event_impl::initContextIfNeeded() {
3732
if (MContext || !MIsDefaultConstructed)
@@ -293,8 +288,7 @@ void event_impl::wait(bool *Success) {
293288
void *TelemetryEvent = nullptr;
294289
uint64_t IId = 0;
295290
std::string Name;
296-
xpti::stream_id_t StreamID = xptiRegisterStream(SYCL_STREAM_NAME);
297-
TelemetryEvent = instrumentationProlog(Name, StreamID, IId);
291+
TelemetryEvent = instrumentationProlog(Name, GSYCLStreamID, IId);
298292
#endif
299293

300294
auto EventHandle = getHandle();
@@ -306,7 +300,7 @@ void event_impl::wait(bool *Success) {
306300
detail::Scheduler::getInstance().waitForEvent(*this, Success);
307301

308302
#ifdef XPTI_ENABLE_INSTRUMENTATION
309-
instrumentationEpilog(TelemetryEvent, Name, StreamID, IId);
303+
instrumentationEpilog(TelemetryEvent, Name, GSYCLStreamID, IId);
310304
#endif
311305
}
312306

0 commit comments

Comments
 (0)