more consistent way to disable fast math for Intel OpenCL with double precision

This commit is contained in:
Axel Kohlmeyer
2023-03-05 07:18:12 -05:00
parent 2aff321187
commit 646ef15d83
2 changed files with 3 additions and 4 deletions

View File

@ -391,10 +391,9 @@ int DeviceT::set_ocl_params(std::string s_config, const std::string &extra_args)
#endif
// workaround for double precision with Intel OpenCL
#ifdef _DOUBLE_DOUBLE
if ((params[4] != "0") && (params[0] != "500")) _ocl_compile_string+="-cl-fast-relaxed-math ";
#else
if (params[4] != "0") _ocl_compile_string+="-cl-fast-relaxed-math ";
if (params[0] == "500") params[4] = "0";
#endif
if (params[4] != "0") _ocl_compile_string+="-cl-fast-relaxed-math ";
_ocl_compile_string+=std::string(OCL_INT_TYPE)+" "+
std::string(OCL_PRECISION_COMPILE);
if (gpu->has_subgroup_support())