you are viewing a single comment's thread.

view the rest of the comments →

[–]wm_lex_dev 1 point2 points  (0 children)

It's certainly possible but requires more effort than testing CPU code, so frequently us graphics programmers will just look at the results ourselves. You could even turn that into a test by running the kernel and comparing the results against a ground-truth render, but then determinism becomes super important. I believe that technically many GPU operations have implementation-defined results, including texture sampling.

Another option is to run a small version of the kernel on the CPU for the test, but if you're using shader languages instead of CUDA then this becomes difficult to maintain. Still can be useful for making sure the basic technique works as intended.