KhronosGroup / KhronosGroup/SYCL-Docs
Should the reduce and scan group algorithms support marray/vec?
- Dominant language
- JavaScript
- Stars
- 158
- Forks
- 80
- Avg merge
- 7d 6h
- Merged PRs (30d)
- 5
Description
From [4.17.4. Group algorithms library](https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:algorithms):
> All group functions are supported for the fundamental scalar types supported by SYCL (see [Table 184](https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#table.types.fundamental)) and instances of the SYCL vec and marray classes.
However, not all the specifications of the group functions adhere to this rule. Specifically, the reduce and scan algorithms do not allow for vec and marray, e.g. [4.17.4.5. reduce](https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_reduce):
> ```
> template
> std::iterator_traits::value_type
> joint_reduce(Group g, Ptr first, Ptr last, BinaryOperation binary_op); // (1)
> ```
> [...]
> Constraints: Available only if sycl::is_group_v> is true, **Ptr is a pointer to a fundamental type**, and BinaryOperation is a SYCL function object type.
However, this could be argued to be fine (although in my opinion, confusing) because of the following statement in 4.17.4:
> Any restrictions from the standard algorithms library apply. Some of the functions in the SYCL algorithms library introduce additional restrictions in order to maximize portability across different devices and to minimize the chances of encountering unexpected behavior.
Should the reduce and scan specifications be amended to allow for vec and marray?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.