Skip to content

Commit ecb148b

Browse files
author
Georgi Mirazchiyski
authored
[SYCL] Fix forward declarations to SubgroupShuffleUp/Down overloads (#8614)
This PR fixes up the template overload function forward declarations for (Generic) `SubroupShuffleDown` and `SubroupShuffleUp` to use the `uint32_t delta` parameter instead of `id<1> local_id`. Also removed two unnecessary forward declarations `EnableIfBitcastShuffle SubroupShuffleUp/Down` with `id<1> local_id`. These forward declarations are needed because the `EnableIfVector` imlpementations call these functions but their bodies are defined after vector versions, so the compiler can't identify them. Without this fix users will get `SYCL kernel cannot call an undefined function without SYCL_EXTERNAL attribute ...` compile errors. That error also manifested in issue [#8516](#8516), which will be fixed with the changes of the PR. Side note: This also fixes compiling the `group_broadcast` tests for the `test_group_functions` target in the SYCL-CTS.
1 parent 1404ff1 commit ecb148b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

sycl/include/sycl/detail/spirv.hpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -595,23 +595,17 @@ EnableIfBitcastShuffle<T> SubgroupShuffle(T x, id<1> local_id);
595595
template <typename T>
596596
EnableIfBitcastShuffle<T> SubgroupShuffleXor(T x, id<1> local_id);
597597

598-
template <typename T>
599-
EnableIfBitcastShuffle<T> SubgroupShuffleDown(T x, id<1> local_id);
600-
601-
template <typename T>
602-
EnableIfBitcastShuffle<T> SubgroupShuffleUp(T x, id<1> local_id);
603-
604598
template <typename T>
605599
EnableIfGenericShuffle<T> SubgroupShuffle(T x, id<1> local_id);
606600

607601
template <typename T>
608602
EnableIfGenericShuffle<T> SubgroupShuffleXor(T x, id<1> local_id);
609603

610604
template <typename T>
611-
EnableIfGenericShuffle<T> SubgroupShuffleDown(T x, id<1> local_id);
605+
EnableIfGenericShuffle<T> SubgroupShuffleDown(T x, uint32_t delta);
612606

613607
template <typename T>
614-
EnableIfGenericShuffle<T> SubgroupShuffleUp(T x, id<1> local_id);
608+
EnableIfGenericShuffle<T> SubgroupShuffleUp(T x, uint32_t delta);
615609

616610
template <typename T>
617611
EnableIfNativeShuffle<T> SubgroupShuffle(T x, id<1> local_id) {

0 commit comments

Comments
 (0)