Getting started with cuDNN

I was in need of getting familiar with calling cuDNN routines, but the descriptor interface was a little confusing. So I put together this example calling the pooling operator for both forward and backward passes. I searched online, and found some examples, but nothing complete.

So I put together the code and put it up on GitHub as a Gist here in the hopes that it can help others too: https://gist.github.com/samskalicky/b9e80e5bbe558329ba2c2b02f6fb43db

A quick overview:

  • test.cu – example main C++ file for calling the cuDNN operators
  • float32.h – example test input data for pooling operator, and golden output for the forward pass and gradients for the backward pass
  • Makefile – example build command to compile the example into a binary

I make this post/example assuming that you’ve already configured the CUDA/cuDNN library installation. I used an AWS EC2 instance with the Deep Learning AMI (DLAMI) preconfigured. If you’re having issues with installation, try spinning up a quick EC2 instance to move forward.

Good luck!

Leave a comment