-
Notifications
You must be signed in to change notification settings - Fork 798
Description
Describe the bug
With some SyCL-CTS tests I'm seeing SPIR-V declaring OpTypeBool
as Kernel function parameters, e.g. test_spec_constants
. It might not be the best test to dig into this problem as it executes a lot of spirvs.
OpEntryPoint Kernel %1337 "_ZTSN33specialization_constants_external6kernelIbLi1EEE" %__spirv_BuiltInWorkgroupId %__spirv_BuiltInGlobalLinearId %__spirv_BuiltInWorkgroupSize
...
%bool = OpTypeBool
...
%218 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_Function_class_sycl___V1__id %bool
...
%1337 = OpFunction %void None %218
...
%_arg_ref_43 = OpFunctionParameter %bool
The OpenCL SPIR-V env specification states:
An OpFunctionParameter for an OpFunction that is identified with OpEntryPoint defines an OpenCL kernel argument. Allowed types for OpenCL kernel arguments are:
- OpTypeInt
- OpTypeFloat
- OpTypeStruct
- OpTypeVector
- OpTypePointer
- OpTypeSampler
- OpTypeImage
- OpTypePipe
- OpTypeQueue
The problem with using OpTypeBool
or bool
in OpenCL C is, that its size is not defined by the OpenCL specification and hence calls to clSetKernelArg
on arguments with a OpTypeBool
parameter is undefined.
I suspect that just using OpTypeInt 8 0
might be a good alternative here.
To Reproduce
Run SyCL-CTS test_spec_constants
Environment (please complete the following information):
- OS: Linux
- DPC++ version: clang version 18.0.0 (https://github.com/intel/llvm 3bd7441)