mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
cl21: Fix Issue 38 - Test spirv_new - new test for cl_khr_spirv_no_integer_… (#119)
* Fix Issue 38 - Test spirv_new - new test for cl_khr_spirv_no_integer_wrap_decoration SPV_KHR_no_integer_wrap_decoration extension * Remove not used variable.
This commit is contained in:
committed by
Kévin Petit
parent
a6fdb7ce60
commit
32e702efbc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %22 FuncParamAttr NoWrite
|
||||
%22 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpDecorate %20 NoSignedWrap
|
||||
OpGroupDecorate %22 %lhs %rhs
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant
|
||||
%9 = OpFunction %void None %8
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId
|
||||
%15 = OpCompositeExtract %uint %14 0
|
||||
%16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15
|
||||
%17 = OpLoad %uint %16 Aligned 4
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpIAdd %uint %17 %19
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15
|
||||
OpStore %21 %20 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,53 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 28
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %27 FuncParamAttr NoWrite
|
||||
%27 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpDecorate %24 NoSignedWrap
|
||||
OpGroupDecorate %27 %lhs %rhs
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant
|
||||
%10 = OpFunction %void None %9
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%14 = OpLabel
|
||||
%15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId
|
||||
%16 = OpCompositeExtract %ulong %15 0
|
||||
%17 = OpUConvert %uint %16
|
||||
%18 = OpSConvert %ulong %17
|
||||
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18
|
||||
%20 = OpLoad %uint %19 Aligned 4
|
||||
%21 = OpSConvert %ulong %17
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21
|
||||
%23 = OpLoad %uint %22 Aligned 4
|
||||
%24 = OpIAdd %uint %20 %23
|
||||
%25 = OpSConvert %ulong %17
|
||||
%26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %25
|
||||
OpStore %26 %24 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %22 FuncParamAttr NoWrite
|
||||
%22 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpDecorate %20 NoUnsignedWrap
|
||||
OpGroupDecorate %22 %lhs %rhs
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant
|
||||
%9 = OpFunction %void None %8
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId
|
||||
%15 = OpCompositeExtract %uint %14 0
|
||||
%16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15
|
||||
%17 = OpLoad %uint %16 Aligned 4
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpIAdd %uint %17 %19
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15
|
||||
OpStore %21 %20 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,53 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 28
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %27 FuncParamAttr NoWrite
|
||||
%27 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpDecorate %24 NoUnsignedWrap
|
||||
OpGroupDecorate %27 %lhs %rhs
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant
|
||||
%10 = OpFunction %void None %9
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%14 = OpLabel
|
||||
%15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId
|
||||
%16 = OpCompositeExtract %ulong %15 0
|
||||
%17 = OpUConvert %uint %16
|
||||
%18 = OpSConvert %ulong %17
|
||||
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18
|
||||
%20 = OpLoad %uint %19 Aligned 4
|
||||
%21 = OpSConvert %ulong %17
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21
|
||||
%23 = OpLoad %uint %22 Aligned 4
|
||||
%24 = OpIAdd %uint %20 %23
|
||||
%25 = OpSConvert %ulong %17
|
||||
%26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %25
|
||||
OpStore %26 %24 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %22 FuncParamAttr NoWrite
|
||||
%22 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpDecorate %20 NoSignedWrap
|
||||
OpGroupDecorate %22 %lhs %rhs
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant
|
||||
%9 = OpFunction %void None %8
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId
|
||||
%15 = OpCompositeExtract %uint %14 0
|
||||
%16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15
|
||||
%17 = OpLoad %uint %16 Aligned 4
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpIMul %uint %17 %19
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15
|
||||
OpStore %21 %20 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,53 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 28
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %27 FuncParamAttr NoWrite
|
||||
%27 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpDecorate %24 NoSignedWrap
|
||||
OpGroupDecorate %27 %lhs %rhs
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant
|
||||
%10 = OpFunction %void None %9
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%14 = OpLabel
|
||||
%15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId
|
||||
%16 = OpCompositeExtract %ulong %15 0
|
||||
%17 = OpUConvert %uint %16
|
||||
%18 = OpSConvert %ulong %17
|
||||
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18
|
||||
%20 = OpLoad %uint %19 Aligned 4
|
||||
%21 = OpSConvert %ulong %17
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21
|
||||
%23 = OpLoad %uint %22 Aligned 4
|
||||
%24 = OpIMul %uint %20 %23
|
||||
%25 = OpSConvert %ulong %17
|
||||
%26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %25
|
||||
OpStore %26 %24 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %22 FuncParamAttr NoWrite
|
||||
%22 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpDecorate %20 NoUnsignedWrap
|
||||
OpGroupDecorate %22 %lhs %rhs
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant
|
||||
%9 = OpFunction %void None %8
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId
|
||||
%15 = OpCompositeExtract %uint %14 0
|
||||
%16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15
|
||||
%17 = OpLoad %uint %16 Aligned 4
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpIMul %uint %17 %19
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15
|
||||
OpStore %21 %20 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,53 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 28
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %27 FuncParamAttr NoWrite
|
||||
%27 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpDecorate %24 NoUnsignedWrap
|
||||
OpGroupDecorate %27 %lhs %rhs
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant
|
||||
%10 = OpFunction %void None %9
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%14 = OpLabel
|
||||
%15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId
|
||||
%16 = OpCompositeExtract %ulong %15 0
|
||||
%17 = OpUConvert %uint %16
|
||||
%18 = OpSConvert %ulong %17
|
||||
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18
|
||||
%20 = OpLoad %uint %19 Aligned 4
|
||||
%21 = OpSConvert %ulong %17
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21
|
||||
%23 = OpLoad %uint %22 Aligned 4
|
||||
%24 = OpIMul %uint %20 %23
|
||||
%25 = OpSConvert %ulong %17
|
||||
%26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %25
|
||||
OpStore %26 %24 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,46 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %21 FuncParamAttr NoWrite
|
||||
OpDecorate %19 NoSignedWrap
|
||||
%21 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpGroupDecorate %21 %lhs %rhs
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant
|
||||
%9 = OpFunction %void None %8
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId
|
||||
%15 = OpCompositeExtract %uint %14 0
|
||||
%16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15
|
||||
%17 = OpLoad %uint %16 Aligned 4
|
||||
%19 = OpSNegate %uint %17
|
||||
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15
|
||||
OpStore %20 %19 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,51 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 26
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %25 FuncParamAttr NoWrite
|
||||
OpDecorate %22 NoSignedWrap
|
||||
%25 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpGroupDecorate %25 %lhs %rhs
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant
|
||||
%10 = OpFunction %void None %9
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%14 = OpLabel
|
||||
%15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId
|
||||
%16 = OpCompositeExtract %ulong %15 0
|
||||
%17 = OpUConvert %uint %16
|
||||
%18 = OpSConvert %ulong %17
|
||||
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18
|
||||
%20 = OpLoad %uint %19 Aligned 4
|
||||
%22 = OpSNegate %uint %20
|
||||
%23 = OpSConvert %ulong %17
|
||||
%24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %23
|
||||
OpStore %24 %22 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,49 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 25
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %24 FuncParamAttr NoWrite
|
||||
%24 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpDecorate %22 NoSignedWrap
|
||||
OpGroupDecorate %24 %lhs %rhs
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_31 = OpConstant %uint 31
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant
|
||||
%9 = OpFunction %void None %8
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId
|
||||
%15 = OpCompositeExtract %uint %14 0
|
||||
%16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15
|
||||
%17 = OpLoad %uint %16 Aligned 4
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%21 = OpBitwiseAnd %uint %19 %uint_31
|
||||
%22 = OpShiftLeftLogical %uint %17 %21
|
||||
%23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15
|
||||
OpStore %23 %22 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,55 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 30
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %29 FuncParamAttr NoWrite
|
||||
%29 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpDecorate %26 NoSignedWrap
|
||||
OpGroupDecorate %29 %lhs %rhs
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_31 = OpConstant %uint 31
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant
|
||||
%10 = OpFunction %void None %9
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%14 = OpLabel
|
||||
%15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId
|
||||
%16 = OpCompositeExtract %ulong %15 0
|
||||
%17 = OpUConvert %uint %16
|
||||
%18 = OpSConvert %ulong %17
|
||||
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18
|
||||
%20 = OpLoad %uint %19 Aligned 4
|
||||
%21 = OpSConvert %ulong %17
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21
|
||||
%23 = OpLoad %uint %22 Aligned 4
|
||||
%25 = OpBitwiseAnd %uint %23 %uint_31
|
||||
%26 = OpShiftLeftLogical %uint %20 %25
|
||||
%27 = OpSConvert %ulong %17
|
||||
%28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %27
|
||||
OpStore %28 %26 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,49 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 25
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %24 FuncParamAttr NoWrite
|
||||
%24 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpDecorate %22 NoUnsignedWrap
|
||||
OpGroupDecorate %24 %lhs %rhs
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_31 = OpConstant %uint 31
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant
|
||||
%9 = OpFunction %void None %8
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId
|
||||
%15 = OpCompositeExtract %uint %14 0
|
||||
%16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15
|
||||
%17 = OpLoad %uint %16 Aligned 4
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%21 = OpBitwiseAnd %uint %19 %uint_31
|
||||
%22 = OpShiftLeftLogical %uint %17 %21
|
||||
%23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15
|
||||
OpStore %23 %22 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,55 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 30
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %29 FuncParamAttr NoWrite
|
||||
%29 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpDecorate %26 NoUnsignedWrap
|
||||
OpGroupDecorate %29 %lhs %rhs
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_31 = OpConstant %uint 31
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant
|
||||
%10 = OpFunction %void None %9
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%14 = OpLabel
|
||||
%15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId
|
||||
%16 = OpCompositeExtract %ulong %15 0
|
||||
%17 = OpUConvert %uint %16
|
||||
%18 = OpSConvert %ulong %17
|
||||
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18
|
||||
%20 = OpLoad %uint %19 Aligned 4
|
||||
%21 = OpSConvert %ulong %17
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21
|
||||
%23 = OpLoad %uint %22 Aligned 4
|
||||
%25 = OpBitwiseAnd %uint %23 %uint_31
|
||||
%26 = OpShiftLeftLogical %uint %20 %25
|
||||
%27 = OpSConvert %ulong %17
|
||||
%28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %27
|
||||
OpStore %28 %26 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %22 FuncParamAttr NoWrite
|
||||
%22 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpGroupDecorate %22 %lhs %rhs
|
||||
OpDecorate %20 NoSignedWrap
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant
|
||||
%9 = OpFunction %void None %8
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId
|
||||
%15 = OpCompositeExtract %uint %14 0
|
||||
%16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15
|
||||
%17 = OpLoad %uint %16 Aligned 4
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpISub %uint %17 %19
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15
|
||||
OpStore %21 %20 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,53 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 28
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %27 FuncParamAttr NoWrite
|
||||
%27 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpGroupDecorate %27 %lhs %rhs
|
||||
OpDecorate %24 NoSignedWrap
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant
|
||||
%10 = OpFunction %void None %9
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%14 = OpLabel
|
||||
%15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId
|
||||
%16 = OpCompositeExtract %ulong %15 0
|
||||
%17 = OpUConvert %uint %16
|
||||
%18 = OpSConvert %ulong %17
|
||||
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18
|
||||
%20 = OpLoad %uint %19 Aligned 4
|
||||
%21 = OpSConvert %ulong %17
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21
|
||||
%23 = OpLoad %uint %22 Aligned 4
|
||||
%24 = OpISub %uint %20 %23
|
||||
%25 = OpSConvert %ulong %17
|
||||
%26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %25
|
||||
OpStore %26 %24 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %22 FuncParamAttr NoWrite
|
||||
%22 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpGroupDecorate %22 %lhs %rhs
|
||||
OpDecorate %20 NoUnsignedWrap
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant
|
||||
%9 = OpFunction %void None %8
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId
|
||||
%15 = OpCompositeExtract %uint %14 0
|
||||
%16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15
|
||||
%17 = OpLoad %uint %16 Aligned 4
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpISub %uint %17 %19
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15
|
||||
OpStore %21 %20 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,53 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 28
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "fmath_cl"
|
||||
OpSource OpenCL_C 200000
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId"
|
||||
OpName %out "out"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpDecorate %27 FuncParamAttr NoWrite
|
||||
%27 = OpDecorationGroup
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
OpGroupDecorate %27 %lhs %rhs
|
||||
OpDecorate %24 NoUnsignedWrap
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant
|
||||
%10 = OpFunction %void None %9
|
||||
%out = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%14 = OpLabel
|
||||
%15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId
|
||||
%16 = OpCompositeExtract %ulong %15 0
|
||||
%17 = OpUConvert %uint %16
|
||||
%18 = OpSConvert %ulong %17
|
||||
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18
|
||||
%20 = OpLoad %uint %19 Aligned 4
|
||||
%21 = OpSConvert %ulong %17
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21
|
||||
%23 = OpLoad %uint %22 Aligned 4
|
||||
%24 = OpISub %uint %20 %23
|
||||
%25 = OpSConvert %ulong %17
|
||||
%26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %25
|
||||
OpStore %26 %24 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,223 @@
|
||||
/******************************************************************
|
||||
Copyright (c) 2018 The Khronos Group Inc. All Rights Reserved.
|
||||
|
||||
This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc.
|
||||
This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to
|
||||
third parties, and may not be reproduced, republished, distributed, transmitted, displayed,
|
||||
broadcast or otherwise exploited in any manner without the express prior written permission
|
||||
of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce,
|
||||
disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe,
|
||||
in whole or in part other than under the terms of the Khronos Adopters Agreement
|
||||
or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient.
|
||||
******************************************************************/
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
|
||||
template<typename T>
|
||||
int test_ext_cl_khr_spirv_no_integer_wrap_decoration(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
const char *spvName,
|
||||
const char *funcName,
|
||||
const char *Tname)
|
||||
{
|
||||
|
||||
cl_int err = CL_SUCCESS;
|
||||
const int num = 10;
|
||||
std::vector<T> h_lhs(num);
|
||||
std::vector<T> h_rhs(num);
|
||||
std::vector<T> expected_results(num);
|
||||
std::vector<T> h_ref(num);
|
||||
if (!is_extension_available(deviceID, "cl_khr_spirv_no_integer_wrap_decoration")) {
|
||||
log_info("Extension cl_khr_spirv_no_integer_wrap_decoration not supported; skipping tests.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*Test with some values that do not cause overflow*/
|
||||
if (std::is_signed<T>::value == true) {
|
||||
h_lhs.push_back((T)-25000);
|
||||
h_lhs.push_back((T)-3333);
|
||||
h_lhs.push_back((T)-7);
|
||||
h_lhs.push_back((T)-1);
|
||||
h_lhs.push_back(0);
|
||||
h_lhs.push_back(1);
|
||||
h_lhs.push_back(1024);
|
||||
h_lhs.push_back(2048);
|
||||
h_lhs.push_back(4094);
|
||||
h_lhs.push_back(10000);
|
||||
} else {
|
||||
h_lhs.push_back(0);
|
||||
h_lhs.push_back(1);
|
||||
h_lhs.push_back(3);
|
||||
h_lhs.push_back(5);
|
||||
h_lhs.push_back(10);
|
||||
h_lhs.push_back(100);
|
||||
h_lhs.push_back(1024);
|
||||
h_lhs.push_back(2048);
|
||||
h_lhs.push_back(4094);
|
||||
h_lhs.push_back(52888);
|
||||
}
|
||||
|
||||
h_rhs.push_back(0);
|
||||
h_rhs.push_back(1);
|
||||
h_rhs.push_back(2);
|
||||
h_rhs.push_back(3);
|
||||
h_rhs.push_back(4);
|
||||
h_rhs.push_back(5);
|
||||
h_rhs.push_back(6);
|
||||
h_rhs.push_back(7);
|
||||
h_rhs.push_back(8);
|
||||
h_rhs.push_back(9);
|
||||
size_t bytes = num * sizeof(T);
|
||||
|
||||
clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer");
|
||||
|
||||
err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer");
|
||||
|
||||
clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer");
|
||||
|
||||
err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer");
|
||||
|
||||
std::string kernelStr;
|
||||
|
||||
{
|
||||
std::stringstream kernelStream;
|
||||
kernelStream << "#define spirv_fadd(a, b) (a) + (b) \n";
|
||||
kernelStream << "#define spirv_fsub(a, b) (a) - (b) \n";
|
||||
kernelStream << "#define spirv_fmul(a, b) (a) * (b) \n";
|
||||
kernelStream << "#define spirv_fshiftleft(a, b) (a) << (b) \n";
|
||||
kernelStream << "#define spirv_fnegate(a, b) (-a) \n";
|
||||
|
||||
kernelStream << "#define T " << Tname << "\n";
|
||||
kernelStream << "#define FUNC spirv_" << funcName << "\n";
|
||||
kernelStream << "__kernel void fmath_cl(__global T *out, \n";
|
||||
kernelStream << "const __global T *lhs, const __global T *rhs) \n";
|
||||
kernelStream << "{ \n";
|
||||
kernelStream << " int id = get_global_id(0); \n";
|
||||
kernelStream << " out[id] = FUNC(lhs[id], rhs[id]); \n";
|
||||
kernelStream << "} \n";
|
||||
kernelStr = kernelStream.str();
|
||||
}
|
||||
|
||||
size_t kernelLen = kernelStr.size();
|
||||
const char *kernelBuf = kernelStr.c_str();
|
||||
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (std::string(funcName) == std::string("fadd")) {
|
||||
expected_results[i] = h_lhs[i] + h_rhs[i];
|
||||
} else if (std::string(funcName) == std::string("fsub")) {
|
||||
expected_results[i] = h_lhs[i] - h_rhs[i];
|
||||
} else if (std::string(funcName) == std::string("fmul")) {
|
||||
expected_results[i] = h_lhs[i] * h_rhs[i];
|
||||
} else if (std::string(funcName) == std::string("fshiftleft")) {
|
||||
expected_results[i] = h_lhs[i] << h_rhs[i];
|
||||
} else if (std::string(funcName) == std::string("fnegate")) {
|
||||
expected_results[i] = 0 - h_lhs[i];
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// Run the cl kernel for reference results
|
||||
clProgramWrapper prog;
|
||||
err = create_single_kernel_helper_create_program(context, &prog, 1, &kernelBuf, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to create cl program");
|
||||
|
||||
err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to build program");
|
||||
|
||||
clKernelWrapper kernel = clCreateKernel(prog, "fmath_cl", &err);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to create cl kernel");
|
||||
|
||||
clMemWrapper ref = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to create ref buffer");
|
||||
|
||||
err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &ref);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to set arg 0");
|
||||
|
||||
err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to set arg 1");
|
||||
|
||||
err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to set arg 2");
|
||||
|
||||
size_t global = num;
|
||||
err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel");
|
||||
|
||||
err = clEnqueueReadBuffer(queue, ref, CL_TRUE, 0, bytes, &h_ref[0], 0, NULL, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to read from ref");
|
||||
}
|
||||
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (expected_results[i] != h_ref[i]) {
|
||||
log_error("Values do not match at index %d expected = %d got = %d\n", i, expected_results[i], h_ref[i]);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
clProgramWrapper prog;
|
||||
err = get_program_with_il(prog, deviceID, context, spvName);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to build program");
|
||||
|
||||
clKernelWrapper kernel = clCreateKernel(prog, "fmath_cl", &err);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to create spv kernel");
|
||||
|
||||
clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to create res buffer");
|
||||
|
||||
err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to set arg 0");
|
||||
|
||||
err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to set arg 1");
|
||||
|
||||
err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to set arg 2");
|
||||
|
||||
size_t global = num;
|
||||
err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel");
|
||||
|
||||
std::vector<T> h_res(num);
|
||||
err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to read from ref");
|
||||
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (expected_results[i] != h_res[i]) {
|
||||
log_error("Values do not match at location %d expected = %d got = %d\n", i, expected_results[i], h_res[i]);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define TEST_FMATH_FUNC(TYPE, FUNC) \
|
||||
TEST_SPIRV_FUNC(ext_cl_khr_spirv_no_integer_wrap_decoration_##FUNC##_##TYPE) \
|
||||
{ \
|
||||
return test_ext_cl_khr_spirv_no_integer_wrap_decoration<cl_##TYPE>(deviceID, context, queue, \
|
||||
"ext_cl_khr_spirv_no_integer_wrap_decoration_"#FUNC"_"#TYPE, \
|
||||
#FUNC, \
|
||||
#TYPE \
|
||||
); \
|
||||
}
|
||||
|
||||
TEST_FMATH_FUNC(int, fadd)
|
||||
TEST_FMATH_FUNC(int, fsub)
|
||||
TEST_FMATH_FUNC(int, fmul)
|
||||
TEST_FMATH_FUNC(int, fshiftleft)
|
||||
TEST_FMATH_FUNC(int, fnegate)
|
||||
TEST_FMATH_FUNC(uint, fadd)
|
||||
TEST_FMATH_FUNC(uint, fsub)
|
||||
TEST_FMATH_FUNC(uint, fmul)
|
||||
TEST_FMATH_FUNC(uint, fshiftleft)
|
||||
Reference in New Issue
Block a user