You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explicit generic casts allows user to check whether a particular generic
pointer is pointing either to global, local or private address space.
They are represented in OpenCL C as `to_global`, `to_local` or `to_private`
functions. Specification: https://man.opencl.org/addressSpaceQualifierFuncs.html
For example: `to_private` returns a pointer that points to a region in
the private address space if to_private can cast ptr to the private
address space. Otherwise it returns NULL.
These builtins are handled incorrectly if IGC decides to allocate private
memory in a global buffer (private memory is allocated in a global buffer
to minimize negative performance implications caused by dynamic generic
address space resolution), since in such case, there is no possibility
to distinguish between private and global pointer.
This change introduces the following logic:
1. Detect usage of explicit generic casts in a kernel.
2. If the casts are present:
a) Force tagging private pointers - to distinguish from global pointers
b) Clear tag for addrspacecasts from global to generic - since private
accesses may be statically resolved to global accesses when casting
back to named addresspace, generic pointer casted to global address
space may actually be a private pointer for which a tag has been set
in step a).
0 commit comments