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