From 7d646a9c7123726b098eaa6866234b4fdbca329b Mon Sep 17 00:00:00 2001 From: miha-q <> Date: Sat, 2 Mar 2024 22:06:01 -0500 Subject: [PATCH] Sat Mar 2 10:06:01 PM EST 2024 --- src/gpu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gpu.c b/src/gpu.c index dad650a..7e785f9 100644 --- a/src/gpu.c +++ b/src/gpu.c @@ -127,7 +127,10 @@ void GPU_mmul(double* ptrR, double* ptrA, double* ptrB, size_t rowsA, size_t col #endif printf("------------------------------\n%s\n------------------------------\n", src_gpu_mmul_cl); - cl_program program = clCreateProgramWithSource(GPU_context, 1, (const char**)&src_gpu_mmul_cl, NULL, &err); + char* tmp = malloc(src_gpu_mmul_cl_len); + memcpy(tmp, src_gpu_mmul_cl, src_gpu_mmul_cl_len); + + cl_program program = clCreateProgramWithSource(GPU_context, 1, (const char**)&tmp, NULL, &err); if (err != CL_SUCCESS) { fprintf(stderr, "GPU fatal error: clCreateProgramWithSource() failed.\n"); -- 2.39.5