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
Currently we error out (saying that var intents aren't supported for foreach) if you attempt something like this:
foreach i in 1..100 with (var x = new MyThing()) { }
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).
The text was updated successfully, but these errors were encountered:
stonea
changed the title
Support 'var' intent on gpuizable loop
Support 'var' intent on gpuizables loop
Sep 20, 2024
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).The text was updated successfully, but these errors were encountered: