logoalt Hacker News

pavonyesterday at 11:02 PM1 replyview on HN

> The best way to program GPUs is face up to the reality that they are not the same machine as the CPU, write your kernels in separate files, and launch them manually

Isn't that how CUDA code is normally written?


Replies

jacobgormyesterday at 11:31 PM

No. CUDA allows you to write all the code in a single file, and uses a preprocessor to split it back out and pass it through separate compilers, one for host and one for device.

show 1 reply