From a1657d02330f37ba26c849e1d55ec559dd08f88f Mon Sep 17 00:00:00 2001 From: 0cc4m Date: Fri, 19 May 2023 21:18:57 +0200 Subject: [PATCH] Add OpenCL compile options --- ggml-opencl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ggml-opencl.cpp b/ggml-opencl.cpp index 5727ea791..753117f1d 100644 --- a/ggml-opencl.cpp +++ b/ggml-opencl.cpp @@ -289,7 +289,9 @@ static cl_program build_program_from_source(cl_context ctx, cl_device_id dev, co exit(1); } - err = clBuildProgram(p, 0, NULL, NULL, NULL, NULL); + const char* compile_opts = "-cl-mad-enable -cl-unsafe-math-optimizations -cl-finite-math-only -cl-fast-relaxed-math"; + + err = clBuildProgram(p, 0, NULL, compile_opts, NULL, NULL); if(err < 0) { clGetProgramBuildInfo(p, dev, CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size);