Skip to content

Commit 8e944f5

Browse files
committed
Small update
1 parent b5eb9b4 commit 8e944f5

File tree

4 files changed

+5
-42
lines changed

4 files changed

+5
-42
lines changed

sycl/source/detail/device_image_impl.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,6 @@ class device_image_impl {
161161

162162
const context &get_context() const noexcept { return MContext; }
163163

164-
void set_kernel_ids(std::vector<kernel_id> KernelIDs) noexcept {
165-
MKernelIDs = std::move(KernelIDs);
166-
}
167-
168164
std::vector<kernel_id> &get_kernel_ids_ref() noexcept { return MKernelIDs; }
169165

170166
std::vector<unsigned char> &get_spec_const_blob_ref() noexcept {

sycl/source/detail/kernel_bundle_impl.hpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -281,42 +281,6 @@ class kernel_bundle_impl {
281281
kernel
282282
get_kernel(const kernel_id &KernelID,
283283
const std::shared_ptr<detail::kernel_bundle_impl> &Self) const {
284-
// TODO: remove this workaround after AOT binaries contain kernel IDs by
285-
// default
286-
bool HasKernelIdProp = std::any_of(
287-
MDeviceImages.begin(), MDeviceImages.end(),
288-
[](const auto &DeviceImage) {
289-
return !getSyclObjImpl(DeviceImage)->get_kernel_ids().empty();
290-
});
291-
if (!HasKernelIdProp) {
292-
for (const auto &DeviceImage : MDeviceImages) {
293-
size_t Size;
294-
const detail::plugin &Plugin = getSyclObjImpl(MContext)->getPlugin();
295-
if (nullptr == getSyclObjImpl(DeviceImage)->get_program_ref()) {
296-
continue;
297-
}
298-
Plugin.call<PiApiKind::piProgramGetInfo>(
299-
getSyclObjImpl(DeviceImage)->get_program_ref(),
300-
PI_PROGRAM_INFO_KERNEL_NAMES, 0, nullptr, &Size);
301-
std::string RawResult(Size, ' ');
302-
Plugin.call<PiApiKind::piProgramGetInfo>(
303-
getSyclObjImpl(DeviceImage)->get_program_ref(),
304-
PI_PROGRAM_INFO_KERNEL_NAMES, RawResult.size(), &RawResult[0],
305-
nullptr);
306-
// Get rid of the null terminator
307-
RawResult.pop_back();
308-
std::vector<std::string> KernelNames(split_string(RawResult, ';'));
309-
std::vector<kernel_id> KernelIDs;
310-
for (const auto &KernelName : KernelNames) {
311-
KernelIDs.push_back(detail::createSyclObjFromImpl<kernel_id>(
312-
std::make_shared<detail::kernel_id_impl>(KernelName)));
313-
}
314-
315-
std::sort(KernelIDs.begin(), KernelIDs.end(), detail::LessByNameComp{});
316-
317-
getSyclObjImpl(DeviceImage)->set_kernel_ids(KernelIDs);
318-
}
319-
}
320284

321285
auto It = std::find_if(MDeviceImages.begin(), MDeviceImages.end(),
322286
[&KernelID](const device_image_plain &DeviceImage) {

sycl/test/on-device/basic_tests/specialization_constants/non_native/Inputs/common.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int main() {
2727
Q.submit([&](sycl::handler &CGH) {
2828
CGH.set_specialization_constant<SpecConst2>(1);
2929
auto Acc = Buf.get_access<sycl::access::mode::read_write>(CGH);
30-
CGH.single_task<class Kernel3Name>([=](sycl::kernel_handler KH) {
30+
CGH.single_task<class Kernel1Name>([=](sycl::kernel_handler KH) {
3131
Acc[0] = KH.get_specialization_constant<SpecConst2>();
3232
});
3333
});
@@ -42,7 +42,7 @@ int main() {
4242
CGH.set_specialization_constant<SpecConst3>(TestStruct{1, 2});
4343
const auto SC = CGH.get_specialization_constant<SpecConst4>();
4444
assert(SC == 42);
45-
CGH.single_task<class Kernel4Name>([=](sycl::kernel_handler KH) {
45+
CGH.single_task<class Kernel2Name>([=](sycl::kernel_handler KH) {
4646
Acc[0] = KH.get_specialization_constant<SpecConst3>();
4747
});
4848
});

sycl/test/on-device/basic_tests/specialization_constants/non_native/cuda.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
// RUN: %clangxx -fsycl -fsycl-targets=nvptx64-unknown-unknown-sycldevice %S/Inputs/common.cpp -o %t.out
44
// RUN: env SYCL_DEVICE_FILTER=cuda %t.out
55

6+
// TODO: enable this test then compile-time error in sycl-post-link is fixed
7+
// UNSUPPORTED: cuda
8+
69
// This test checks correctness of SYCL2020 non-native specialization constants
710
// on CUDA device

0 commit comments

Comments
 (0)