I'm sometimes getting the following error during the linking stage when building a kernel.
A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 17393 (.fhe.benchmarks), pid 17393 (.fhe.benchmarks)
The error appears when compiling and linking the following kernel code, which is the shortest failing example I've been able to produce so far.
struct U { uint high; uint mid; uint low; }; struct V { uint high; uint low; }; struct V bar(struct U y) { struct V res; res.low = y.low; res.high = y.mid; return res; } uint foo(struct U y) { struct U q; q.high = 1; q.mid = 2; q.low = 3; // If I use the following lines to set r1 instead of // calling bar, then the kernel links without error. //struct V r1; //r1.low = y.low; //r1.high = y.mid; struct V r1 = bar(y); struct V r2 = bar(q); return r1.low - r2.low; } __kernel void Broken(__global uint *out) { struct U A; A.high = 0; A.mid = 0; A.low = 1; // If I remove one of the calls to foo then the kernel links successfully out[get_global_id(0)] = foo(A) + foo(A); }
The device I am using is an LG G7 ThinQ, and I am using /system/vendor/lib64/libOpenCL.so. If anyone has any insight into this issue it would be greatly appreciated. I am relatively new to programming on Android and with OpenCL, so it may be possible that I am doing something wrong that is causing or contributing to this.
I've included some of the OpenCL properties of my device below:
CL_PLATFORM_PROFILE: FULL_PROFILE CL_PLATFORM_VERSION: OpenCL 2.0 QUALCOMM build: commit #d424b94 changeid #If195280fd4 Date: 12/24/19 Tue Local Branch: Remote Branch: quic/gfx-adreno.lnx.1.0.r72-rel CL_PLATFORM_NAME: Snapdragon(TM) CL_PLATFORM_VENDOR: QUALCOMM CL_PLATFORM_EXTENSIONS: CL_DEVICE_TYPE: CL_DEVICE_TYPE_GPU CL_DEVICE_TYPE_ALL CL_DEVICE_VENDOR_ID: 3209509963 CL_DEVICE_AVAILABLE: 1 CL_DEVICE_COMPILER_AVAILABLE: 1 CL_DEVICE_LINKER_AVAILABLE: 1 CL_DEVICE_EXECUTION_CAPABILITIES: CL_EXEC_KERNEL CL_DEVICE_QUEUE_PROPERTIES: CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE CL_QUEUE_PROFILING_ENABLE CL_DEVICE_NAME: QUALCOMM Adreno(TM) CL_DEVICE_VENDOR: QUALCOMM CL_DRIVER_VERSION: OpenCL 2.0 QUALCOMM build: commit #d424b94 changeid #If195280fd4 Date: 12/24/19 Tue Local Branch: Remote Branch: quic/gfx-adreno.lnx.1.0.r72-rel Compiler E031.37.03.00 CL_DEVICE_PROFILE: FULL_PROFILE CL_DEVICE_VERSION: OpenCL 2.0 Adreno(TM) 630 CL_DEVICE_OPENCL_C_VERSION: OpenCL C 2.0 Adreno(TM) 630