SLI Zone
NVIDIA.com Developer Home

NVIDIA CUDA SDK - CUDA Basic Topics

The CUDA Developer SDK provides examples with source code, utilities, and white papers to help you get started writing software with CUDA. The SDK includes dozens of code samples covering a wide range of applications including:

  • Simple techniques such as C++ code integration and efficient loading of custom datatypes
  • How-To examples covering CUDA BLAS and FFT libraries, texture fetching in CUDA, and CUDA interoperation with the OpenGL and Direct3D graphics APIS
  • Linear algebra primitives such as matrix transpose and matrix-matrix multiplication
  • Data-parallel algorithms such as parallel prefix sum of large arrays
  • Performance: profiling using timers and bandwidth tests
  • Advanced application examples such as image convolution, Black-Scholes options pricing and binomial options pricing
Refer to the following READMEs for more information ( Linux , Windows )

This code is released free of charge for use in derivative works, whether academic, commercial, or personal. (Full License)

The NVIDIA CUDA Toolkit is required to run and compile code samples. Please obtain the CUDA Toolkit here

Quick Links:
Data-Parallel Algorithms Computational Finance
Performance Strategies Linear Algebra
Physically-Based Simulation CUDA Basic Topics
Graphics Interop Image/Video Processing and Data Compression
CUDA Advanced Topics


Separable Convolution For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample implements a separable convolution filter of a 2D signal with a gaussian kernel.
  Minimum Required GPU
Minimum Required GPUor later



Whitepaper
Download - Windows
Download - Linux


Texture-based Separable Convolution For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Texture-based implementation of a separable 2D convolution with a gaussian kernel. Used for performance comparison against convolutionSeparable.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Black-Scholes Option Pricing For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample evaluates fair call and put prices for a given set of European options by Black-Scholes formula.
  Minimum Required GPU
Minimum Required GPUor later



Whitepaper
Download - Windows
Download - Linux


Bitonic Sort For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Bitonic sort is a very simple parallel sorting algorithm that is very efficient when sorting a small number of elements: http://citeseer.ist.psu.edu/blelloch98experimental.html This implementation is based on: http://www.tools-of-computing.com/tc/CS/Sorts/bitonic_sort.htm
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Scalar Product For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample calculates scalar products of a given set of input vector pairs.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Clock For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This example shows how to use the clock function to measure the performance of kernel accurately.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Multi-GPU For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This application demonstrates how to use the CUDA API to use multiple GPUs.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Aligned Types For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

A simple test, showing huge access speed gap between aligned and misaligned structures.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


asyncAPI For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample uses CUDA streams and events to overlap execution on CPU and GPU.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


cudaOpenMP For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample shows how to use OpenMP API to write an application for multiple GPUs.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows


simpleStreams For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample uses CUDA streams to overlap kernel executions with memcopies between the device and the host.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Simple Atomics For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

A simple demonstration of global memory atomic instructions.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Device Query For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample enumerates the properties of the CUDA devices present in the system.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Simple Templates For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample is a templatized version of the template project. It also shows how to correctly templatize dynamically allocated shared memory arrays.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Bandwidth Test For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This is a simple test program to measure the memcopy bandwidth of the GPU. It currently is capable of measuring device to device copy bandwidth, host to device copy bandwidth for pageable and page-locked memory, and device to host copy bandwidth for pageable and page-locked memory.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Simple Texture (Driver Version) For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Simple example that demonstrates use of textures in CUDA using the driver API.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Simple Texture For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Simple example that demonstrates use of textures in CUDA.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Matrix Multiplication (Driver Version) For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample implements matrix multiplication using the CUDA driver API. It has been written for clarity of exposition to illustrate various CUDA programming principles, not with the goal of providing the most performant generic kernel for matrix multiplication. CUBLAS provides high-performance matrix multiplication.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Template For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

A trivial template project that can be used as a starting point to create new CUDA projects.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Simple CUFFT For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Example of using CUFFT. In this example, CUFFT is used to compute the 1D-convolution of some signal with some filter by transforming both into frequency domain, multiplying them together, and transforming the signal back to time domain.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Simple Direct3D For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Simple program which demonstrates interoperability between CUDA and Direct3D. The program modifies vertex positions with CUDA and uses Direct3D to render the geometry.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows


Simple OpenGL For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Simple program which demonstrates interoperability between CUDA and OpenGL. The program modifies vertex positions with CUDA and uses OpenGL to render the geometry.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Simple CUBLAS For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Example of using CUBLAS.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


Matrix Multiplication For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample implements matrix multiplication and is exactly the same as Chapter 6 of the programming guide. It has been written for clarity of exposition to illustrate various CUDA programming principles, not with the goal of providing the most performant generic kernel for matrix multiplication. CUBLAS provides high-performance matrix multiplication.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux


C++ Integration For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This example demonstrates how to integrate CUDA into an existing C++ application, i.e. the CUDA entry point on host side is only a function which is called from C++ code and only the file containing this function is compiled with nvcc. It also demonstrates that vector types can be used from cpp.
  Minimum Required GPU
Minimum Required GPUor later




Download - Windows
Download - Linux

Last Update: 11/12/2007
NVPerfHUD 4