-
Notifications
You must be signed in to change notification settings - Fork 113
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
[PROTOTYPE] Add fallback to legacy scan implementation for CPU devices and devices that lack size 32 sub-groups #1749
[PROTOTYPE] Add fallback to legacy scan implementation for CPU devices and devices that lack size 32 sub-groups #1749
Conversation
Test is currently compiling. None of the real device code has been integrated, but the preliminary host code and general structure has been defined. Signed-off-by: Matthew Michel <matthew.michel@intel.com>
…implementation Signed-off-by: Matthew Michel <matthew.michel@intel.com>
Signed-off-by: Matthew Michel <matthew.michel@intel.com>
… the init computation Signed-off-by: Matthew Michel <matthew.michel@intel.com>
Signed-off-by: Matthew Michel <matthew.michel@intel.com>
This PR changes the two pass algorithm to be more generalized for use with other scan-like algorithms like copy_if. This PR adds copy_if as an example --------- Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com> Signed-off-by: Matthew Michel <matthew.michel@intel.com> Co-authored-by: Adam Fidel <110841220+adamfidel@users.noreply.github.com> Co-authored-by: Matthew Michel <106704043+mmichel11@users.noreply.github.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
… fix use-after free error (#1712)
Signed-off-by: Matthew Michel <matthew.michel@intel.com>
…:tuple in zip_iterator.pass (#1714) * Fix for zip_iterator.pass in copy_if assignment Signed-off-by: Matthew Michel <matthew.michel@intel.com> * Add similar fix to __simple_write_to_idx Signed-off-by: Matthew Michel <matthew.michel@intel.com> --------- Signed-off-by: Matthew Michel <matthew.michel@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
…last active subgroup otherwise Signed-off-by: Matthew Michel <matthew.michel@intel.com>
Signed-off-by: Matthew Michel <matthew.michel@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
We fallback to the old implementation if the device does not support sub-group sizes of 32, or if the device is a CPU target. Signed-off-by: Matthew Michel <matthew.michel@intel.com>
Signed-off-by: Matthew Michel <matthew.michel@intel.com>
…gacy_scan_fallback Signed-off-by: Matthew Michel <matthew.michel@intel.com>
Signed-off-by: Matthew Michel <matthew.michel@intel.com>
Moving back to draft. Some issues occurred when merging with the target branch. Update: The issues have been fixed. |
…cessary check Signed-off-by: Matthew Michel <matthew.michel@intel.com>
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_utils.h
Outdated
Show resolved
Hide resolved
Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com>
@@ -769,6 +770,15 @@ class __static_monotonic_dispatcher<::std::integer_sequence<::std::uint16_t, _X, | |||
} | |||
}; | |||
|
|||
template <typename _ExecutionPolicy, typename _SizeType> | |||
bool | |||
__supports_sub_group_size(const _ExecutionPolicy& __exec, _SizeType __target_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the only usage of __target_size
in this function casts it to std::size_t
, would it make sense to take the parameter by std::size_t
directly instead of using a template?
__supports_sub_group_size(const _ExecutionPolicy& __exec, _SizeType __target_size) | |
__supports_sub_group_size(const _ExecutionPolicy& __exec, std::size_t __target_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've added this and removed the static_cast
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one minor nitpick, otherwise, I think LGTM
@@ -1052,6 +1064,23 @@ __parallel_copy_if(oneapi::dpl::__internal::__device_backend_tag __backend_tag, | |||
oneapi::dpl::unseq_backend::__no_init_value<_Size>{}, | |||
/*_Inclusive=*/std::true_type{}); | |||
} | |||
else | |||
{ | |||
using _ReduceOp = ::std::plus<_Size>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
::std
->std
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Matthew Michel <matthew.michel@intel.com>
Signed-off-by: Matthew Michel <matthew.michel@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…s and devices that lack size 32 sub-groups (#1749) Signed-off-by: Matthew Michel <matthew.michel@intel.com> Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com> Co-authored-by: Adam Fidel <adam.fidel@intel.com> Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com> Co-authored-by: Adam Fidel <110841220+adamfidel@users.noreply.github.com> Co-authored-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
…s and devices that lack size 32 sub-groups (#1749) Signed-off-by: Matthew Michel <matthew.michel@intel.com> Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com> Co-authored-by: Adam Fidel <adam.fidel@intel.com> Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com> Co-authored-by: Adam Fidel <110841220+adamfidel@users.noreply.github.com> Co-authored-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
…s and devices that lack size 32 sub-groups (#1749) Signed-off-by: Matthew Michel <matthew.michel@intel.com> Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com> Co-authored-by: Adam Fidel <adam.fidel@intel.com> Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com> Co-authored-by: Adam Fidel <110841220+adamfidel@users.noreply.github.com> Co-authored-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
…s and devices that lack size 32 sub-groups (#1749) Signed-off-by: Matthew Michel <matthew.michel@intel.com> Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com> Co-authored-by: Adam Fidel <adam.fidel@intel.com> Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com> Co-authored-by: Adam Fidel <110841220+adamfidel@users.noreply.github.com> Co-authored-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
…s and devices that lack size 32 sub-groups (#1749) Signed-off-by: Matthew Michel <matthew.michel@intel.com> Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com> Co-authored-by: Adam Fidel <adam.fidel@intel.com> Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com> Co-authored-by: Adam Fidel <110841220+adamfidel@users.noreply.github.com> Co-authored-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
…s and devices that lack size 32 sub-groups (#1749) Signed-off-by: Matthew Michel <matthew.michel@intel.com> Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com> Co-authored-by: Adam Fidel <adam.fidel@intel.com> Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com> Co-authored-by: Adam Fidel <110841220+adamfidel@users.noreply.github.com> Co-authored-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
…s and devices that lack size 32 sub-groups (#1749) Signed-off-by: Matthew Michel <matthew.michel@intel.com> Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com> Co-authored-by: Adam Fidel <adam.fidel@intel.com> Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com> Co-authored-by: Adam Fidel <110841220+adamfidel@users.noreply.github.com> Co-authored-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
…s and devices that lack size 32 sub-groups (#1749) Signed-off-by: Matthew Michel <matthew.michel@intel.com> Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com> Co-authored-by: Adam Fidel <adam.fidel@intel.com> Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com> Co-authored-by: Adam Fidel <110841220+adamfidel@users.noreply.github.com> Co-authored-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
…s and devices that lack size 32 sub-groups (#1749) Signed-off-by: Matthew Michel <matthew.michel@intel.com> Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com> Co-authored-by: Adam Fidel <adam.fidel@intel.com> Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com> Co-authored-by: Adam Fidel <110841220+adamfidel@users.noreply.github.com> Co-authored-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
This PR adds a fallback from reduce-then-scan to the legacy scan implementation in two separate cases: