Prototype Algorithms and Test CUDA Kernels in MATLAB

Print Friendly, PDF & Email

Over at the Nvidia Developer Zone, Daniel Armyr and Dan Doherty from MathWorks describe how you can use MATLAB to support your development of CUDA C and C++ kernels.

While algorithms written for the GPU are often much faster, the process of building a framework for developing and testing them can be time-consuming. Many programmers write CUDA kernels integrated into C or Fortran programs for production. For this reason, they often use these languages to iterate on and test their kernels, which requires writing significant amounts of “glue code” for tasks such as transferring data to the GPU, managing GPU memory, initializing and launching CUDA kernels, and visualizing kernel outputs. This glue code is time-consuming to write and may be difficult to change if, for example, you want to run the kernel on different input data or visualize kernel outputs using a different type of plot. Using an image white balancing example, this article describes how MATLAB supports CUDA kernel development by providing a language and development environment for quickly evaluating kernels, analyzing and visualizing kernel results, and writing test harnesses to validate kernel results.

Read the Full Story.