From 1053a939a333460334639554560e23bc91204372 Mon Sep 17 00:00:00 2001 From: miha-q <> Date: Sat, 2 Mar 2024 22:11:48 -0500 Subject: [PATCH] Sat Mar 2 10:11:48 PM EST 2024 --- src/gpu.c | 12 ++---------- src/gpu_mmul.cl | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/gpu.c b/src/gpu.c index 04bc086..d44c749 100644 --- 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 diff --git a/src/gpu_mmul.cl b/src/gpu_mmul.cl index 1e53db1..5f649a2 100644 --- a/src/gpu_mmul.cl +++ b/src/gpu_mmul.cl @@ -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); -- 2.39.5