From b70209efc0af317971f5d18fd92fd3e16bdaf363 Mon Sep 17 00:00:00 2001 From: miha-q <> Date: Sun, 3 Mar 2024 02:13:43 -0500 Subject: [PATCH] Sun Mar 3 02:13:43 AM EST 2024 --- src/gpu/gpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gpu/gpu.c b/src/gpu/gpu.c index 2bba1ce..3ad6551 100644 --- a/src/gpu/gpu.c +++ b/src/gpu/gpu.c @@ -110,18 +110,18 @@ void GPU_mmul(float* ptrR, float* ptrA, float* ptrB, size_t rowsA, size_t colsB, if (GPU_mmul_cache == NULL) { //Load and compile program - char tmp[src_gpu_mmul_cl_len]; + char tmp = malloc(src_gpu_mmul_cl_len); memcpy(tmp, src_gpu_mmul_cl, src_gpu_mmul_cl_len); const char* ptr = (const char*)src_gpu_mmul_cl; program = clCreateProgramWithSource(GPU_context, 1, (const char**)&tmp, NULL, &err); if (err != CL_SUCCESS) { - //free(tmp); + free(tmp); fprintf(stderr, "GPU fatal error: clCreateProgramWithSource() failed.\n"); exit(1); } err = clBuildProgram(program, 1, &GPU_device_id, NULL, NULL, NULL); - //free(tmp); + free(tmp); if (err != CL_SUCCESS) { fprintf(stderr, "GPU fatal error: clBuildProgram() failed.\n"); -- 2.39.5