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
CUDA allows using empty initializers, but when we actually have one, it goes through the regular codegen and ens up being guarded by __cxa_guard_* calls, if the empty initializer is not eliminated by the optimizations.
When initializer is not empty, clang does allow for static local variables (and that does need a guard), but NVCC rejects it, presumably because it would require guarding it.
I think we need to
a) make sure we do not emit thread guards for the static initializers
b) disallow non-empty initializers for static local variables (that would include local __shared__ variables that are implicitly static).
The text was updated successfully, but these errors were encountered:
We do not have support for the threadsafe statics on the GPU side.
However, we do sometimes end up with empty local static initializers,
and those happen to trigger calls to `__cxa_guard*`, which breaks
compilation.
Partially addresses #117023
Dynamic initializers are not allowed on the GPU.
CUDA allows using empty initializers, but when we actually have one, it goes through the regular codegen and ens up being guarded by
__cxa_guard_*
calls, if the empty initializer is not eliminated by the optimizations.E.g. https://godbolt.org/z/P67j7M81c
This also exposes inconsistent behavior vs nvcc.
When initializer is not empty, clang does allow for static local variables (and that does need a guard), but NVCC rejects it, presumably because it would require guarding it.
I think we need to
a) make sure we do not emit thread guards for the static initializers
b) disallow non-empty initializers for static local variables (that would include local
__shared__
variables that are implicitly static).The text was updated successfully, but these errors were encountered: