Skip to content

[SYCL][CUDA] Support GroupBroadcast with 32-bit id #2759

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

Merged
merged 2 commits into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libclc/ptx-nvidiacl/libspirv/group/collectives.cl
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ long __clc__3d_to_linear_local_id(ulong3 id) {
uint scope, TYPE x, ulong3 local_id) { \
ulong linear_local_id = __clc__3d_to_linear_local_id(local_id); \
return __spirv_GroupBroadcast(scope, x, linear_local_id); \
} \
_CLC_DEF _CLC_OVERLOAD _CLC_CONVERGENT TYPE __spirv_GroupBroadcast( \
uint scope, TYPE x, uint local_id) { \
return __spirv_GroupBroadcast(scope, x, (ulong)local_id); \
}
__CLC_GROUP_BROADCAST(char);
__CLC_GROUP_BROADCAST(uchar);
Expand All @@ -411,6 +415,10 @@ _CLC_DECL _CLC_CONVERGENT half
_Z17__spirv_GroupBroadcastjDF16_Dv3_m(uint scope, half x, ulong3 local_id) {
return __spirv_GroupBroadcast(scope, x, local_id);
}
_CLC_DECL _CLC_CONVERGENT half
_Z22__spirv_GroupBroadcastjDF16_j(uint scope, half x, uint local_id) {
return __spirv_GroupBroadcast(scope, x, (ulong)local_id);
}

#undef __CLC_GROUP_BROADCAST

Expand Down
5 changes: 1 addition & 4 deletions sycl/test/on-device/sub_group/broadcast.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// XFAIL: cuda
// CUDA compilation and runtime do not yet support sub-groups.

// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
Expand All @@ -19,7 +16,7 @@

int main() {
queue Queue;
if (!core_sg_supported(Queue.get_device())) {
if (Queue.get_device().is_host()) {
std::cout << "Skipping test\n";
return 0;
}
Expand Down
6 changes: 2 additions & 4 deletions sycl/test/on-device/sub_group/broadcast_fp16.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// XFAIL: cuda
// CUDA compilation and runtime do not yet support sub-groups.

// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out

Expand All @@ -16,10 +13,11 @@

int main() {
queue Queue;
if (!core_sg_supported(Queue.get_device())) {
if (Queue.get_device().is_host()) {
std::cout << "Skipping test\n";
return 0;
}
check<cl::sycl::half>(Queue);
std::cout << "Test passed." << std::endl;
return 0;
}
5 changes: 1 addition & 4 deletions sycl/test/on-device/sub_group/broadcast_fp64.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// XFAIL: cuda
// CUDA compilation and runtime do not yet support sub-groups.

// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
Expand All @@ -19,7 +16,7 @@

int main() {
queue Queue;
if (!core_sg_supported(Queue.get_device())) {
if (Queue.get_device().is_host()) {
std::cout << "Skipping test\n";
return 0;
}
Expand Down