Do While don't work inside CUDA Kernel
问题 Ok, I'm pretty new into CUDA, and I'm kind of lost, really lost. I'm trying to calculate pi using the Monte Carlo Method, and at the end I just get one add instead of 50. I don't want to "do while" for calling the kernel, since it's too slow. My issue is, that my code don't loop, it executes only once in the kernel. And also, I'd like that all the threads access the same niter and pi, so when some thread hit the counters all the others would stop. #define SEED 35791246 __shared__ int niter; _