OpenCL error: undefined reference to `_Z12atom_cmpxchgPVU8CLglobalmmm()'

ぃ、小莉子 提交于 2019-12-24 14:05:39

问题


When compiling the following OpenCL kernel:

#pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable

__kernel void kernel(__global ulong* mem) {
    atom_cmpxchg(&mem[0], 0, 1);
}

I get the following error:

error: undefined reference to `_Z12atom_cmpxchgPVU8CLglobalmmm()'

I'm using OpenCL from Rust with the OCL library. My OpenCL version is 1.2, my GPU is an Intel(R) Iris(TM) Graphics 550, I'm under macOS Sierra 10.12.1.


回答1:


Check the CL_DEVICE_EXTENSIONS of your device with clGetDeviceInfo(). cl_khr_int64_base_atomics may not be supported with this GPU under macOS.



来源:https://stackoverflow.com/questions/50608802/opencl-error-undefined-reference-to-z12atom-cmpxchgpvu8clglobalmmm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!