Open stonea opened 1 month ago
I bumped into a case where I needed this. In my case, I am using curand
to have a per-thread RNG for a Monte Carlo simulation. I realized that the RNG initialization was my bottleneck. So, I wanted to use gpu.itersPerThread
combined with a thread-private RNG.
In this particular case, doing it manually was relatively easy and non-heroic. Therefore, this is not a blocker for me, but with itersPerThread
, it would certainly be a valuable addition.
Currently we error out (saying that
var
intents aren't supported forforeach
) if you attempt something like this:But this might be a useful way of making a thread-private variable for a gpuizable loop (which might be useful in cases where
@gpu.itersPerThread
is not 1).