CUDALink allows the Wolfram Language to use the CUDA parallel computing architecture on Graphical Processing Units (GPUs). It contains functions that use CUDA-enabled GPUs to boost performance in a number of areas, such as linear algebra, financial simulation, and image processing. CUDALink also integrates CUDA with existing Wolfram Language development tools, allowing a high degree of automation and control.
CUDAQ tells you whether a CUDA-capable device is available and can be used.
CUDAInformation tells you more information about the graphics processing unit. Here the GPU is a Quadro FX unit with 96 cores and 1GB of graphics memory.
In the Wolfram Language you can make matrices of real random numbers with the RandomReal command.
You can use the graphics processor to do the multiplication using CUDADot.
You can retrieve the data from the graphics processor with CUDAMemoryGet. Here, the dimensions of the result are shown to be as expected.
CUDA is used as the computing engine for NVIDIA graphics processing units (GPUs); it provides a programming interface that can be called by software applications such as the Wolfram Language with CUDALink. It allows CUDA GPUs to be used for parallel computations, allowing many concurrent threads to run.
CUDALink allows Wolfram Language users to call the CUDA programming layer directly; it also provides users higher-level functions, provided in a number of CUDA libraries, for solutions in areas such as high-performance core linear algebra and Fourier transforms.
CUDALink provides functions in various application areas. These include carefully tuned linear algebra, discrete Fourier transforms, and image processing algorithms. This section gives an introduction to some of these applications.
CUDALink offers many image processing algorithms that have been carefully tuned to run on GPUs. These include the binary image operations (CUDAImageAdd, CUDAImageSubtract, CUDAImageMultiply, and CUDAImageDivide), the morphology operators (CUDAErosion, CUDADilation, CUDAOpening, and CUDAClosing), and image convolution (CUDAImageConvolve).
Now you can apply CUDA-based image processing functions directly to images. This example carries out channel-wise multiplication of two input images using CUDAImageMultiply.
Since the CUDA functions are Wolfram Language functions, they can be used in conjunction with other functions (like Manipulate). In the following example, a linear interpolation is carried out with Manipulate being used to vary the interpolation parameter.
CUDA functions can also be used with the Wolfram Language's curated data, Import and Export functions, as well as its visualization functions. In the following, the core computation is done with CUDA, while using the Wolfram Language for all the other functions.
You can then retrieve the data from the GPU with CUDAMemoryGet.
This calls the CUDAFunction.
This loads data to the GPU and calls your function on the data. The result is a CUDAMemory expression.
You can get information on your function with CUDAFunctionInformation, as shown in the following.