[SYCL] Use kernel bundles to query reduction work-group sizes #16009
+1,485
−416
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Work-group sizes currently rely on device maximum rather than the max from a kernel query.
This changes aims to allow querying the kernels by using kernel bundles in the reduction implementations.
In order to do that, all kernel functions have to be defined as function objects and given unique names (for the
kernel_id
s), so they can be identified for akernel_bundle
to be obtained.Additionally, the
kernel_bundle
can be used with the command group execution to ensure we exeucte the same kernel we queried. This has been added as an optional and can be user-configured viaSYCL_REDUCTION_ENABLE_USE_KERNEL_BUNDLES=1|0
. It is set to 0 by default, which meansuse_kernel_bundle
is not called.The goal of this is to be do
kernel.get_info<kernel_device_specific>
(i.e.work_group_size
) queries, primarily to make sure that safe work-group sizes are chosen, but also for other capability queries which can be use for the implementations of the different kernel startegies.