if (err != CL_SUCCESS)
{
fprintf(stderr, "GPU fatal error: clBuildProgram() failed.\n");
-
size_t log_size;
clGetProgramBuildInfo(program, GPU_device_id, CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size);
-
- // Allocate memory for the log
- char *log = (char *) malloc(log_size);
-
- // Get the log
+ char* log = malloc(log_size);
clGetProgramBuildInfo(program, GPU_device_id, CL_PROGRAM_BUILD_LOG, log_size, log, NULL);
-
printf("%s", log);
-
-
-
+ free(log);
exit(1);
}
#ifdef GPU_DEBUG
-__kernel gpu_mmul(__global float* ptrR, __global float* ptrA, __global float* ptrB, const int N, const int W)
+__kernel void gpu_mmul(__global float* ptrR, __global float* ptrA, __global float* ptrB, const int N, const int W)
{
int row = get_global_id(0);
int col = get_global_id(1);