diff --git a/source/nvidia/cuda/nvidia-cuda.cpp b/source/nvidia/cuda/nvidia-cuda.cpp index 0a69c27c..4253efd6 100644 --- a/source/nvidia/cuda/nvidia-cuda.cpp +++ b/source/nvidia/cuda/nvidia-cuda.cpp @@ -238,6 +238,13 @@ nvidia::cuda::cuda::cuda() : _library() cuInit(0); } +int32_t nvidia::cuda::cuda::version() +{ + int32_t v = 0; + cuDriverGetVersion(&v); + return v; +} + std::shared_ptr nvidia::cuda::cuda::get() { static std::weak_ptr instance; diff --git a/source/nvidia/cuda/nvidia-cuda.hpp b/source/nvidia/cuda/nvidia-cuda.hpp index 08d9360b..d719aeb1 100644 --- a/source/nvidia/cuda/nvidia-cuda.hpp +++ b/source/nvidia/cuda/nvidia-cuda.hpp @@ -19,6 +19,7 @@ #pragma once #include +#include #include "util/util-bitmask.hpp" #include "util/util-library.hpp" @@ -181,6 +182,8 @@ namespace nvidia::cuda { ~cuda(); cuda(); + int32_t version(); + public: // Initialization CUDA_DEFINE_FUNCTION(cuInit, int32_t flags);