mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 16:29:03 +00:00
New spirv_new test case OpSpecConstant (#719)
* New spirv_new test case OpSpecConstant OpSpecConstantTrue OpSpecConstantfalse * Register test case with minimal OpenCL version * Specialization constant - add files uint/int cases * Specialization constants - fix second build program * Fix changes clang format. * spirv_new - Make functions visible outside of main * Fix clang format issues * Fix int/uint 32 bit cases * Fix minimal required version for test_op_spec_constant * Remove not needed OpName. Update binaries * Fix code format * Remove op_spec_constant_int cases in spirv_new tests * op_spec_constant - add simplified spirv files * no redundant OpUConvert OpSConvert * no redundant OpName * instead of buffers scalar variable * op_spec_constant - refactor to address review issues * avoid using program that has already kernel program attached * remove not used buffer * Simplified test case - instead of buffers use scalar variable * spirv_new - remove spec_const duplicated cases (singed versions) * spirv_new - set clSetProgramSpecializationConstant before clBuildProgram * Test spirv_new - fix spec const after rebase * Test spirv_new - fix spec const set min version for bool type tests
This commit is contained in:
committed by
GitHub
parent
afa2fcca96
commit
41cd9c6d98
@@ -0,0 +1,36 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
OpCapability Float64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%15 = OpString "kernel_arg_type.spec_const_kernel.double*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpName %add "add"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 8
|
||||
OpDecorate %double_0 SpecId 101
|
||||
%double = OpTypeFloat 64
|
||||
%_ptr_UniformConstant_double = OpTypePointer UniformConstant %double
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_double
|
||||
%double_0 = OpSpecConstant %double 0
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_double UniformConstant %double_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_double
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %double %output_value Aligned 8
|
||||
%13 = OpLoad %double %spec_const_kernel_spec_constant_value Aligned 8
|
||||
%add = OpFAdd %double %12 %13
|
||||
OpStore %output_value %add Aligned 8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,36 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
OpCapability Float64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%15 = OpString "kernel_arg_type.spec_const_kernel.double*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpName %add "add"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 8
|
||||
OpDecorate %double_0 SpecId 101
|
||||
%double = OpTypeFloat 64
|
||||
%_ptr_UniformConstant_double = OpTypePointer UniformConstant %double
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_double
|
||||
%double_0 = OpSpecConstant %double 0
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_double UniformConstant %double_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_double
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %double %output_value Aligned 8
|
||||
%13 = OpLoad %double %spec_const_kernel_spec_constant_value Aligned 8
|
||||
%add = OpFAdd %double %12 %13
|
||||
OpStore %output_value %add Aligned 8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,57 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 28
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int8
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %11 "spec_const_kernel"
|
||||
%27 = OpString "kernel_arg_type.spec_const_kernel.uchar*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %test_value "test_value"
|
||||
OpName %entry "entry"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry_0 "entry"
|
||||
OpName %if_then "if.then"
|
||||
OpName %if_end "if.end"
|
||||
OpDecorate %test_value FuncParamAttr Zext
|
||||
OpDecorate %test_value LinkageAttributes "test_value" Export
|
||||
OpDecorate %add NoSignedWrap
|
||||
OpDecorate %false SpecId 101
|
||||
%uchar = OpTypeInt 8 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%uchar_0 = OpConstant %uchar 0
|
||||
%uchar_1 = OpConstant %uchar 1
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%bool = OpTypeBool
|
||||
%3 = OpTypeFunction %bool
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar
|
||||
%10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar
|
||||
%false = OpSpecConstantFalse %bool
|
||||
%test_value = OpFunction %bool None %3
|
||||
%entry = OpLabel
|
||||
OpReturnValue %false
|
||||
OpFunctionEnd
|
||||
%11 = OpFunction %void None %10
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
|
||||
%entry_0 = OpLabel
|
||||
%call = OpFunctionCall %bool %test_value
|
||||
%frombool = OpSelect %uchar %call %uchar_1 %uchar_0
|
||||
%tobool = OpINotEqual %bool %frombool %uchar_0
|
||||
OpBranchConditional %tobool %if_then %if_end
|
||||
%if_then = OpLabel
|
||||
%21 = OpLoad %uchar %output_value Aligned 1
|
||||
%conv = OpUConvert %uint %21
|
||||
%add = OpIAdd %uint %conv %uint_1
|
||||
%conv1 = OpUConvert %uchar %add
|
||||
OpStore %output_value %conv1 Aligned 1
|
||||
OpBranch %if_end
|
||||
%if_end = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,57 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 28
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int8
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %11 "spec_const_kernel"
|
||||
%27 = OpString "kernel_arg_type.spec_const_kernel.uchar*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %test_value "test_value"
|
||||
OpName %entry "entry"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry_0 "entry"
|
||||
OpName %if_then "if.then"
|
||||
OpName %if_end "if.end"
|
||||
OpDecorate %test_value FuncParamAttr Zext
|
||||
OpDecorate %test_value LinkageAttributes "test_value" Export
|
||||
OpDecorate %add NoSignedWrap
|
||||
OpDecorate %false SpecId 101
|
||||
%uchar = OpTypeInt 8 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%uchar_0 = OpConstant %uchar 0
|
||||
%uchar_1 = OpConstant %uchar 1
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%bool = OpTypeBool
|
||||
%3 = OpTypeFunction %bool
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar
|
||||
%10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar
|
||||
%false = OpSpecConstantFalse %bool
|
||||
%test_value = OpFunction %bool None %3
|
||||
%entry = OpLabel
|
||||
OpReturnValue %false
|
||||
OpFunctionEnd
|
||||
%11 = OpFunction %void None %10
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
|
||||
%entry_0 = OpLabel
|
||||
%call = OpFunctionCall %bool %test_value
|
||||
%frombool = OpSelect %uchar %call %uchar_1 %uchar_0
|
||||
%tobool = OpINotEqual %bool %frombool %uchar_0
|
||||
OpBranchConditional %tobool %if_then %if_end
|
||||
%if_then = OpLabel
|
||||
%21 = OpLoad %uchar %output_value Aligned 1
|
||||
%conv = OpUConvert %uint %21
|
||||
%add = OpIAdd %uint %conv %uint_1
|
||||
%conv1 = OpUConvert %uchar %add
|
||||
OpStore %output_value %conv1 Aligned 1
|
||||
OpBranch %if_end
|
||||
%if_end = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,35 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%15 = OpString "kernel_arg_type.spec_const_kernel.float*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpName %add "add"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 4
|
||||
OpDecorate %float_0 SpecId 101
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_UniformConstant_float = OpTypePointer UniformConstant %float
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_float
|
||||
%float_0 = OpSpecConstant %float 0
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_float UniformConstant %float_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_float
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %float %output_value Aligned 4
|
||||
%13 = OpLoad %float %spec_const_kernel_spec_constant_value Aligned 4
|
||||
%add = OpFAdd %float %12 %13
|
||||
OpStore %output_value %add Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,35 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%15 = OpString "kernel_arg_type.spec_const_kernel.float*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpName %add "add"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 4
|
||||
OpDecorate %float_0 SpecId 101
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_UniformConstant_float = OpTypePointer UniformConstant %float
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_float
|
||||
%float_0 = OpSpecConstant %float 0
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_float UniformConstant %float_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_float
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %float %output_value Aligned 4
|
||||
%13 = OpLoad %float %spec_const_kernel_spec_constant_value Aligned 4
|
||||
%add = OpFAdd %float %12 %13
|
||||
OpStore %output_value %add Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,36 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
OpCapability Float16Buffer
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%15 = OpString "kernel_arg_type.spec_const_kernel.half*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpName %add "add"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 2
|
||||
OpDecorate %half_0x0p_0 SpecId 101
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_UniformConstant_half = OpTypePointer UniformConstant %half
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_half
|
||||
%half_0x0p_0 = OpSpecConstant %half 0x0p+0
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_half UniformConstant %half_0x0p_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %half %output_value Aligned 2
|
||||
%13 = OpLoad %half %spec_const_kernel_spec_constant_value Aligned 2
|
||||
%add = OpFAdd %half %12 %13
|
||||
OpStore %output_value %add Aligned 2
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,36 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
OpCapability Float16Buffer
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%15 = OpString "kernel_arg_type.spec_const_kernel.half*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpName %add "add"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 2
|
||||
OpDecorate %half_0x0p_0 SpecId 101
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_UniformConstant_half = OpTypePointer UniformConstant %half
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_half
|
||||
%half_0x0p_0 = OpSpecConstant %half 0x0p+0
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_half UniformConstant %half_0x0p_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %half %output_value Aligned 2
|
||||
%13 = OpLoad %half %spec_const_kernel_spec_constant_value Aligned 2
|
||||
%add = OpFAdd %half %12 %13
|
||||
OpStore %output_value %add Aligned 2
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,57 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 28
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int8
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %11 "spec_const_kernel"
|
||||
%27 = OpString "kernel_arg_type.spec_const_kernel.uchar*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %test_value "test_value"
|
||||
OpName %entry "entry"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry_0 "entry"
|
||||
OpName %if_then "if.then"
|
||||
OpName %if_end "if.end"
|
||||
OpDecorate %test_value FuncParamAttr Zext
|
||||
OpDecorate %test_value LinkageAttributes "test_value" Export
|
||||
OpDecorate %add NoSignedWrap
|
||||
OpDecorate %true SpecId 101
|
||||
%uchar = OpTypeInt 8 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%uchar_0 = OpConstant %uchar 0
|
||||
%uchar_1 = OpConstant %uchar 1
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%bool = OpTypeBool
|
||||
%3 = OpTypeFunction %bool
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar
|
||||
%10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar
|
||||
%true = OpSpecConstantTrue %bool
|
||||
%test_value = OpFunction %bool None %3
|
||||
%entry = OpLabel
|
||||
OpReturnValue %true
|
||||
OpFunctionEnd
|
||||
%11 = OpFunction %void None %10
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
|
||||
%entry_0 = OpLabel
|
||||
%call = OpFunctionCall %bool %test_value
|
||||
%frombool = OpSelect %uchar %call %uchar_1 %uchar_0
|
||||
%tobool = OpINotEqual %bool %frombool %uchar_0
|
||||
OpBranchConditional %tobool %if_end %if_then
|
||||
%if_then = OpLabel
|
||||
%21 = OpLoad %uchar %output_value Aligned 1
|
||||
%conv = OpUConvert %uint %21
|
||||
%add = OpIAdd %uint %conv %uint_1
|
||||
%conv1 = OpUConvert %uchar %add
|
||||
OpStore %output_value %conv1 Aligned 1
|
||||
OpBranch %if_end
|
||||
%if_end = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,57 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 28
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int8
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %11 "spec_const_kernel"
|
||||
%27 = OpString "kernel_arg_type.spec_const_kernel.uchar*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %test_value "test_value"
|
||||
OpName %entry "entry"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry_0 "entry"
|
||||
OpName %if_then "if.then"
|
||||
OpName %if_end "if.end"
|
||||
OpDecorate %test_value FuncParamAttr Zext
|
||||
OpDecorate %test_value LinkageAttributes "test_value" Export
|
||||
OpDecorate %add NoSignedWrap
|
||||
OpDecorate %true SpecId 101
|
||||
%uchar = OpTypeInt 8 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%uchar_0 = OpConstant %uchar 0
|
||||
%uchar_1 = OpConstant %uchar 1
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%bool = OpTypeBool
|
||||
%3 = OpTypeFunction %bool
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar
|
||||
%10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar
|
||||
%true = OpSpecConstantTrue %bool
|
||||
%test_value = OpFunction %bool None %3
|
||||
%entry = OpLabel
|
||||
OpReturnValue %true
|
||||
OpFunctionEnd
|
||||
%11 = OpFunction %void None %10
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
|
||||
%entry_0 = OpLabel
|
||||
%call = OpFunctionCall %bool %test_value
|
||||
%frombool = OpSelect %uchar %call %uchar_1 %uchar_0
|
||||
%tobool = OpINotEqual %bool %frombool %uchar_0
|
||||
OpBranchConditional %tobool %if_end %if_then
|
||||
%if_then = OpLabel
|
||||
%21 = OpLoad %uchar %output_value Aligned 1
|
||||
%conv = OpUConvert %uint %21
|
||||
%add = OpIAdd %uint %conv %uint_1
|
||||
%conv1 = OpUConvert %uchar %add
|
||||
OpStore %output_value %conv1 Aligned 1
|
||||
OpBranch %if_end
|
||||
%if_end = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,39 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 20
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
OpCapability Int8
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%19 = OpString "kernel_arg_type.spec_const_kernel.uchar*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpName %add "add"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 1
|
||||
OpDecorate %add NoSignedWrap
|
||||
OpDecorate %uchar_0 SpecId 101
|
||||
%uchar = OpTypeInt 8 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%uchar_0 = OpSpecConstant %uchar 0
|
||||
%_ptr_UniformConstant_uchar = OpTypePointer UniformConstant %uchar
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_uchar UniformConstant %uchar_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %uchar %output_value Aligned 1
|
||||
%15 = OpLoad %uchar %spec_const_kernel_spec_constant_value Aligned 1
|
||||
%add = OpIAdd %uchar %12 %15
|
||||
OpStore %output_value %add Aligned 1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,39 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 20
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
OpCapability Int8
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%19 = OpString "kernel_arg_type.spec_const_kernel.uchar*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpName %add "add"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 1
|
||||
OpDecorate %add NoSignedWrap
|
||||
OpDecorate %uchar_0 SpecId 101
|
||||
%uchar = OpTypeInt 8 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%uchar_0 = OpSpecConstant %uchar 0
|
||||
%_ptr_UniformConstant_uchar = OpTypePointer UniformConstant %uchar
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_uchar UniformConstant %uchar_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %uchar %output_value Aligned 1
|
||||
%15 = OpLoad %uchar %spec_const_kernel_spec_constant_value Aligned 1
|
||||
%add = OpIAdd %uchar %12 %15
|
||||
OpStore %output_value %add Aligned 1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,35 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%15 = OpString "kernel_arg_type.spec_const_kernel.uint*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpName %add "add"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 4
|
||||
OpDecorate %uint_0 SpecId 101
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpSpecConstant %uint 0
|
||||
%_ptr_UniformConstant_uint = OpTypePointer UniformConstant %uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_uint UniformConstant %uint_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %uint %output_value Aligned 4
|
||||
%13 = OpLoad %uint %spec_const_kernel_spec_constant_value Aligned 4
|
||||
%add = OpIAdd %uint %12 %13
|
||||
OpStore %output_value %add Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,35 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%15 = OpString "kernel_arg_type.spec_const_kernel.uint*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpName %add "add"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 4
|
||||
OpDecorate %uint_0 SpecId 101
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpSpecConstant %uint 0
|
||||
%_ptr_UniformConstant_uint = OpTypePointer UniformConstant %uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_uint UniformConstant %uint_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %uint %output_value Aligned 4
|
||||
%13 = OpLoad %uint %spec_const_kernel_spec_constant_value Aligned 4
|
||||
%add = OpIAdd %uint %12 %13
|
||||
OpStore %output_value %add Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,36 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%15 = OpString "kernel_arg_type.spec_const_kernel.ulong*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpName %add "add"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 8
|
||||
OpDecorate %ulong_0 SpecId 101
|
||||
%ulong = OpTypeInt 64 0
|
||||
%ulong_0 = OpSpecConstant %ulong 0
|
||||
%_ptr_UniformConstant_ulong = OpTypePointer UniformConstant %ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_ulong UniformConstant %ulong_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_ulong
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %ulong %output_value Aligned 8
|
||||
%13 = OpLoad %ulong %spec_const_kernel_spec_constant_value Aligned 8
|
||||
%add = OpIAdd %ulong %12 %13
|
||||
OpStore %output_value %add Aligned 8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,36 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%15 = OpString "kernel_arg_type.spec_const_kernel.ulong*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpName %add "add"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 8
|
||||
OpDecorate %ulong_0 SpecId 101
|
||||
%ulong = OpTypeInt 64 0
|
||||
%ulong_0 = OpSpecConstant %ulong 0
|
||||
%_ptr_UniformConstant_ulong = OpTypePointer UniformConstant %ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_ulong UniformConstant %ulong_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_ulong
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %ulong %output_value Aligned 8
|
||||
%13 = OpLoad %ulong %spec_const_kernel_spec_constant_value Aligned 8
|
||||
%add = OpIAdd %ulong %12 %13
|
||||
OpStore %output_value %add Aligned 8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,38 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 20
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
OpCapability Int16
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%19 = OpString "kernel_arg_type.spec_const_kernel.ushort*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 2
|
||||
OpDecorate %add NoSignedWrap
|
||||
OpDecorate %ushort_0 SpecId 101
|
||||
%ushort = OpTypeInt 16 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%ushort_0 = OpSpecConstant %ushort 0
|
||||
%_ptr_UniformConstant_ushort = OpTypePointer UniformConstant %ushort
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_ushort UniformConstant %ushort_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %ushort %output_value Aligned 2
|
||||
%15 = OpLoad %ushort %spec_const_kernel_spec_constant_value Aligned 2
|
||||
%add = OpIAdd %ushort %12 %15
|
||||
OpStore %output_value %add Aligned 2
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,38 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 20
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Kernel
|
||||
OpCapability Int16
|
||||
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %9 "spec_const_kernel"
|
||||
%19 = OpString "kernel_arg_type.spec_const_kernel.ushort*,"
|
||||
OpSource OpenCL_C 102000
|
||||
OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value"
|
||||
OpName %output_value "output_value"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Constant
|
||||
OpDecorate %spec_const_kernel_spec_constant_value Alignment 2
|
||||
OpDecorate %add NoSignedWrap
|
||||
OpDecorate %ushort_0 SpecId 101
|
||||
%ushort = OpTypeInt 16 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%ushort_0 = OpSpecConstant %ushort 0
|
||||
%_ptr_UniformConstant_ushort = OpTypePointer UniformConstant %ushort
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort
|
||||
%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_ushort UniformConstant %ushort_0
|
||||
%9 = OpFunction %void None %8
|
||||
%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
|
||||
%entry = OpLabel
|
||||
%12 = OpLoad %ushort %output_value Aligned 2
|
||||
%15 = OpLoad %ushort %spec_const_kernel_spec_constant_value Aligned 2
|
||||
%add = OpIAdd %ushort %12 %15
|
||||
OpStore %output_value %add Aligned 2
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
Reference in New Issue
Block a user