Skip to content

Commit 876f979

Browse files
committed
Merge remote-tracking branch 'upstream/sycl' into sycl-fix-group-algorithm
2 parents cad3fa2 + 7cac7a1 commit 876f979

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+530
-669
lines changed

llvm/lib/SYCLNativeCPUUtils/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ endif()
3434
if(NATIVECPU_USE_OCK)
3535
if(NATIVECPU_OCK_USE_FETCHCONTENT)
3636
set(OCK_GIT_INTERNAL_REPO "https://github.com/uxlfoundation/oneapi-construction-kit.git")
37-
# commit ffef31717750d3f15bfd2f18d9cd7f4677fe9d3e
38-
# Merge: 574307afde 0b00238554
37+
# commit 03e6497dfcc06b0ef6bdeeb8fefd7fdc24de4287
38+
# Merge: df8de76a56 413b59ebe2
3939
# Author: Harald van Dijk <[email protected]>
40-
# Date: Fri Apr 4 16:26:38 2025 +0100
40+
# Date: Sat May 17 20:52:27 2025 +0100
4141
#
42-
# Merge pull request #751 from hvdijk/llvm21-address-space
42+
# Merge pull request #822 from coldav/colin/remove_ca_enable_api
4343
#
44-
# [LLVM 21] Take address space into account for legality.
45-
set(OCK_GIT_INTERNAL_TAG ffef31717750d3f15bfd2f18d9cd7f4677fe9d3e)
44+
# Remove CA_ENABLE_API as a CMake option
45+
set(OCK_GIT_INTERNAL_TAG 03e6497dfcc06b0ef6bdeeb8fefd7fdc24de4287)
4646

4747
# Overwrite OCK_GIT_INTERNAL_REPO/OCK_GIT_INTERNAL_TAG if the corresponding options are set
4848
if(OCK_GIT_REPO)

sycl/doc/extensions/experimental/sycl_ext_oneapi_bindless_images.asciidoc

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ change incompatibly in future versions of {dpcpp} without prior notice.
4343
*Shipping software products should not rely on APIs defined in this
4444
specification.*
4545

46-
4746
== Backend support status
4847

49-
This extension is currently implemented in {dpcpp} only for GPU devices and
50-
only when using the CUDA backend. Attempting to use this extension in
51-
kernels that run on other devices or backends will not work.
52-
Be aware that the compiler may not be able to issue a diagnostic to
53-
warn you if this happens.
48+
This extension is currently implemented in {dpcpp} only for GPU devices. CUDA,
49+
HIP, and LevelZero backends are supported. Not all image and interoperability
50+
features may be supported on all backends. We provide device aspects which users
51+
can query to check support for specific features.
5452

5553
== Overview
5654

