Skip to content

Commit ce3f198

Browse files
committed
Merge remote-tracking branch 'upstream/sycl' into remove_duplicate_libdevice_cflags
2 parents 2de9140 + 0ff1a5c commit ce3f198

File tree

26 files changed

+402
-171
lines changed

26 files changed

+402
-171
lines changed

.github/workflows/sycl-linux-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,13 @@ on:
9393
type: choice
9494
options:
9595
- "[]"
96+
- '[sycl]'
9697
- '[llvm, clang, sycl, llvm_spirv, xptifw, libclc]'
9798
build_image:
9899
type: choice
99100
options:
100101
- 'ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest'
102+
- 'ghcr.io/intel/llvm/ubuntu2204_build:latest'
101103
cc:
102104
type: choice
103105
options:

devops/dependencies-igc-dev.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"linux": {
33
"igc_dev": {
4-
"github_tag": "igc-dev-6d3f69e",
5-
"version": "6d3f69e",
6-
"updated_at": "2025-09-20T11:44:56Z",
7-
"url": "https://api.github.com/repos/intel/intel-graphics-compiler/actions/artifacts/4062749149/zip",
4+
"github_tag": "igc-dev-5572ee3",
5+
"version": "5572ee3",
6+
"updated_at": "2025-09-28T11:41:20Z",
7+
"url": "https://api.github.com/repos/intel/intel-graphics-compiler/actions/artifacts/4125423999/zip",
88
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
99
}
1010
}

devops/scripts/benchmarks/benches/compute.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def git_url(self) -> str:
6060
return "https://github.com/intel/compute-benchmarks.git"
6161

6262
def git_hash(self) -> str:
63-
return "4995560017559849a519e58978a0afdd55903e15"
63+
# Sep 25, 2025
64+
return "7ba2e629404e34c635a46f28550a0952717d120f"
6465

6566
def setup(self) -> None:
6667
if options.sycl is None:

lldb/tools/lldb-dap/package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sycl/include/sycl/exception.hpp

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,14 @@ __SYCL_EXPORT std::error_code make_error_code(sycl::errc E) noexcept;
5151
__SYCL_EXPORT const std::error_category &sycl_category() noexcept;
5252

