We present GPU-to-CPU callbacks, a new mechanism and abstraction for GPUs that offers them more independence in a heterogeneous computing environment. Specifically, we provide a method for GPUs to issue callback requests to the CPU. These requests serve as a tool for ease-of-use, future proofing of code, and new functionality. We classify the types of these requests into three categories: System calls (e.g. network and file I/O), device/host memory transfers, and CPU compute, and provide motivation as to why all are important. We show how to implement such a mechanism in CUDA using pinned system memory and discuss possible GPU-driver features to alleviate the need for polling, thus making callbacks more efficient with CPU usage and power consumption. We implement several examples demonstrating the use of callbacks for file I/O, network I/O, memory allocation, and debugging.
KeywordsSystem Call Memory Allocation Memory Transfer Thread Processor Software Advancement
Unable to display preview. Download preview PDF.
- 1.Advanced Micro Devices. Coming soon: The AMD fusion family of APUsGoogle Scholar
- 3.NVIDIA Corporation. CUDA-GDB: The NVIDIA CUDA debugger (2008), http://developer.download.nvidia.com/compute/cuda/2_1/cudagdb/CUDA_GDB_User_Manual.pdf
- 4.NVIDIA Corporation. NVIDIA CUDA compute unified device architecture programming guide (February 2010), http://developer.nvidia.com/cuda
- 5.Stuart, J.A., Owens, J.D.: Message passing on data-parallel architectures. In: Proceedings of the 23rd IEEE International Parallel and Distributed Processing Symposium (May 2009)Google Scholar