Add cuDNN switch to CMake.