From de14bcf4c056fd22fcd262e4164e0bad258becc5 Mon Sep 17 00:00:00 2001 From: John Pennycook Date: Thu, 20 Feb 2020 09:13:05 -0800 Subject: [PATCH] [SYCL] Fix __spirv_GroupBroadcast overloads 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 --- sycl/include/CL/__spirv/spirv_ops.hpp | 9 ++++++++- sycl/include/CL/__spirv/spirv_types.hpp | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sycl/include/CL/__spirv/spirv_ops.hpp b/sycl/include/CL/__spirv/spirv_ops.hpp index 8678428d8b4be..72efdb44fd34e 100644 --- a/sycl/include/CL/__spirv/spirv_ops.hpp +++ b/sycl/include/CL/__spirv/spirv_ops.hpp @@ -142,7 +142,14 @@ extern bool __spirv_GroupAny(__spv::Scope Execution, bool Predicate) noexcept; template extern dataT __spirv_GroupBroadcast(__spv::Scope Execution, dataT Value, - uint32_t LocalId) noexcept; + size_t LocalId) noexcept; + +template +extern dataT __spirv_GroupBroadcast(__spv::Scope Execution, dataT Value, + __ocl_vec_t LocalId) noexcept; +template +extern dataT __spirv_GroupBroadcast(__spv::Scope Execution, dataT Value, + __ocl_vec_t LocalId) noexcept; template extern dataT __spirv_GroupIAdd(__spv::Scope Execution, __spv::GroupOperation Op, diff --git a/sycl/include/CL/__spirv/spirv_types.hpp b/sycl/include/CL/__spirv/spirv_types.hpp index 4b1c40c2afb87..5c9c55975d7da 100644 --- a/sycl/include/CL/__spirv/spirv_types.hpp +++ b/sycl/include/CL/__spirv/spirv_types.hpp @@ -63,6 +63,10 @@ using RPipeTy = __attribute__((pipe("read_only"))) const dataT; template using WPipeTy = __attribute__((pipe("write_only"))) const dataT; +// OpenCL vector types +template +using __ocl_vec_t = dataT __attribute__((ext_vector_type(dims))); + // Struct representing layout of pipe storage struct ConstantPipeStorage { int32_t _PacketSize;