3 ms·
It's not signaled / warned about by default. However, if you want to make sure your `foreach` loop runs on the GPU, you can use the `@assertOnGpu` attribute. Fo
by danilafe 3y ago
It's not signaled / warned about by default. However, if you want to make sure your `foreach` loop runs on the GPU, you can use the `@assertOnGpu` attribute. For instance, the following program would not compile:
@assertOnGpu
foreach i in 1..10 { /* Do something that can't be done on a GPU. */ }
The compiler will print a message explaining why the loop was not eligible for GPU execution.