imate
C++/CUDA Reference
cudartSymbols Class Reference

A static container to store symbols of loaded cudart library. More...

#include <cudart_symbols.h>

Static Public Member Functions

static std::string get_lib_name ()
 Returns the name of cudart shared library. More...
 

Static Public Attributes

static cudaEventCreate_type cudaEventCreate = NULL
 
static cudaEventDestroy_type cudaEventDestroy = NULL
 
static cudaEventElapsedTime_type cudaEventElapsedTime = NULL
 
static cudaEventRecord_type cudaEventRecord = NULL
 
static cudaEventSynchronize_type cudaEventSynchronize = NULL
 
static cudaGetDevice_type cudaGetDevice = NULL
 
static cudaGetDeviceCount_type cudaGetDeviceCount = NULL
 
static cudaGetDeviceProperties_type cudaGetDeviceProperties = NULL
 
static cudaFree_type cudaFree = NULL
 
static cudaMalloc_type cudaMalloc = NULL
 
static cudaMemcpy_type cudaMemcpy = NULL
 
static cudaSetDevice_type cudaSetDevice = NULL
 
static __cudaRegisterFatBinary_type __cudaRegisterFatBinary = NULL
 
static __cudaRegisterFatBinaryEnd_type __cudaRegisterFatBinaryEnd
 
static __cudaUnregisterFatBinary_type __cudaUnregisterFatBinary = NULL
 

Detailed Description

A static container to store symbols of loaded cudart library.

Note
When this package is compiled with dynamic loading enabled, make sure that cuda toolkit is available at run-time. For instance on a linux cluster, run:
module load cuda
See also
dynamic_loading, cublasSymbols, cusparseSymbols

Definition at line 47 of file cudart_symbols.h.

Member Function Documentation

◆ get_lib_name()

std::string cudartSymbols::get_lib_name ( )
static

Returns the name of cudart shared library.

Definition at line 54 of file cudart_symbols.cpp.

55 {
56  // Get the extension name of a shared library depending on OS
57  std::string lib_extension;
58 
59  #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) || \
60  defined(__NT__)
61  lib_extension = "lib";
62  #elif __APPLE__
63  lib_extension = "dylib";
64  #elif __linux__
65  lib_extension = "so";
66  #else
67  #error "Unknown compiler"
68  #endif
69 
70  // Check cudart version
71  // #ifndef CUDART_VERSION
72  // #error "CUDART_VERSION is not defined."
73  // #endif
74 
75  // CUDART_VERSION is something like 11020, which means major version 11
76  // and minor version 2. To get the major version, strip off last three
77  // digits.
78  // int cuda_version_major = CUDART_VERSION / 1000;
79 
80  // cudart shared library base name
81  std::string lib_base_name = "libcudart";
82 
83  // Construct the lib name
84  std::ostringstream oss;
85  oss << lib_base_name << "." << lib_extension;
86  // oss << lib_base_name << "." << lib_extension << "."
87  // << std::to_string(cuda_version_major);
88 
89  std::string lib_name = oss.str();
90  return lib_name;
91 }

Referenced by __cudaRegisterFatBinary(), __cudaRegisterFatBinaryEnd(), __cudaUnregisterFatBinary(), cudaEventCreate(), cudaEventDestroy(), cudaEventElapsedTime(), cudaEventRecord(), cudaEventSynchronize(), cudaFree(), cudaGetDevice(), cudaGetDeviceCount(), cudaGetDeviceProperties(), cudaMalloc(), cudaMemcpy(), and cudaSetDevice().

Here is the caller graph for this function:

Member Data Documentation

◆ __cudaRegisterFatBinary

__cudaRegisterFatBinary_type cudartSymbols::__cudaRegisterFatBinary = NULL
static

Definition at line 66 of file cudart_symbols.h.

Referenced by __cudaRegisterFatBinary().

◆ __cudaRegisterFatBinaryEnd

__cudaRegisterFatBinaryEnd_type cudartSymbols::__cudaRegisterFatBinaryEnd
static
Initial value:
=
NULL

Definition at line 67 of file cudart_symbols.h.

Referenced by __cudaRegisterFatBinaryEnd().

◆ __cudaUnregisterFatBinary

__cudaUnregisterFatBinary_type cudartSymbols::__cudaUnregisterFatBinary = NULL
static

Definition at line 68 of file cudart_symbols.h.

Referenced by __cudaUnregisterFatBinary().

◆ cudaEventCreate

cudaEventCreate_type cudartSymbols::cudaEventCreate = NULL
static

Definition at line 54 of file cudart_symbols.h.

Referenced by cudaEventCreate().

◆ cudaEventDestroy

cudaEventDestroy_type cudartSymbols::cudaEventDestroy = NULL
static

Definition at line 55 of file cudart_symbols.h.

Referenced by cudaEventDestroy().

◆ cudaEventElapsedTime

cudaEventElapsedTime_type cudartSymbols::cudaEventElapsedTime = NULL
static

Definition at line 56 of file cudart_symbols.h.

Referenced by cudaEventElapsedTime().

◆ cudaEventRecord

cudaEventRecord_type cudartSymbols::cudaEventRecord = NULL
static

Definition at line 57 of file cudart_symbols.h.

Referenced by cudaEventRecord().

◆ cudaEventSynchronize

cudaEventSynchronize_type cudartSymbols::cudaEventSynchronize = NULL
static

Definition at line 58 of file cudart_symbols.h.

Referenced by cudaEventSynchronize().

◆ cudaFree

cudaFree_type cudartSymbols::cudaFree = NULL
static

Definition at line 62 of file cudart_symbols.h.

Referenced by cudaFree().

◆ cudaGetDevice

cudaGetDevice_type cudartSymbols::cudaGetDevice = NULL
static

Definition at line 59 of file cudart_symbols.h.

Referenced by cudaGetDevice().

◆ cudaGetDeviceCount

cudaGetDeviceCount_type cudartSymbols::cudaGetDeviceCount = NULL
static

Definition at line 60 of file cudart_symbols.h.

Referenced by cudaGetDeviceCount().

◆ cudaGetDeviceProperties

cudaGetDeviceProperties_type cudartSymbols::cudaGetDeviceProperties = NULL
static

Definition at line 61 of file cudart_symbols.h.

Referenced by cudaGetDeviceProperties().

◆ cudaMalloc

cudaMalloc_type cudartSymbols::cudaMalloc = NULL
static

Definition at line 63 of file cudart_symbols.h.

Referenced by cudaMalloc().

◆ cudaMemcpy

cudaMemcpy_type cudartSymbols::cudaMemcpy = NULL
static

Definition at line 64 of file cudart_symbols.h.

Referenced by cudaMemcpy().

◆ cudaSetDevice

cudaSetDevice_type cudartSymbols::cudaSetDevice = NULL
static

Definition at line 65 of file cudart_symbols.h.

Referenced by cudaSetDevice().


The documentation for this class was generated from the following files: