From 78b1d8351f64e421e93a139f5ed2288f24ee46c6 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 604019c3e..ff72de5a8 100644 --- a/ggml-opencl.cpp +++ b/ggml-opencl.cpp @@ -287,7 +287,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);