Then, each platform has a host-side implementation in the form of a device_*.cpp file which implements the Device API and handles the platform-specific calls. ccl_device is static inline on CPU, _device_ _inline_ on CUDA and nothing on OpenCL). To be able to write platform-independent code, we use a bunch of generic preprocessor defines that then are defined to the platform-specific keywords in the kernel_compat_*.h files (e.g. These headers are then included into architecture-specific files which implement the entry points and basically act as stubs around the general functions.įor example, kernel.cu defines the kernel_cuda_path_trace kernel, which just figures out which pixel to process and then calls kernel_path_trace, which is defined in kernel_path.h for all three platforms. Most of the kernel code is in header files that are shared between the CPU, CUDA and OpenCL versions. Some info on the GPU compute stuff in Cycles:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |