Skip to content

[SYCL] RoundedRangeKernel should inherit properties from the original #18900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions sycl/include/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,16 @@ class RoundedRangeKernel {
KernelFunc(item);
}
}

// Copy the properties_tag getter from the original kernel to propagate
// property(s)
template <
typename T = KernelType,
typename = std::enable_if_t<ext::oneapi::experimental::detail::
HasKernelPropertiesGetMethod<T>::value>>
auto get(ext::oneapi::experimental::properties_tag) const {
return KernelFunc.get(ext::oneapi::experimental::properties_tag{});
}
};

template <typename TransformedArgType, int Dims, typename KernelType>
Expand All @@ -363,6 +373,16 @@ class RoundedRangeKernelWithKH {
KernelFunc(item, KH);
}
}

// Copy the properties_tag getter from the original kernel to propagate
// property(s)
template <
typename T = KernelType,
typename = std::enable_if_t<ext::oneapi::experimental::detail::
HasKernelPropertiesGetMethod<T>::value>>
auto get(ext::oneapi::experimental::properties_tag) const {
return KernelFunc.get(ext::oneapi::experimental::properties_tag{});
}
};

using std::enable_if_t;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
// kernels when different work-items perform calls to different virtual
// functions using the same object.
//
// TODO: Currently using the -Wno-deprecated-declarations flag due to issue
// https://github.com/intel/llvm/issues/16839. Remove the flag as well as the
// variable 'props' once the issue is resolved.
// RUN: %{build} -o %t.out -Wno-deprecated-declarations %helper-includes
// RUN: %{build} -o %t.out %helper-includes
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down Expand Up @@ -76,7 +73,6 @@ int main() try {
auto *DeviceStorage = sycl::malloc_shared<storage_t>(1, q);
sycl::range R{1024};

constexpr oneapi::properties props{oneapi::assume_indirect_calls};
for (size_t TestCase = 0; TestCase < 2; ++TestCase) {
std::vector<int> HostData(R.size());
std::iota(HostData.begin(), HostData.end(), 0);
Expand All @@ -91,7 +87,7 @@ int main() try {

q.submit([&](sycl::handler &CGH) {
sycl::accessor DataAcc(DataStorage, CGH, sycl::read_write);
CGH.parallel_for(R, props, KernelFunctor(DeviceStorage, DataAcc));
CGH.parallel_for(R, KernelFunctor(DeviceStorage, DataAcc));
});

BaseOp *Ptr = HostStorage.construct</* ret type = */ BaseOp>(TestCase);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
// kernels when different work-items perform a virtual function calls using
// different objects.
//
// TODO: Currently using the -Wno-deprecated-declarations flag due to issue
// https://github.com/intel/llvm/issues/16839. Remove the flag as well as the
// variable 'props' once the issue is resolved.
// RUN: %{build} -o %t.out -Wno-deprecated-declarations %helper-includes
// RUN: %{build} -o %t.out %helper-includes
// RUN: %{run} %t.out

#include <sycl/builtins.hpp>
Expand Down Expand Up @@ -71,7 +68,6 @@ int main() try {
auto *DeviceStorage = sycl::malloc_shared<storage_t>(3, q);
sycl::range R{1024};

constexpr oneapi::properties props{oneapi::assume_indirect_calls};
{
std::vector<float> HostData(R.size());
for (size_t I = 1; I < HostData.size(); ++I)
Expand All @@ -89,7 +85,7 @@ int main() try {

q.submit([&](sycl::handler &CGH) {
sycl::accessor DataAcc(DataStorage, CGH, sycl::read_write);
CGH.parallel_for(R, props, KernelFunctor(DeviceStorage, DataAcc));
CGH.parallel_for(R, KernelFunctor(DeviceStorage, DataAcc));
});

BaseOp *Ptr[] = {HostStorage[0].construct</* ret type = */ BaseOp>(0),
Expand Down
8 changes: 2 additions & 6 deletions sycl/test-e2e/VirtualFunctions/misc/range-uniform-vf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
// kernels when every work-item calls the same virtual function on the same
// object.
//
// TODO: Currently using the -Wno-deprecated-declarations flag due to issue
// https://github.com/intel/llvm/issues/16839. Remove the flag as well as the
// variable 'props' once the issue is resolved.
// RUN: %{build} -o %t.out -Wno-deprecated-declarations %helper-includes
// RUN: %{build} -o %t.out %helper-includes
// RUN: %{run} %t.out

#include <sycl/builtins.hpp>
Expand Down Expand Up @@ -69,7 +66,6 @@ int main() try {
auto *DeviceStorage = sycl::malloc_shared<storage_t>(1, q);
sycl::range R{1024};

constexpr oneapi::properties props{oneapi::assume_indirect_calls};
for (unsigned TestCase = 0; TestCase < 3; ++TestCase) {
std::vector<float> HostData(R.size());
for (size_t I = 1; I < HostData.size(); ++I)
Expand All @@ -85,7 +81,7 @@ int main() try {

q.submit([&](sycl::handler &CGH) {
sycl::accessor DataAcc(DataStorage, CGH, sycl::read_write);
CGH.parallel_for(R, props, KernelFunctor(DeviceStorage, DataAcc));
CGH.parallel_for(R, KernelFunctor(DeviceStorage, DataAcc));
});

auto *Ptr = HostStorage.construct</* ret type = */ BaseOp>(TestCase);
Expand Down