Hi.
Now, I’m trying to hook OpenCLAPI of PGCL.
I chose how to call from libOpenCL.so wrapped to alias original libOpenCL.so.
However, when I run the PGCL sample’s NDKOclImageInverse, the program return an error (CL_INVALID_BINARY) in clCreateWithBinary().
I think the problem is not in the binary when I use the original OpenCLAPI Since program can be performed by the same binary.
When I use the original PGCL Library, similar errors occured when not calling setDriverDirectory() and setTmpDirPath() in OpenCLActivitiy class in PGCL sample’s JavaLibOpenCL project.
If there is a function that needs to be called or a variable that needs to be rewritten, please let me know.
Also, might be the cause of something else, please let me know if come up with. For example, the configuration of make.
I do not know the cause, I need your help.
Thank you for your attention.
My system and code are as follows:
/* Envirionment */
Target Device : Xperia P
My system’s description of “/proc/cpuinfo” is as follows:
Processor : ARMv7 Processor rev 1 (v7l)
processor : 0
BogoMIPS : 4.80
processor : 1
BogoMIPS : 4.80
Features : swp half thumb fastmult vfp edsp neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc09
CPU revision : 1
Hardware : riogrande
Revision : 0000
Serial : 0000000000000000
/* my code */
//---call dlopen,dlsym------
dl_handle = dlopen("[app_path]/lib/libOpenCLo.so", RTLD_NOW);
if(!dl_handle)
{
//error
}
LOGD("NDK:LC: [%s]", "Load:libOpenCLo.so");
dlerror();
p_clCreateContextFromType = (func_clCreateContextFromType)dlsym(dl_handle, "clCreateContextFromType");
LOGD("NDK:LC: [%s]", dlerror()); // no error
//---call function------
cl_program clCreateProgramWithBinary(
cl_context context,
cl_uint num_devices,
const cl_device_id *device_list,
const size_t *lengths,
const unsigned char **binaries,
cl_int *binary_status,
cl_int *errcode_ret)
{
cl_program ret = p_clCreateProgramWithBinary(
context,
num_devices,
device_list,
lengths,
binaries,
binary_status,
errcode_ret
);
return ret;
}