I have a smartphone with a mali G710 gpu, which supports opencl 3.0.
There is a x86_64 machine with ubuntu 16.04, where my opencl kernel was compiled and converted to a
.spv file following G.2 Intermediate language programs in Arm Mali GPU OpenCL Developer Guide(Version 4.11).
.spv kernel file was copyed to the smartphone and used in
clCreateProgramWithIL() failed with error code–
CL_INVALID_VALUE. The SPIR-V in .spv was loaded with
fread() and I validated that the il passed to
clCreateProgramWithIL() was not
NULL and its length was not zero.
According to The OpenCL Specification 3.0,
CL_INVALID_VALUE means that the length-byte memory pointed to by il does not contain well-formed intermediate language input that can be consumed by the OpenCL runtime.
Does anyone has any idea about this error?
The command for compiling opencl kernel is as following:
~/clang+llvm-15.0.2-x86_64-unknown-linux-gnu/bin/clang -Xclang -finclude-default-header --target=spirv64-unknown-unknown -emit-llvm -D SPIR -c -o0 -o test.bc test.cl ~/llvm-project/build/bin/llvm-spirv test.bc -o test.spv