According to CUDA programming guide (v7.5):
E.2.9.4: Within the body of a device or global function, only shared variables may be declared with static storage class.
Differential D20034
[CUDA] Only __shared__ variables can be static local on device side. tra on May 6 2016, 2:26 PM. Authored by
Details According to CUDA programming guide (v7.5):
Diff Detail Event TimelineComment Actions What are we supposed to do if we encounter a static shared variable in an HD function? Presumably that also should be an error if we invoke the HD function from the device? Comment Actions nvcc produces an error only of such HD function is used from a host function: error: a function scope variable cannot be declared with "shared" inside a host function Considering that each block gets its own instance of that shared variable, there's no way to access it from host in principle so the error makes sense. I'll add it in a separate patch. Comment Actions This patch regresses Eigen, because it raises an error even on host+device functions. |