5353
namespace detail {
54+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
5455
__SYCL_EXPORT const char *stringifyErrorCode(int32_t error);
5556

5657
inline std::string codeToString(int32_t code) {
57-
return std::to_string(code) + " (" + std::string(stringifyErrorCode(code)) + ")";
58+
return std::to_string(code) + " (" + std::string(stringifyErrorCode(code)) +
59+
")";
5860
}
61+
#endif
5962

6063
class __SYCL_EXPORT SYCLCategory : public std::error_category {
6164
public:
@@ -78,17 +81,35 @@ class __SYCL_EXPORT exception : public virtual std::exception {
7881
exception() = default;
7982
virtual ~exception();
8083

81-
exception(std::error_code, const char *Msg);
84+
exception(std::error_code Ec, const char *Msg)
85+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
86+
: exception(Ec, nullptr, Msg) {}
87+
#endif
88+
;
8289

8390
exception(std::error_code Ec, const std::string &Msg)
8491
: exception(Ec, nullptr, Msg.c_str()) {}
8592

86-
// new SYCL 2020 constructors
87-
exception(std::error_code);
93+
exception(std::error_code Ec)
94+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
95+
: exception(Ec, nullptr, "") {}
96+
#endif
97+
;
98+
8899
exception(int EV, const std::error_category &ECat, const std::string &WhatArg)
89-
: exception(EV, ECat, WhatArg.c_str()) {}
90-
exception(int, const std::error_category &, const char *);
91-
exception(int, const std::error_category &);
100+
: exception(std::error_code(EV, ECat), nullptr, WhatArg.c_str()) {}
101+
102+
exception(int EV, const std::error_category &ECat, const char *WhatArg)
103+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
104+
: exception(std::error_code(EV, ECat), nullptr, WhatArg) {}
105+
#endif
106+
;
107+
108+
exception(int EV, const std::error_category &ECat)
109+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
110+
: exception(std::error_code(EV, ECat), nullptr, "") {}
111+
#endif
112+
;
92113

93114
// context.hpp depends on exception.hpp but we can't define these ctors in
94115
// exception.hpp while context is still an incomplete type.
@@ -119,6 +140,7 @@ class __SYCL_EXPORT exception : public virtual std::exception {
119140
std::error_code MErrC = make_error_code(sycl::errc::invalid);
120141

121142
protected:
143+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
122144
// base constructors used by SYCL 1.2.1 exception subclasses
123145
exception(std::error_code Ec, const char *Msg, const int32_t PIErr)
124146
: exception(Ec, std::string(Msg), PIErr) {}
@@ -127,6 +149,7 @@ class __SYCL_EXPORT exception : public virtual std::exception {
127149
: exception(Ec, nullptr, Msg + " " + detail::codeToString(URErr)) {
128150
MErr = URErr;
129151
}
152+
#endif
130153

131154
// base constructor for all SYCL 2020 constructors
132155
// exception(context *, std::error_code, const std::string);

sycl/include/syclcompat/traits.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <sycl/nd_item.hpp>
3333
#include <sycl/nd_range.hpp>
3434
#include <sycl/range.hpp>
35+
#include <tuple>
3536
#include <type_traits>
3637

3738
namespace [[deprecated("syclcompat is deprecated")]] syclcompat {

sycl/source/detail/kernel_bundle_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ class kernel_bundle_impl
580580
"kernel_bundle state does not match the state of the SYCLBIN file.");
581581

582582
std::vector<const detail::RTDeviceBinaryImage *> BestImages =
583-
SYCLBIN->getBestCompatibleImages(Devs);
583+
SYCLBIN->getBestCompatibleImages(Devs, State);
584584
MDeviceImages.reserve(BestImages.size());
585585
for (const detail::RTDeviceBinaryImage *Image : BestImages)
586586
MDeviceImages.emplace_back(device_image_impl::create(

sycl/source/detail/kernel_impl.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <sycl/detail/common.hpp>
1616
#include <sycl/detail/ur.hpp>
1717
#include <sycl/device.hpp>
18+
#include <sycl/exception.hpp>
1819
#include <sycl/ext/oneapi/experimental/root_group.hpp>
1920
#include <sycl/info/info_desc.hpp>
2021
#include <sycl/queue.hpp>

sycl/source/detail/syclbin.cpp

Lines changed: 62 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -272,21 +272,36 @@ SYCLBINBinaries::SYCLBINBinaries(const char *SYCLBINContent, size_t SYCLBINSize)
272272
: SYCLBINContentCopy{ContentCopy(SYCLBINContent, SYCLBINSize)},
273273
SYCLBINContentCopySize{SYCLBINSize},
274274
ParsedSYCLBIN(SYCLBIN{SYCLBINContentCopy.get(), SYCLBINSize}) {
275-
size_t NumJITBinaries = 0, NumNativeBinaries = 0;
276-
for (const SYCLBIN::AbstractModule &AM : ParsedSYCLBIN.AbstractModules) {
277-
NumJITBinaries += AM.IRModules.size();
278-
NumNativeBinaries += AM.NativeDeviceCodeImages.size();
279-
}
280-
DeviceBinaries.reserve(NumJITBinaries + NumNativeBinaries);
281-
JITDeviceBinaryImages.reserve(NumJITBinaries);
282-
NativeDeviceBinaryImages.reserve(NumNativeBinaries);
275+
AbstractModuleDescriptors = std::unique_ptr<AbstractModuleDesc[]>(
276+
new AbstractModuleDesc[ParsedSYCLBIN.AbstractModules.size()]);
277+
278+
size_t NumBinaries = 0;
279+
for (const SYCLBIN::AbstractModule &AM : ParsedSYCLBIN.AbstractModules)
280+
NumBinaries += AM.IRModules.size() + AM.NativeDeviceCodeImages.size();
281+
DeviceBinaries.reserve(NumBinaries);
282+
BinaryImages = std::unique_ptr<RTDeviceBinaryImage[]>(
283+
new RTDeviceBinaryImage[NumBinaries]);
284+
285+
RTDeviceBinaryImage *CurrentBinaryImagesStart = BinaryImages.get();
286+
for (size_t I = 0; I < getNumAbstractModules(); ++I) {
287+
SYCLBIN::AbstractModule &AM = ParsedSYCLBIN.AbstractModules[I];
288+
AbstractModuleDesc &AMDesc = AbstractModuleDescriptors[I];
289+
290+
// Set up the abstract module descriptor.
291+
AMDesc.NumJITBinaries = AM.IRModules.size();
292+
AMDesc.NumNativeBinaries = AM.NativeDeviceCodeImages.size();
293+
AMDesc.JITBinaries = CurrentBinaryImagesStart;
294+
AMDesc.NativeBinaries = CurrentBinaryImagesStart + AMDesc.NumJITBinaries;
295+
CurrentBinaryImagesStart +=
296+
AMDesc.NumJITBinaries + AM.NativeDeviceCodeImages.size();
283297

284-
for (SYCLBIN::AbstractModule &AM : ParsedSYCLBIN.AbstractModules) {
285298
// Construct properties from SYCLBIN metadata.
286299
std::vector<_sycl_device_binary_property_set_struct> &BinPropertySets =
287300
convertAbstractModuleProperties(AM);
288301

289-
for (SYCLBIN::IRModule &IRM : AM.IRModules) {
302+
for (size_t J = 0; J < AM.IRModules.size(); ++J) {
303+
SYCLBIN::IRModule &IRM = AM.IRModules[J];
304+
290305
sycl_device_binary_struct &DeviceBinary = DeviceBinaries.emplace_back();
291306
DeviceBinary.Version = SYCL_DEVICE_BINARY_VERSION;
292307
DeviceBinary.Kind = 4;
@@ -309,11 +324,12 @@ SYCLBINBinaries::SYCLBINBinaries(const char *SYCLBINContent, size_t SYCLBINSize)
309324
DeviceBinary.PropertySetsEnd =
310325
BinPropertySets.data() + BinPropertySets.size();
311326
// Create an image from it.
312-
JITDeviceBinaryImages.emplace_back(&DeviceBinary);
327+
AMDesc.JITBinaries[J] = RTDeviceBinaryImage{&DeviceBinary};
313328
}
314329

315-
for (const SYCLBIN::NativeDeviceCodeImage &NDCI :
316-
AM.NativeDeviceCodeImages) {
330+
for (size_t J = 0; J < AM.NativeDeviceCodeImages.size(); ++J) {
331+
const SYCLBIN::NativeDeviceCodeImage &NDCI = AM.NativeDeviceCodeImages[J];
332+
317333
assert(NDCI.Metadata != nullptr);
318334
PropertySet &NDCIMetadataProps = (*NDCI.Metadata)
319335
[PropertySetRegistry::SYCLBIN_NATIVE_DEVICE_CODE_IMAGE_METADATA];
@@ -346,7 +362,7 @@ SYCLBINBinaries::SYCLBINBinaries(const char *SYCLBINContent, size_t SYCLBINSize)
346362
DeviceBinary.PropertySetsEnd =
347363
BinPropertySets.data() + BinPropertySets.size();
348364
// Create an image from it.
349-
NativeDeviceBinaryImages.emplace_back(&DeviceBinary);
365+
AMDesc.NativeBinaries[J] = RTDeviceBinaryImage{&DeviceBinary};
350366
}
351367
}
352368
}
@@ -394,33 +410,44 @@ SYCLBINBinaries::convertAbstractModuleProperties(SYCLBIN::AbstractModule &AM) {
394410
}
395411

396412
std::vector<const RTDeviceBinaryImage *>
397-
SYCLBINBinaries::getBestCompatibleImages(device_impl &Dev) {
398-
auto SelectCompatibleImages =
399-
[&](const std::vector<RTDeviceBinaryImage> &Imgs) {
400-
std::vector<const RTDeviceBinaryImage *> CompatImgs;
401-
for (const RTDeviceBinaryImage &Img : Imgs)
402-
if (doesDevSupportDeviceRequirements(Dev, Img) &&
403-
doesImageTargetMatchDevice(Img, Dev))
404-
CompatImgs.push_back(&Img);
405-
return CompatImgs;
406-
};
407-
408-
// Try with native images first.
409-
std::vector<const RTDeviceBinaryImage *> NativeImgs =
410-
SelectCompatibleImages(NativeDeviceBinaryImages);
411-
if (!NativeImgs.empty())
412-
return NativeImgs;
413-
414-
// If there were no native images, pick JIT images.
415-
return SelectCompatibleImages(JITDeviceBinaryImages);
413+
SYCLBINBinaries::getBestCompatibleImages(device_impl &Dev, bundle_state State) {
414+
auto GetCompatibleImage = [&](const RTDeviceBinaryImage *Imgs,
415+
size_t NumImgs) {
416+
const RTDeviceBinaryImage *CompatImagePtr =
417+
std::find_if(Imgs, Imgs + NumImgs, [&](const RTDeviceBinaryImage &Img) {
418+
return doesDevSupportDeviceRequirements(Dev, Img) &&
419+
doesImageTargetMatchDevice(Img, Dev);
420+
});
421+
return (CompatImagePtr != Imgs + NumImgs) ? CompatImagePtr : nullptr;
422+
};
423+
424+
std::vector<const RTDeviceBinaryImage *> Images;
425+
for (size_t I = 0; I < getNumAbstractModules(); ++I) {
426+
const AbstractModuleDesc &AMDesc = AbstractModuleDescriptors[I];
427+
// If the target state is executable, try with native images first.
428+
if (State == bundle_state::executable) {
429+
if (const RTDeviceBinaryImage *CompatImagePtr = GetCompatibleImage(
430+
AMDesc.NativeBinaries, AMDesc.NumNativeBinaries)) {
431+
Images.push_back(CompatImagePtr);
432+
continue;
433+
}
434+
}
435+
436+
// Otherwise, select the first compatible JIT binary.
437+
if (const RTDeviceBinaryImage *CompatImagePtr =
438+
GetCompatibleImage(AMDesc.JITBinaries, AMDesc.NumJITBinaries))
439+
Images.push_back(CompatImagePtr);
440+
}
441+
return Images;
416442
}
417443

418444
std::vector<const RTDeviceBinaryImage *>
419-
SYCLBINBinaries::getBestCompatibleImages(devices_range Devs) {
445+
SYCLBINBinaries::getBestCompatibleImages(devices_range Devs,
446+
bundle_state State) {
420447
std::set<const RTDeviceBinaryImage *> Images;
421448
for (device_impl &Dev : Devs) {
422449
std::vector<const RTDeviceBinaryImage *> BestImagesForDev =
423-
getBestCompatibleImages(Dev);
450+
getBestCompatibleImages(Dev, State);
424451
Images.insert(BestImagesForDev.cbegin(), BestImagesForDev.cend());
425452
}
426453
return {Images.cbegin(), Images.cend()};

sycl/source/detail/syclbin.hpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ struct SYCLBINBinaries {
124124
~SYCLBINBinaries() = default;
125125

126126
std::vector<const RTDeviceBinaryImage *>
127-
getBestCompatibleImages(device_impl &Dev);
127+
getBestCompatibleImages(device_impl &Dev, bundle_state State);
128128
std::vector<const RTDeviceBinaryImage *>
129-
getBestCompatibleImages(devices_range Dev);
129+
getBestCompatibleImages(devices_range Dev, bundle_state State);
130130

131131
uint8_t getState() const {
132132
PropertySet &GlobalMetadata =
@@ -143,6 +143,10 @@ struct SYCLBINBinaries {
143143
std::vector<_sycl_device_binary_property_set_struct> &
144144
convertAbstractModuleProperties(SYCLBIN::AbstractModule &AM);
145145

146+
size_t getNumAbstractModules() const {
147+
return ParsedSYCLBIN.AbstractModules.size();
148+
}
149+
146150
std::unique_ptr<char[]> SYCLBINContentCopy = nullptr;
147151
size_t SYCLBINContentCopySize = 0;
148152

@@ -156,8 +160,16 @@ struct SYCLBINBinaries {
156160
BinaryPropertySets;
157161

158162
std::vector<sycl_device_binary_struct> DeviceBinaries;
159-
std::vector<RTDeviceBinaryImage> JITDeviceBinaryImages;
160-
std::vector<RTDeviceBinaryImage> NativeDeviceBinaryImages;
163+
164+
struct AbstractModuleDesc {
165+
size_t NumJITBinaries;
166+
size_t NumNativeBinaries;
167+
RTDeviceBinaryImage *JITBinaries;
168+
RTDeviceBinaryImage *NativeBinaries;
169+
};
170+
171+
std::unique_ptr<AbstractModuleDesc[]> AbstractModuleDescriptors;
172+
std::unique_ptr<RTDeviceBinaryImage[]> BinaryImages;
161173
};
162174

163175
} // namespace detail

0 commit comments

Comments
 (0)