@@ -237,29 +237,44 @@ std::string EffectiveOptionsFilter::processOptions(const OpenCLArgList &args,
237
237
238
238
for (auto it = effectiveArgs.begin (), end = effectiveArgs.end (); it != end;
239
239
++it) {
240
- if (it->compare (" -Dcl_khr_fp64" ) == 0 )
240
+ if (it->compare (" -Dcl_khr_fp64" ) == 0 || it-> compare ( " -D cl_khr_fp64=1 " ) == 0 )
241
241
fp64Enabled = true ;
242
+ else if (it->compare (" -U cl_khr_fp64" ) == 0 )
243
+ fp64Enabled = false ;
244
+ // Find last position that enables or disables cl_khr_fp64
245
+ else if (it->find (" cl_khr_fp64" ) != std::string::npos) {
246
+ auto NegFp64 = it->rfind (" -cl_khr_fp64" );
247
+ auto PosFp64 = it->rfind (" +cl_khr_fp64" );
248
+ if (NegFp64 != std::string::npos && PosFp64 != std::string::npos)
249
+ fp64Enabled = PosFp64 > NegFp64;
250
+ else if (NegFp64 != std::string::npos)
251
+ fp64Enabled = false ;
252
+ else
253
+ fp64Enabled = true ;
254
+ }
242
255
}
243
256
244
257
std::map<std::string, bool > extMap{
245
258
{" cl_khr_3d_image_writes" , true },
246
259
{" cl_khr_depth_images" , true },
260
+ #ifdef GPU_EXT
247
261
{" cl_khr_fp16" , true },
262
+ {" cl_khr_mipmap_image" , true },
263
+ {" cl_khr_mipmap_image_writes" , true },
264
+ {" cl_khr_subgroups" , true },
265
+ {" cl_intel_device_side_avc_motion_estimation" , true },
266
+ {" cl_intel_planar_yuv" , true },
248
267
#ifdef _WIN32
249
268
// cl_khr_gl_msaa_sharing is only supported on Windows [NEO].
250
269
{" cl_khr_gl_msaa_sharing" , true },
270
+ #endif
251
271
#endif
252
272
{" cl_khr_global_int32_base_atomics" , true },
253
273
{" cl_khr_global_int32_extended_atomics" , true },
254
274
{" cl_khr_int64_base_atomics" , true },
255
275
{" cl_khr_int64_extended_atomics" , true },
256
276
{" cl_khr_local_int32_base_atomics" , true },
257
277
{" cl_khr_local_int32_extended_atomics" , true },
258
- {" cl_khr_mipmap_image" , true },
259
- {" cl_khr_mipmap_image_writes" , true },
260
- {" cl_khr_subgroups" , true },
261
- {" cl_intel_device_side_avc_motion_estimation" , true },
262
- {" cl_intel_planar_yuv" , true },
263
278
{" cl_intel_subgroups" , true },
264
279
{" cl_intel_subgroups_short" , true }};
265
280
0 commit comments