I need to run a gpu hungry function in a loop. I speculate that rust tends to cache the for loop instead of calling the function step by step for each i. By caching, it will use up all the device's gpu memory and crash the the program.
My question is how to force rust to run the program step by step
for i in 0..100 {
let a = gpu_hungry_function(x, y, z);
...
}
I need to run a gpu hungry function in a loop. I speculate that rust tends to cache the for loop instead of calling the function step by step for each i
what do you mean here? I'm honestly not sure what you're talking about.
Plus, if it's a speculation, did you actually test to see if it will crash?