Writing CUDA kernels for interpolation

Using CUDA textures to interpolate images

In real-life applications, we want big images: when we watch a video clip on a PC, we like to see it in the full-screen mode. We want high-quality images: if a block of pixels gets damaged during the transmission, we want to repair it. We want cool images: by digital image manipulation, fancy artistic effects as seen in movies can be rendered. We want fast processing, especially when the images are big and many. To process even faster, we want that the various image pixels are processed in parallel.

What you’ll learn

  • Nearest-neighbor interpolation of a PGM image.
  • Writing CUDA kernels.
  • Texture filtering.
  • Bilinear interpolation of a PGM image.
  • Texture loopkup.
  • Bicubic interpolation of a PGM image.
  • Interpolation in CUDA.

Course Content

  • Introduction –> 1 lecture • 8min.
  • Nearest-neighbor interpolation, linear interpolation and texture memory –> 3 lectures • 47min.
  • Cubic interpolation and texture memory –> 1 lecture • 14min.
  • Assessment –> 1 lecture • 12min.

Writing CUDA kernels for interpolation

Requirements

  • Fundamentals of C/C++ and CUDA programming.
  • Basic elements of calculus, especially function approximation.

In real-life applications, we want big images: when we watch a video clip on a PC, we like to see it in the full-screen mode. We want high-quality images: if a block of pixels gets damaged during the transmission, we want to repair it. We want cool images: by digital image manipulation, fancy artistic effects as seen in movies can be rendered. We want fast processing, especially when the images are big and many. To process even faster, we want that the various image pixels are processed in parallel.

CUDA (Compute Unified Device Architecture) is a hardware architecture and programming model introduced by NVIDIA for the parallel processing of Graphics Processing Units (GPUs). It represents by now an assessed tool for parallel programming and permits low-level programming capable of achieving very high performance by directly and properly managing the thread work.

In this course, the direct use of CUDA for a simple yet common problem like image interpolation is illustrated. This will enable the attendee to get familiar with the functions running on the GPU, namely, the kernel functions. Being interpolation very common in technical and scientific applications, the development of parallel interpolation codes permits having a tool that can be reused when needed.

What will you learn in this course?

  • Nearest-neighbor interpolation
  • Linear and bilinear interpolation
  • CUDA texture memory
  • Texture filtering
  • Nearest-neighbor and linear interpolations of a PGM image
  • Cubic B-spline interpolation
  • Bicubic B-spline interpolation of a PGM image
  • Texture lookup
  • Catmull-Rom interpolation

Different common interpolation techniques for PGM images will be presented and implemented with customized CUDA kernels, also using CUDA texture memory.

Requirements

  • You should have basic knowledge of the fundamentals of C/C++ and CUDA programming
  • You should have basic knowledge of elements of calculus, especially function approximation
Get Tutorial