Commit caa7ec72 authored by Tristan Webb's avatar Tristan Webb

Test for cuDNN version using cmake identifier and cudnn shared lib

parent 62ca7797
......@@ -64,6 +64,13 @@ if(NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR)
set(BACKEND_NAMES ${BACKEND_NAMES} "CPU")
endif()
if(USE_CUDA)
find_package(CUDA QUIET)
include_directories(SYSTEM ${CUDA_INCLUDE_DIRS} ${CUDNN_INCLUDE_DIR})
set(SRC main.cpp cudnn.cpp)
# set(BACKEND_NAMES ${BACKEND_NAMES} "GPU")
endif()
foreach(BACKEND_NAME ${BACKEND_NAMES})
configure_file(backend_test.in.cpp backend_test_${BACKEND_NAME}.cpp)
set(SRC ${SRC} ${CMAKE_CURRENT_BINARY_DIR}/backend_test_${BACKEND_NAME}.cpp)
......@@ -85,6 +92,10 @@ if(LLVM_INCLUDE_DIR)
add_dependencies(unit-test ext_llvm)
endif()
if(CUDNN_INCLUDE_DIR)
target_link_libraries(unit-test cudnn)
endif()
target_link_libraries(unit-test ngraph libgtest pthread)
target_link_libraries(unit-test ${CMAKE_DL_LIBS})
......
#include <gtest/gtest.h>
#include <cuda.h>
#include <cudnn.h>
TEST(cudnn, simple)
{
auto cudnn_version = cudnnGetVersion();
EXPECT_FLOAT_EQ(cudnn_version, CUDNN_VERSION);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment