Skip to content

[SYCL] Runtime property lists on kernel invocation functions #3416

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ include(AddSYCLExecutable)
set(SYCL_MAJOR_VERSION 5)
set(SYCL_MINOR_VERSION 1)
set(SYCL_PATCH_VERSION 0)
set(SYCL_DEV_ABI_VERSION 0)
set(SYCL_DEV_ABI_VERSION 1)
if (SYCL_ADD_DEV_VERSION_POSTFIX)
set(SYCL_VERSION_POSTFIX "-${SYCL_DEV_ABI_VERSION}")
endif()
Expand Down
23 changes: 23 additions & 0 deletions sycl/include/CL/sycl/ONEAPI/reduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,29 @@ template <typename T> struct AreAllButLastReductions<T> {
static constexpr bool value = !std::is_base_of<reduction_impl_base, T>::value;
};

/// Predicate returning true if all template type parameters except the last two
/// are reductions.
template <typename FirstT, typename... RestT>
struct AreAllButLastTwoReductions {
static constexpr bool value =
std::is_base_of<reduction_impl_base, FirstT>::value &&
AreAllButLastTwoReductions<RestT...>::value;
};

/// Helper specialization of AreAllButLastTwoReductions for two elements.
/// Returns true if the template parameters are not a reduction.
template <typename T1, typename T2> struct AreAllButLastTwoReductions<T1, T2> {
static constexpr bool value =
!std::is_base_of<reduction_impl_base, T1>::value &&
!std::is_base_of<reduction_impl_base, T2>::value;
};

/// Helper specialization of AreAllButLastTwoReductions for one element only.
/// Returns true if the template parameter is not a reduction.
template <typename T> struct AreAllButLastTwoReductions<T> {
static constexpr bool value = !std::is_base_of<reduction_impl_base, T>::value;
};

/// This class encapsulates the reduction variable/accessor,
/// the reduction operator and an optional operator identity.
template <typename T, class BinaryOperation, int Dims, bool IsUSM,
Expand Down
12 changes: 7 additions & 5 deletions sycl/include/CL/sycl/detail/cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,16 @@ class CGExecKernel : public CG {
public:
/// Stores ND-range description.
NDRDescT MNDRDesc;
property_list MPropList;
unique_ptr_class<HostKernelBase> MHostKernel;
shared_ptr_class<detail::kernel_impl> MSyclKernel;
vector_class<ArgDesc> MArgs;
string_class MKernelName;
detail::OSModuleHandle MOSModuleHandle;
vector_class<shared_ptr_class<detail::stream_impl>> MStreams;

CGExecKernel(NDRDescT NDRDesc, unique_ptr_class<HostKernelBase> HKernel,
CGExecKernel(NDRDescT NDRDesc, const property_list &PropList,
unique_ptr_class<HostKernelBase> HKernel,
shared_ptr_class<detail::kernel_impl> SyclKernel,
vector_class<vector_class<char>> ArgsStorage,
vector_class<detail::AccessorImplPtr> AccStorage,
Expand All @@ -142,10 +144,10 @@ class CGExecKernel : public CG {
: CG(Type, std::move(ArgsStorage), std::move(AccStorage),
std::move(SharedPtrStorage), std::move(Requirements),
std::move(Events), std::move(loc)),
MNDRDesc(std::move(NDRDesc)), MHostKernel(std::move(HKernel)),
MSyclKernel(std::move(SyclKernel)), MArgs(std::move(Args)),
MKernelName(std::move(KernelName)), MOSModuleHandle(OSModuleHandle),
MStreams(std::move(Streams)) {
MNDRDesc(std::move(NDRDesc)), MPropList(PropList),
MHostKernel(std::move(HKernel)), MSyclKernel(std::move(SyclKernel)),
MArgs(std::move(Args)), MKernelName(std::move(KernelName)),
MOSModuleHandle(OSModuleHandle), MStreams(std::move(Streams)) {
assert((getType() == RUN_ON_HOST_INTEL || getType() == KERNEL) &&
"Wrong type of exec kernel CG.");
}
Expand Down
Loading