Category CUDA

Histogram on GPU using CUDA

The following sample demonstrates how to compute a histogram on a GPU. CUDA SDK has a histogram sample which works for 64 and 256 bins with code both running on GPU and CPU. SDK CPU code is using bit-manipulation which should be replaced with SSE2 instructions. This article demonstrates 3 simple, entry-level, examples showing the […]

Matrix Transpose on GPU using CUDA

The following sample demonstrates matrix transpose on GPU. It starts with sequential code on the CPU and progresses towards more advanced optimizations, first a parallel transformation on the CPU, then several transformations on the GPU. In real life, it is impractical to do just a single matrix operation on the GPU due to the cost […]

Red-eye Removal with CUDA

This code demonstrates basic steps for red-eye correction in pictures. It requires a picture of someone with red eyes and a small template file which is a picture of a red eye to help us find eyes in the original picture. While the sample works with the picture that I tested it with, it requires […]

NVIDIA GPU Architecture & CUDA Programming Environment

1. Introduction GPU was first invented by NVidia in 1999. Originally GPUs were purely fixed-function devices, meaning that they were designed to specifically process stages of graphics pipeline such as vertex and pixel shaders, but they have evolved into increasingly flexible programmable processors. Modern GPUs are fully programmable manycore chips built around an array of […]

HDR Tone Mapping with CUDA 5

Note that the code for the article is available here. In this example, for the sake of learning, we are going to butcher some great images. Let’s describe the problem first. We are going to take some HDR images and modify their luminosity to lighten them. We could also darken the images, or apply changes only […]

Gaussian blur with CUDA 5

We will continue from a previous example of RGBA to gray image conversion with CUDA 5 and add gaussian filter. After applying the filter we will achieve the following transformation: to: Here’s the information showing time it took to run CUDA kernel on the GPU compared to time on the CPU: This code will work with RGBA images where […]

RGBA to Gray image conversion with CUDA 5

In this article we will demonstrate a simple conversion from RGBA to grayscale image using CUDA 5, we will build on a previous example of a simple CUDA kernel. For example, the following RGB picture of flowers will look like this after running the filter: and to execute the application we will call it like […]

CUDA 5.0 and Visual Studio 2012 Configuration

Note that CUDA 5.5 fully supports Visual Studio 2012.. I will explain in this article how to set your environment in order to successfully write and run CUDA 5 programs with Visual Studio 2012. It takes time to figure out how to get it done and there is very little information on the internet, so […]