llvm-project
b8a5888d - [libclc] Fix memory fence scope mapping for OpenCL (#170542)

Commit
149 days ago
[libclc] Fix memory fence scope mapping for OpenCL (#170542) The function `__opencl_get_memory_scope` incorrectly assumed that the Clang built-in `__MEMORY_SCOPE_*` macros defined as bitmasks, while they are actually defined as distinct integer values. This led to incorrect mapping of OpenCL memory fence flags to LLVM memory scopes, causing issues in generated code. The fix involves updating the `__opencl_get_memory_scope` function to return the correct `__MEMORY_SCOPE_*` values based on the provided `cl_mem_fence_flags`. Additionally, the `__opencl_get_memory_semantics` and the `__opencl_get_memory_scope` functions are marked as `static` to avoid potential multiple definition issues during linking.
Author
Parents
Loading