imx8 openCL clBuildProgram error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

imx8 openCL clBuildProgram error

跳至解决方案
2,139 次查看
1019599657
Contributor III

Hi , i use opencl at imx8 , i meet a error . when it run to the status=clBuildProgram(pgram,1,device,option,NULL,NULL), it will return error:CL_BUILD_PROGRAM_FAILURE . I use clGetProgramBuildInfo to get error, i can get this error:

Build Log : error : Failed to open the temporary file /data/vendor/.opencl-cache/cl-640601. for writing.

How i can solve this error?5.png

0 项奖励
回复
1 解答
2,013 次查看
1019599657
Contributor III

Hi , i do clGetProgramBuildInfo to get  the error information ,log is:Failed to open the temporary file "/data/vendor/.opencl-cache/cl-xxx" for writing.

My kernel is only:

#define KERNEL_SRC "\n" \
    "__kernel void hello_kernel(__global const float *a,__global const float *b, __global float *result) \n "\
    "{                                                                                                   \n "\
    "   int gid = get_global_id(0);                                                                      \n "\
    "   result[gid] = a[gid] + b[gid];                                                                    \n"\
    " } "
 

I also do it on xiaomi6x, and i can run process. 

在原帖中查看解决方案

0 项奖励
回复
3 回复数
2,013 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello Li,

This error is typically caused by a syntax error in your kernel code. You can call the OpenCL function clGetProgramBuildInfo with the flag CL_PROGRAM_BUILD_LOG to access the log generated by the compiler. This log contains the output you are probably used to when compiling on the command-line (errors, warnings, etc.).

Regards

0 项奖励
回复
2,013 次查看
1019599657
Contributor III

Hi, i do "clGetProgramBuildInfo" to get error log,

the log is: error : Failed to open the temporary file /data/vendor/.opencl-cache/cl-612501. for writing,

statues is CL_BUILD_PROGRAM_FAILURE.

My kernel code is below. And i alse run it on xiaomi phone . I can run it success. How i can solve it ?

#define KERNEL_SRC "\n" \
    "__kernel void hello_kernel(__global const float *a,__global const float *b, __global float *result) \n "\
    "{                                                                                                   \n "\
    "   int gid = get_global_id(0);                                                                      \n "\
    "   result[gid] = a[gid] + b[gid];                                                                    \n"\
    " } "


0 项奖励
回复
2,014 次查看
1019599657
Contributor III

Hi , i do clGetProgramBuildInfo to get  the error information ,log is:Failed to open the temporary file "/data/vendor/.opencl-cache/cl-xxx" for writing.

My kernel is only:

#define KERNEL_SRC "\n" \
    "__kernel void hello_kernel(__global const float *a,__global const float *b, __global float *result) \n "\
    "{                                                                                                   \n "\
    "   int gid = get_global_id(0);                                                                      \n "\
    "   result[gid] = a[gid] + b[gid];                                                                    \n"\
    " } "
 

I also do it on xiaomi6x, and i can run process. 

0 项奖励
回复