我目前正在将OpenCL
的实现与JNI
接口绑定到我的android应用程序。
加载内核时
__kernel void someFunction( __global double* out,
我收到此错误:
error: use of type 'double' requires cl_khr_fp64 extension to be enabled
__global double* weight_coef,
我试图用float代替它,但是可以,但是我想避免这种情况!
最佳答案
您需要启用“ cl_khr_fp64”扩展名。
为此,您需要做
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
在内核代码中初始化任何双精度数据类型之前。
有关更多信息,请随时参考Khronos OpenCL规范:
https://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/cl_khr_fp64.html