Open karolherbst opened 10 months ago
@MrSidims @LU-JOHN FYI.
Reproduced issue with:
#include <sycl/sycl.hpp>
using namespace sycl;
class Test;
void do_test() {
queue q;
bool arg=false;
uint8_t *Output = (uint8_t *)malloc_shared(sizeof(uint8_t), q.get_device(),
q.get_context());
q.submit([=](handler &cgh) {
cgh.single_task<Test>([=]() {
if (arg) Output[0]=75;
});
});
q.wait();
}
SPIR-V kernel with TypeBool parm seen when compiling with:
clang++ -fsycl bool_parm.cpp -fsycl-device-only
llvm-spirv bool_parm-sycl-spir64-unknown-unknown.bc
llvm-spirv -to-text bool_parm-sycl-spir64-unknown-unknown.spv
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.The OpenCL SPIR-V env specification states:
The problem with using
OpTypeBool
orbool
in OpenCL C is, that its size is not defined by the OpenCL specification and hence calls toclSetKernelArg
on arguments with aOpTypeBool
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):