@@ -2481,13 +2479,6 @@ include::../../../test-e2e/bindless_images/examples/example_5_sample_cubemap.cpp
24812479
include::../../../test-e2e/bindless_images/examples/example_6_import_memory_and_semaphores.cpp[lines=14..-1]
24822480
```
24832481
2484-
== Implementation notes
2485-
2486-
The current DPC++ prototype only implements the proposal for the CUDA backend,
2487-
however we are actively exploring Level Zero with SPIR-V.
2488-
We are looking at other backend as well in order to ensure the extension can
2489-
work across different backends.
2490-
24912482
== Issues
24922483
24932484
=== No dependency tracking
@@ -2515,12 +2506,6 @@ The ability to create an image with 3 channels depends on the backend.
25152506
There is currently no way to query a backend whether it supports this feature.
25162507
This query should be added in a later revision of the proposal.
25172508
2518-
=== Not supported yet
2519-
2520-
These features still need to be handled:
2521-
2522-
* Level Zero and SPIR-V support
2523-
25242509
== Revision History
25252510
25262511
[frame="none",options="header"]
@@ -2740,3 +2725,6 @@ These features still need to be handled:
27402725
|6.8|2025-03-13| - Add support for importing timeline semaphores.
27412726
|6.9|2025-03-18| - Add new `gather` image type and the accompanying
27422727
`gather_image` function.
2728+
|6.10|2025-05-09| - Add `unmap_external_image_memory` and
2729+
`unmap_external_linear_memory` APIs.
2730+
- Clarify how and when external memory should be unmapped.

sycl/include/sycl/sycl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
#include <sycl/ext/intel/experimental/task_sequence_properties.hpp>
7575
#include <sycl/ext/intel/experimental/usm_properties.hpp>
7676
#include <sycl/ext/intel/usm_pointers.hpp>
77-
#include <sycl/ext/khr/free_function_commands.hpp>
7877
#include <sycl/ext/oneapi/bfloat16.hpp>
7978
#include <sycl/ext/oneapi/bindless_images.hpp>
8079
#include <sycl/ext/oneapi/device_global/device_global.hpp>
@@ -123,4 +122,5 @@
123122
#include <sycl/ext/oneapi/virtual_mem/physical_mem.hpp>
124123
#include <sycl/ext/oneapi/virtual_mem/virtual_mem.hpp>
125124
#include <sycl/ext/oneapi/weak_object.hpp>
125+
#include <sycl/khr/free_function_commands.hpp>
126126
#include <sycl/khr/group_interface.hpp>

sycl/source/CMakeLists.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,15 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
9191

9292
# Feature-specific compilation and link step setup
9393

94+
# Unlike for sycl library, for LLVMSupport we have only one version for a given build,
95+
# so, we link LLVMSupport lib to matching sycl version only.
9496
if (SYCL_ENABLE_STACK_PRINTING)
95-
target_compile_definitions(${LIB_OBJ_NAME} PUBLIC ENABLE_STACK_TRACE)
97+
if(NOT MSVC OR (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ARG_COMPILE_OPTIONS MATCHES ".*MDd.*") OR
98+
(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT ARG_COMPILE_OPTIONS MATCHES ".*MDd.*"))
99+
add_dependencies(${LIB_NAME} LLVMSupport)
100+
target_compile_definitions(${LIB_OBJ_NAME} PUBLIC ENABLE_STACK_TRACE)
101+
target_link_libraries(${LIB_NAME} PRIVATE LLVMSupport)
102+
endif()
96103
endif()
97104

98105
# TODO: Enabled for MSVC
@@ -186,11 +193,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
186193
endif()
187194
endif()
188195

189-
# Link with LLVMSupport for shared utilities.
190-
add_dependencies(${LIB_NAME} LLVMSupport)
191-
target_link_libraries(${LIB_NAME} PRIVATE LLVMSupport)
192-
target_include_directories(${LIB_OBJ_NAME} SYSTEM PRIVATE ${LLVM_MAIN_INCLUDE_DIR})
193-
194196
check_linker_flag(CXX "-Wl,--gc-sections" LINKER_SUPPORTS_WL_GC_SECTIONS)
195197
if(LINKER_SUPPORTS_WL_GC_SECTIONS)
196198
# Reduces the size of the resulting library by having the linker perform

sycl/source/detail/compiler.hpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,45 @@
3535
#define __SYCL_DEVICE_BINARY_TARGET_LLVM_NVPTX64 "llvm_nvptx64"
3636
#define __SYCL_DEVICE_BINARY_TARGET_LLVM_AMDGCN "llvm_amdgcn"
3737

38+
/// Device binary image property set names recognized by the SYCL runtime.
39+
/// Name must be consistent with
40+
/// PropertySetRegistry::SYCL_SPECIALIZATION_CONSTANTS defined in
41+
/// PropertySetIO.h
42+
#define __SYCL_PROPERTY_SET_SPEC_CONST_MAP "SYCL/specialization constants"
43+
/// PropertySetRegistry::SYCL_SPEC_CONSTANTS_DEFAULT_VALUES defined in
44+
/// PropertySetIO.h
45+
#define __SYCL_PROPERTY_SET_SPEC_CONST_DEFAULT_VALUES_MAP \
46+
"SYCL/specialization constants default values"
47+
/// TODO: remove req mask when sycl devicelib online linking path is removed.
48+
/// PropertySetRegistry::SYCL_DEVICELIB_REQ_MASK defined in PropertySetIO.h
49+
#define __SYCL_PROPERTY_SET_DEVICELIB_REQ_MASK "SYCL/devicelib req mask"
50+
/// PropertySetRegistry::SYCL_DEVICELIB_METADATA defined in PropertySetIO.h
51+
#define __SYCL_PROPERTY_SET_DEVICELIB_METADATA "SYCL/devicelib metadata"
52+
/// PropertySetRegistry::SYCL_KERNEL_PARAM_OPT_INFO defined in PropertySetIO.h
53+
#define __SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO "SYCL/kernel param opt"
54+
/// PropertySetRegistry::SYCL_KERNEL_PROGRAM_METADATA defined in PropertySetIO.h
55+
#define __SYCL_PROPERTY_SET_PROGRAM_METADATA "SYCL/program metadata"
56+
/// PropertySetRegistry::SYCL_MISC_PROP defined in PropertySetIO.h
57+
#define __SYCL_PROPERTY_SET_SYCL_MISC_PROP "SYCL/misc properties"
58+
/// PropertySetRegistry::SYCL_ASSERT_USED defined in PropertySetIO.h
59+
#define __SYCL_PROPERTY_SET_SYCL_ASSERT_USED "SYCL/assert used"
60+
/// PropertySetRegistry::SYCL_EXPORTED_SYMBOLS defined in PropertySetIO.h
61+
#define __SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS "SYCL/exported symbols"
62+
/// PropertySetRegistry::SYCL_IMPORTED_SYMBOLS defined in PropertySetIO.h
63+
#define __SYCL_PROPERTY_SET_SYCL_IMPORTED_SYMBOLS "SYCL/imported symbols"
64+
/// PropertySetRegistry::SYCL_DEVICE_GLOBALS defined in PropertySetIO.h
65+
#define __SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS "SYCL/device globals"
66+
/// PropertySetRegistry::SYCL_DEVICE_REQUIREMENTS defined in PropertySetIO.h
67+
#define __SYCL_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS "SYCL/device requirements"
68+
/// PropertySetRegistry::SYCL_HOST_PIPES defined in PropertySetIO.h
69+
#define __SYCL_PROPERTY_SET_SYCL_HOST_PIPES "SYCL/host pipes"
70+
/// PropertySetRegistry::SYCL_VIRTUAL_FUNCTIONS defined in PropertySetIO.h
71+
#define __SYCL_PROPERTY_SET_SYCL_VIRTUAL_FUNCTIONS "SYCL/virtual functions"
72+
/// PropertySetRegistry::SYCL_IMPLICIT_LOCAL_ARG defined in PropertySetIO.h
73+
#define __SYCL_PROPERTY_SET_SYCL_IMPLICIT_LOCAL_ARG "SYCL/implicit local arg"
74+
/// PropertySetRegistry::SYCL_REGISTERED_KERNELS defined in PropertySetIO.h
75+
#define __SYCL_PROPERTY_SET_SYCL_REGISTERED_KERNELS "SYCL/registered kernels"
76+
3877
/// Program metadata tags recognized by the PI backends. For kernels the tag
3978
/// must appear after the kernel name.
4079
#define __SYCL_PROGRAM_METADATA_TAG_REQD_WORK_GROUP_SIZE "@reqd_work_group_size"

sycl/source/detail/device_binary_image.cpp

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// For device image compression.
1313
#include <detail/compression.hpp>
1414

15-
#include <llvm/Support/PropertySetIO.h>
16-
1715
#include <algorithm>
1816
#include <cstdlib>
1917
#include <cstring>
@@ -187,39 +185,28 @@ void RTDeviceBinaryImage::init(sycl_device_binary Bin) {
187185
// try to determine the format; may remain "NONE"
188186
Format = ur::getBinaryImageFormat(Bin->BinaryStart, getSize());
189187

190-
SpecConstIDMap.init(
191-
Bin, llvm::util::PropertySetRegistry::SYCL_SPECIALIZATION_CONSTANTS);
188+
SpecConstIDMap.init(Bin, __SYCL_PROPERTY_SET_SPEC_CONST_MAP);
192189
SpecConstDefaultValuesMap.init(
193-
Bin, llvm::util::PropertySetRegistry::SYCL_SPEC_CONSTANTS_DEFAULT_VALUES);
194-
DeviceLibReqMask.init(
195-
Bin, llvm::util::PropertySetRegistry::SYCL_DEVICELIB_REQ_MASK);
196-
DeviceLibMetadata.init(
197-
Bin, llvm::util::PropertySetRegistry::SYCL_DEVICELIB_METADATA);
198-
KernelParamOptInfo.init(
199-
Bin, llvm::util::PropertySetRegistry::SYCL_KERNEL_PARAM_OPT_INFO);
200-
AssertUsed.init(Bin, llvm::util::PropertySetRegistry::SYCL_ASSERT_USED);
201-
ImplicitLocalArg.init(
202-
Bin, llvm::util::PropertySetRegistry::SYCL_IMPLICIT_LOCAL_ARG);
203-
ProgramMetadata.init(Bin,
204-
llvm::util::PropertySetRegistry::SYCL_PROGRAM_METADATA);
190+
Bin, __SYCL_PROPERTY_SET_SPEC_CONST_DEFAULT_VALUES_MAP);
191+
DeviceLibReqMask.init(Bin, __SYCL_PROPERTY_SET_DEVICELIB_REQ_MASK);
192+
DeviceLibMetadata.init(Bin, __SYCL_PROPERTY_SET_DEVICELIB_METADATA);
193+
KernelParamOptInfo.init(Bin, __SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO);
194+
AssertUsed.init(Bin, __SYCL_PROPERTY_SET_SYCL_ASSERT_USED);
195+
ImplicitLocalArg.init(Bin, __SYCL_PROPERTY_SET_SYCL_IMPLICIT_LOCAL_ARG);
196+
ProgramMetadata.init(Bin, __SYCL_PROPERTY_SET_PROGRAM_METADATA);
205197
// Convert ProgramMetadata into the UR format
206198
for (const auto &Prop : ProgramMetadata) {
207199
ProgramMetadataUR.push_back(
208200
ur::mapDeviceBinaryPropertyToProgramMetadata(Prop));
209201
}
210-
ExportedSymbols.init(Bin,
211-
llvm::util::PropertySetRegistry::SYCL_EXPORTED_SYMBOLS);
212-
ImportedSymbols.init(Bin,
213-
llvm::util::PropertySetRegistry::SYCL_IMPORTED_SYMBOLS);
214-
DeviceGlobals.init(Bin, llvm::util::PropertySetRegistry::SYCL_DEVICE_GLOBALS);
215-
DeviceRequirements.init(
216-
Bin, llvm::util::PropertySetRegistry::SYCL_DEVICE_REQUIREMENTS);
217-
HostPipes.init(Bin, llvm::util::PropertySetRegistry::SYCL_HOST_PIPES);
218-
VirtualFunctions.init(
219-
Bin, llvm::util::PropertySetRegistry::SYCL_VIRTUAL_FUNCTIONS);
220-
RegisteredKernels.init(
221-
Bin, llvm::util::PropertySetRegistry::SYCL_REGISTERED_KERNELS);
222-
Misc.init(Bin, llvm::util::PropertySetRegistry::SYCL_MISC_PROP);
202+
ExportedSymbols.init(Bin, __SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS);
203+
ImportedSymbols.init(Bin, __SYCL_PROPERTY_SET_SYCL_IMPORTED_SYMBOLS);
204+
DeviceGlobals.init(Bin, __SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS);
205+
DeviceRequirements.init(Bin, __SYCL_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS);
206+
HostPipes.init(Bin, __SYCL_PROPERTY_SET_SYCL_HOST_PIPES);
207+
VirtualFunctions.init(Bin, __SYCL_PROPERTY_SET_SYCL_VIRTUAL_FUNCTIONS);
208+
RegisteredKernels.init(Bin, __SYCL_PROPERTY_SET_SYCL_REGISTERED_KERNELS);
209+
Misc.init(Bin, __SYCL_PROPERTY_SET_SYCL_MISC_PROP);
223210
}
224211

225212
std::atomic<uintptr_t> RTDeviceBinaryImage::ImageCounter = 1;

sycl/source/detail/jit_compiler.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#include <sycl/detail/os_util.hpp>
1313
#include <sycl/detail/ur.hpp>
1414

15-
#include <llvm/Support/PropertySetIO.h>
16-
1715
namespace sycl {
1816
inline namespace _V1 {
1917
namespace detail {
@@ -267,7 +265,7 @@ sycl_device_binaries jit_compiler::createDeviceBinaries(
267265

268266
for (const auto &FPS : DevImgInfo.Properties) {
269267
bool IsDeviceGlobalsPropSet =
270-
FPS.Name == llvm::util::PropertySetRegistry::SYCL_DEVICE_GLOBALS;
268+
FPS.Name == __SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS;
271269
PropertySetContainer PropSet{FPS.Name.c_str()};
272270
for (const auto &FPV : FPS.Values) {
273271
if (FPV.IsUIntValue) {

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434

3535
#include <sycl/ext/oneapi/matrix/query-types.hpp>
3636

37-
#include <llvm/Support/PropertySetIO.h>
38-
3937
#include <algorithm>
4038
#include <cassert>
4139
#include <cstdint>
@@ -1865,8 +1863,7 @@ static bool isBfloat16DeviceLibImage(sycl_device_binary RawImg,
18651863
for (ImgPS = RawImg->PropertySetsBegin; ImgPS != RawImg->PropertySetsEnd;
18661864
++ImgPS) {
18671865
if (ImgPS->Name &&
1868-
!strcmp(llvm::util::PropertySetRegistry::SYCL_DEVICELIB_METADATA,
1869-
ImgPS->Name)) {
1866+
!strcmp(__SYCL_PROPERTY_SET_DEVICELIB_METADATA, ImgPS->Name)) {
18701867
if (!LibVersion)
18711868
return true;
18721869

@@ -1894,8 +1891,7 @@ getExportedSymbolPS(sycl_device_binary RawImg) {
18941891
for (ImgPS = RawImg->PropertySetsBegin; ImgPS != RawImg->PropertySetsEnd;
18951892
++ImgPS) {
18961893
if (ImgPS->Name &&
1897-
!strcmp(llvm::util::PropertySetRegistry::SYCL_EXPORTED_SYMBOLS,
1898-
ImgPS->Name))
1894+
!strcmp(__SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS, ImgPS->Name))
18991895
return ImgPS;
19001896
}
19011897

0 commit comments

Comments
 (0)