Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Headers/opencl-c-base.h
Show First 20 Lines • Show All 327 Lines • ▼ Show 20 Lines | typedef enum memory_scope { | ||||
memory_scope_work_group = __OPENCL_MEMORY_SCOPE_WORK_GROUP, | memory_scope_work_group = __OPENCL_MEMORY_SCOPE_WORK_GROUP, | ||||
memory_scope_device = __OPENCL_MEMORY_SCOPE_DEVICE, | memory_scope_device = __OPENCL_MEMORY_SCOPE_DEVICE, | ||||
#if defined(__opencl_c_atomic_scope_all_devices) | #if defined(__opencl_c_atomic_scope_all_devices) | ||||
memory_scope_all_svm_devices = __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES, | memory_scope_all_svm_devices = __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES, | ||||
#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0) | #if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0) | ||||
memory_scope_all_devices = memory_scope_all_svm_devices, | memory_scope_all_devices = memory_scope_all_svm_devices, | ||||
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_3_0 | #endif // __OPENCL_C_VERSION__ >= CL_VERSION_3_0 | ||||
#endif // defined(__opencl_c_atomic_scope_all_devices) | #endif // defined(__opencl_c_atomic_scope_all_devices) | ||||
#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups) | /** | ||||
* Subgroups have different requirements on forward progress, so just test | |||||
* all the relevant macros. | |||||
* CL 3.0 sub-groups "they are not guaranteed to make independent forward progress" | |||||
* KHR subgroups "Subgroups within a workgroup are independent, make forward progress with respect to each other" | |||||
*/ | |||||
#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups) || defined(__opencl_c_subgroups) | |||||
Anastasia: We had a discussion with @azabaznov around features that are aliasing each other and we have… | |||||
Not Done ReplyInline ActionsYeah, I we did. Note that this is applicable to fp64 and 3d image writes, while __openc_c_subgroups and cl_khr_subgroups are not equivalent as extension requires subgroup-independent forward progress but subgroup-independent forward progress is optional in OpenCL C 3.0. I'll try submit a patch for 3d image writes feature macro support this week. azabaznov: Yeah, I we did. Note that this is applicable to fp64 and 3d image writes, while… | |||||
Not Done ReplyInline ActionsOk, I see so while the functions are identical they are not entirely equivalent extensions so vendors might support one but not the other? In this case I think we should keep checking both but it would be good to add a comment explaining why we are checking both macros here. Btw do you happen to have spec reference? I can't find anything relevant. Anastasia: Ok, I see so while the functions are identical they are not entirely equivalent extensions so… | |||||
memory_scope_sub_group = __OPENCL_MEMORY_SCOPE_SUB_GROUP | memory_scope_sub_group = __OPENCL_MEMORY_SCOPE_SUB_GROUP | ||||
#endif | #endif | ||||
} memory_scope; | } memory_scope; | ||||
/** | /** | ||||
* Queue a memory fence to ensure correct ordering of memory | * Queue a memory fence to ensure correct ordering of memory | ||||
* operations between work-items of a work-group to | * operations between work-items of a work-group to | ||||
* image memory. | * image memory. | ||||
▲ Show 20 Lines • Show All 406 Lines • Show Last 20 Lines |
We had a discussion with @azabaznov around features that are aliasing each other and we have discussed to use one feature macro for those. Clang should already ensure that both are set/unset simultaneously? And for those that are not set in clang we can set them correctly here in the header directly.