cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
versions.hpp
Go to the documentation of this file.
1 
7 #pragma once
8 #ifndef CUDA_API_WRAPPERS_RTC_VERSIONS_HPP_
9 #define CUDA_API_WRAPPERS_RTC_VERSIONS_HPP_
10 
11 #include <cuda/rtc/error.hpp>
12 #include "../api/versions.hpp"
13 
14 namespace cuda {
15 
16 namespace version_numbers {
17 
21 inline version_t nvrtc() {
22  version_t version;
23  auto status = nvrtcVersion(&version.major, &version.minor);
24  throw_if_error_lazy(status, "Failed obtaining the NVRTC library version");
25  return version;
26 }
27 
28 } // namespace version_numbers
29 } // namespace cuda
30 
31 #endif // CUDA_API_WRAPPERS_RTC_VERSIONS_HPP_
Definitions and functionality wrapping CUDA APIs.
Definition: array.hpp:22
version_t nvrtc()
Obtain the NVRTC library version.
Definition: versions.hpp:21
#define throw_if_error_lazy(status__,...)
A macro for only throwing an error if we&#39;ve failed - which also ensures no string is constructed unle...
Definition: error.hpp:316
A structure representing a CUDA release version.
Definition: versions.hpp:39
Facilities for exception-based handling of errors originating to the NVRTC library, including a basic exception class wrapping ::std::runtime_error.