Reordered includes so cuda.h is checked before cudnn.h (to avoid giving misleading hints)
Add CUDA include dir so cuda.h is found; also add CUDA library dir to mimic configuration when compiling CUDA ops
Merge pull request #2256 from f0k/fix-cudnn-detection

Fix cuDNN detection