-
Notifications
You must be signed in to change notification settings - Fork 805
Handler-less kernel submit API #19294
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
base: sycl
Are you sure you want to change the base?
Changes from all commits
3223842
fde19ca
13424de
fbc789d
591b3ec
d235b7c
6641601
0f41d5a
a6e711e
9c8040e
31cbdb9
c5cd091
998d592
4000c07
f8e9cd6
01af8bb
4469e59
ac1a5cf
5865f3a
072803c
27b3110
9041e94
ac2c5bb
8e155fb
502f637
d708c93
e9f6e4e
057a7a5
77d92ca
85aaa5c
a54422a
967d35e
ec1ef89
1f95b9b
12ef6da
2980531
01e0f9f
63d1345
4001fea
6c9525b
f871b10
18df56b
3375e77
72dc199
9715916
177277b
eb9a5d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,26 @@ event submit_with_event_impl(const queue &Q, PropertiesT Props, | |
const sycl::detail::code_location &CodeLoc) { | ||
return Q.submit_with_event(Props, detail::type_erased_cgfo_ty{CGF}, CodeLoc); | ||
} | ||
|
||
template <typename KernelName, typename PropertiesT, typename KernelType, | ||
int Dims> | ||
void submit_kernel_direct_impl(const queue &Q, PropertiesT Props, | ||
nd_range<Dims> Range, | ||
const KernelType &KernelFunc, | ||
const sycl::detail::code_location &CodeLoc) { | ||
Q.submit_kernel_direct_without_event<KernelName, PropertiesT, KernelType, | ||
Dims>(Props, Range, KernelFunc, CodeLoc); | ||
} | ||
|
||
template <typename KernelName, typename PropertiesT, typename KernelType, | ||
int Dims> | ||
event submit_kernel_direct_with_event_impl( | ||
const queue &Q, PropertiesT Props, nd_range<Dims> Range, | ||
const KernelType &KernelFunc, const sycl::detail::code_location &CodeLoc) { | ||
return Q.submit_kernel_direct_with_event<KernelName, PropertiesT, KernelType, | ||
Dims>(Props, Range, KernelFunc, | ||
CodeLoc); | ||
} | ||
} // namespace detail | ||
|
||
template <typename CommandGroupFunc, typename PropertiesT> | ||
|
@@ -126,6 +146,17 @@ void submit(const queue &Q, CommandGroupFunc &&CGF, | |
submit(Q, empty_properties_t{}, std::forward<CommandGroupFunc>(CGF), CodeLoc); | ||
} | ||
|
||
template <typename KernelName = sycl::detail::auto_name, typename PropertiesT, | ||
typename KernelType, int Dims> | ||
void submit(const queue &Q, PropertiesT Props, nd_range<Dims> Range, | ||
const KernelType &KernelFunc, | ||
const sycl::detail::code_location &CodeLoc = | ||
sycl::detail::code_location::current()) { | ||
sycl::ext::oneapi::experimental::detail::submit_kernel_direct_impl< | ||
KernelName, PropertiesT, KernelType, Dims>(Q, Props, Range, KernelFunc, | ||
CodeLoc); | ||
} | ||
|
||
template <typename CommandGroupFunc, typename PropertiesT> | ||
event submit_with_event(const queue &Q, PropertiesT Props, | ||
CommandGroupFunc &&CGF, | ||
|
@@ -143,6 +174,18 @@ event submit_with_event(const queue &Q, CommandGroupFunc &&CGF, | |
std::forward<CommandGroupFunc>(CGF), CodeLoc); | ||
} | ||
|
||
template <typename KernelName = sycl::detail::auto_name, typename PropertiesT, | ||
typename KernelType, int Dims> | ||
event submit_with_event(const queue &Q, PropertiesT Props, nd_range<Dims> Range, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't find where this function is used. Could you please clarify? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is part of the API to be called by the app, when an event is needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So that's for unimplemented yet part of code. Thanks! |
||
const KernelType &KernelFunc, | ||
const sycl::detail::code_location &CodeLoc = | ||
sycl::detail::code_location::current()) { | ||
return sycl::ext::oneapi::experimental::detail:: | ||
submit_kernel_direct_with_event_impl<KernelName, PropertiesT, KernelType, | ||
Dims>(Q, Props, Range, KernelFunc, | ||
CodeLoc); | ||
} | ||
|
||
template <typename KernelName = sycl::detail::auto_name, typename KernelType> | ||
void single_task(handler &CGH, const KernelType &KernelObj) { | ||
CGH.single_task<KernelName>(KernelObj); | ||
|
@@ -259,10 +302,21 @@ template <typename KernelName = sycl::detail::auto_name, int Dimensions, | |
typename KernelType, typename... ReductionsT> | ||
void nd_launch(queue Q, nd_range<Dimensions> Range, const KernelType &KernelObj, | ||
ReductionsT &&...Reductions) { | ||
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT | ||
if constexpr (sizeof...(ReductionsT) == 0) { | ||
submit<KernelName>(std::move(Q), empty_properties_t{}, Range, KernelObj); | ||
} else { | ||
submit(std::move(Q), [&](handler &CGH) { | ||
nd_launch<KernelName>(CGH, Range, KernelObj, | ||
std::forward<ReductionsT>(Reductions)...); | ||
}); | ||
} | ||
#else | ||
submit(std::move(Q), [&](handler &CGH) { | ||
nd_launch<KernelName>(CGH, Range, KernelObj, | ||
std::forward<ReductionsT>(Reductions)...); | ||
}); | ||
#endif | ||
} | ||
|
||
template <typename KernelName = sycl::detail::auto_name, int Dimensions, | ||
|
@@ -283,10 +337,25 @@ template <typename KernelName = sycl::detail::auto_name, int Dimensions, | |
typename Properties, typename KernelType, typename... ReductionsT> | ||
void nd_launch(queue Q, launch_config<nd_range<Dimensions>, Properties> Config, | ||
const KernelType &KernelObj, ReductionsT &&...Reductions) { | ||
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT | ||
if constexpr (sizeof...(ReductionsT) == 0) { | ||
ext::oneapi::experimental::detail::LaunchConfigAccess<nd_range<Dimensions>, | ||
Properties> | ||
ConfigAccess(Config); | ||
submit<KernelName>(std::move(Q), ConfigAccess.getProperties(), | ||
ConfigAccess.getRange(), KernelObj); | ||
} else { | ||
submit(std::move(Q), [&](handler &CGH) { | ||
nd_launch<KernelName>(CGH, Config, KernelObj, | ||
std::forward<ReductionsT>(Reductions)...); | ||
}); | ||
} | ||
#else | ||
submit(std::move(Q), [&](handler &CGH) { | ||
nd_launch<KernelName>(CGH, Config, KernelObj, | ||
std::forward<ReductionsT>(Reductions)...); | ||
}); | ||
#endif | ||
} | ||
|
||
template <int Dimensions, typename... ArgsT> | ||
|
Uh oh!
There was an error while loading. Please reload this page.