Skip to content

This Repo Demonstrates the Methods For running Famous Serial (CPU) operations on CUDA Powered GPU

License

Notifications You must be signed in to change notification settings

ebadali/Gpu-Stencil-Operations

Repository files navigation

Gpu-Stencil-Operations

This Repo Demonstrates the Methods For running Famous Image Processing Serial (CPU) operations on CUDA Powered GPU

  • Stencil : It is an Important Communication pattern Among Threads within a Block of a Grid, Basically it Allows to Reads Input From Fixed Neighborhood in a single location of an Array.

This Repo Contains Stencils Operations and Demonstrates:

1d Stensil Operations On Cuda in : one_d_stencil.py

Consider applying a 1D stencil to a 1D array of elements. Each output element is the sum of input elements within a radius. If radius is n, then each output element is the sum of n input elements:

alt tag

2d Stensil Operations On Cuda in : image_filter_test.py

Similarly We Create an Apron around Image Tile, So that,

  • Image tile can be cached to shared memory
  • Each output pixel must have access to neighboring pixels within certain radius R
  • This means tiles in shared memory must be expanded with an apron that contains neighboring pixels
  • Only pixels within the apron write results.The remaining threads do nothing

alt tag

Basic Image Processing Filters, using 2d Stensils in : image_filter_test.py

Apply some Basic operation such as Thresholding, Image Sharpening and averaging.

Reduction Algorithm Implementation in : reduction_sum.py

Basically, It Loads all the Feature Vector From the File and the Vector to be compaired to the GPU, Calcualtes kullback leibler divergence (a fundamental equation of information theory that quantifies the proximity of two probability distributions) among the vectors On the GPU.

CPU Version is also Provided, within the File.

Enviroment:

  1. Ubunto 16.04 LTS
  2. GeForce GTX 750 Ti Compute Capability 5.0 with Cuda toolkits and
  3. Anaconda python 3
  4. Numba : compiler for Python
  5. Cuda Python
Resources:
  1. Numba
  2. Manuel Ujaldon Nvidia Cuda Fellow

About

This Repo Demonstrates the Methods For running Famous Serial (CPU) operations on CUDA Powered GPU

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages