]> foleosoft.com Git - QAnsel.git/commitdiff
Sat Mar 2 10:11:48 PM EST 2024
authormiha-q <>
Sun, 3 Mar 2024 03:11:48 +0000 (22:11 -0500)
committermiha-q <>
Sun, 3 Mar 2024 03:11:48 +0000 (22:11 -0500)
src/gpu.c
src/gpu_mmul.cl

index 04bc08672b78b8de1053cb50d88826f44f952a9e..d44c7492de224496548d1c0a9fba00002ad7e95a 100644 (file)
--- a/src/gpu.c
+++ b/src/gpu.c
@@ -143,20 +143,12 @@ void GPU_mmul(double* ptrR, double* ptrA, double* ptrB, size_t rowsA, size_t col
        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
index 1e53db116c2631381dc1050fb9210c395e768614..5f649a241302222ce686b1dacf1a41fd75ed0427 100644 (file)
@@ -1,4 +1,4 @@
-__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);