We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
Thanks for your very helpful examples. I have encountered a problem trying to use the pre built binary.
I successfully create my binary since I get the message PLATFORM [Apple] --> SUCCESS (1).
PLATFORM [Apple] --> SUCCESS (1)
But, when trying to use the binary, the function clBuildProgram, gives the error code CL_BUILD_PROGRAM_FAILURE. ¿Any advice?
clBuildProgram
CL_BUILD_PROGRAM_FAILURE
I'm using this code:
int length = int_par[1]; cl_int err; // Query platforms and devices cl_platform_id platform; err = clGetPlatformIDs(1, &platform, NULL); cl_device_id device; err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 1, &device, NULL); const cl_context_properties prop[] = { CL_CONTEXT_PLATFORM, (cl_context_properties)platform, 0 }; // Create context cl_context context = clCreateContext(prop, 1, &device, NULL, NULL, &err); // Create program unsigned char* program_file = NULL; size_t program_size = 0; read_file1(&program_file, &program_size, "Kernel.clbin"); cl_program program = clCreateProgramWithBinary(context, 1, &device, &program_size, (const unsigned char **)&program_file, NULL, &err); if(err!=CL_SUCCESS) Rprintf("clCreateProgramWithBinary!!!!\n%s\n", err_code(err)); err = clBuildProgram(program, 1, &device, NULL, NULL, NULL); free(program_file); if (err != CL_SUCCESS) { size_t len; //char buffer[2048*3000]; Rprintf("Error: Failed to build program executable!\n%s\n", err_code(err)); clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, 0, NULL, &len); //char *buffer = (char *) malloc(len); //char *buffer = (char*)calloc(len, sizeof(char)); char *buffer =calloc(len,sizeof(char)); //memset(buffer, 0, len); clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, len, buffer, NULL); SEP; Rprintf("Build Log:\n%s\n", buffer); SEP; clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_STATUS, sizeof(char), buffer, &len); Rprintf("Build Status:\n%s\n", buffer); SEP; clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_OPTIONS, sizeof(char), buffer, &len); Rprintf("Build Options:\n%s\n", buffer); SEP; //return EXIT_FAILURE; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
Thanks for your very helpful examples. I have encountered a problem trying to use the pre built binary.
I successfully create my binary since I get the message
PLATFORM [Apple] --> SUCCESS (1)
.But, when trying to use the binary, the function
clBuildProgram
, gives the error codeCL_BUILD_PROGRAM_FAILURE
. ¿Any advice?I'm using this code:
The text was updated successfully, but these errors were encountered: