Skip to content

Commit 5d73019

Browse files
authored
[SYCL] Fix __spirv_GroupBroadcast overloads (#1152)
SPIR-V OpGroupBroadcast accepts three forms of local ID: - scalar integer - vector integer with 2 components - vector integer with 3 components Signed-off-by: John Pennycook <[email protected]>
1 parent 1d8f577 commit 5d73019

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

sycl/include/CL/__spirv/spirv_ops.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,14 @@ extern bool __spirv_GroupAny(__spv::Scope Execution, bool Predicate) noexcept;
142142

143143
template <typename dataT>
144144
extern dataT __spirv_GroupBroadcast(__spv::Scope Execution, dataT Value,
145-
uint32_t LocalId) noexcept;
145+
size_t LocalId) noexcept;
146+
147+
template <typename dataT>
148+
extern dataT __spirv_GroupBroadcast(__spv::Scope Execution, dataT Value,
149+
__ocl_vec_t<size_t, 2> LocalId) noexcept;
150+
template <typename dataT>
151+
extern dataT __spirv_GroupBroadcast(__spv::Scope Execution, dataT Value,
152+
__ocl_vec_t<size_t, 3> LocalId) noexcept;
146153

147154
template <typename dataT>
148155
extern dataT __spirv_GroupIAdd(__spv::Scope Execution, __spv::GroupOperation Op,

sycl/include/CL/__spirv/spirv_types.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ using RPipeTy = __attribute__((pipe("read_only"))) const dataT;
6363
template <typename dataT>
6464
using WPipeTy = __attribute__((pipe("write_only"))) const dataT;
6565

66+
// OpenCL vector types
67+
template <typename dataT, int dims>
68+
using __ocl_vec_t = dataT __attribute__((ext_vector_type(dims)));
69+
6670
// Struct representing layout of pipe storage
6771
struct ConstantPipeStorage {
6872
int32_t _PacketSize;

0 commit comments

Comments
 (0)