In the past, I’ve used PyTorch with Python, but I’m looking for better performance in CPP. I have CUDNN installed but the paths I have here aren’t working. Any advice would be greatly appreciated. Thank you
-- Caffe2: CUDA detected: 11.4
-- Caffe2: CUDA nvcc is: /usr/local/cuda-11.4/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda-11.4
-- Caffe2: Header version is: 11.4
-- Could NOT find CUDNN (missing: CUDNN_LIBRARY_PATH CUDNN_INCLUDE_PATH) 
CMake Warning at /home/username/Downloads/libtorch/share/cmake/Caffe2/public/cuda.cmake:109 (message):
  Caffe2: Cannot find cuDNN library.  Turning the option off
Call Stack (most recent call first):
  /home/username/Downloads/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:88 (include)
  /home/username/Downloads/libtorch/share/cmake/Torch/TorchConfig.cmake:68 (find_package)
  CMakeLists.txt:7 (find_package)

CMakeLists.txt
cmake_minimum_required(VERSION 3.2)

project(apresearch)

set(CMAKE_PREFIX_PATH /home/username/Downloads/libtorch)

find_package(Torch REQUIRED)

set(CUDNN_INCLUDE_DIR /usr/lib/cuda/include)

set(CUDNN_INCLUDE_PATH /usr/lib/cuda/include)

set(CUDNN_LIB_DIR /usr/lib/cuda/lib64)

set(CUDNN_PATH /usr/lib/cuda/lib64/libcudnn.so)

set(CUDNN_LIBRARY_PATH /usr/lib/cuda/lib64)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")

add_executable(${PROJECT_NAME} main.cpp)

target_link_libraries(${PROJECT_NAME} "${TORCH_LIBRARIES}")

set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14)