linuxdeploy
linuxdeploy copied to clipboard
How to use OpenCL
I have a phone, nubia z11, which has an Adreno 530 GPU. I installed Ubuntu 18 on the phone by LinuxDeploy. Now, I want to use the GPU in Ubuntu. For compiling the source code, I copy the libOpenCL.so from android to Ubuntu. But aftering running the program, I got an error, -1001.
I want to know if there is a way to use OpenCL in Ubuntu?
Test program:
#include <stdio.h>
#include <stdlib.h>
#include <CL/cl.h>
#include <CL/opencl.h>
int main()
{
cl_int status=0;
size_t deviceListSize;
cl_uint numPlatforms;
cl_platform_id platfomr=NULL;
status=clGetPlatformIDs(0,NULL,&numPlatforms);
printf("status=%d\n",status);
return 0;
}
The result is:
status=-1001
The result of clinfo command:
Number of platforms 0
did you solved this problem?i also want to use adreno gpu to hardware accelerate