imate
C++/CUDA Reference
cublasSymbols Class Reference

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

#include <cublas_symbols.h>

Static Public Member Functions

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

Static Public Attributes

static cublasCreate_type cublasCreate = NULL
 
static cublasDestroy_type cublasDestroy = NULL
 
static cublasSgemv_type cublasSgemv = NULL
 
static cublasDgemv_type cublasDgemv = NULL
 
static cublasScopy_type cublasScopy = NULL
 
static cublasDcopy_type cublasDcopy = NULL
 
static cublasSaxpy_type cublasSaxpy = NULL
 
static cublasDaxpy_type cublasDaxpy = NULL
 
static cublasSdot_type cublasSdot = NULL
 
static cublasDdot_type cublasDdot = NULL
 
static cublasSnrm2_type cublasSnrm2 = NULL
 
static cublasDnrm2_type cublasDnrm2 = NULL
 
static cublasSscal_type cublasSscal = NULL
 
static cublasDscal_type cublasDscal = NULL
 

Detailed Description

A static container to store symbols of loaded cublas 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, cudartSymbols cusparseSymbols

Definition at line 47 of file cublas_symbols.h.

Member Function Documentation

◆ get_lib_name()

std::string cublasSymbols::get_lib_name ( )
static

Returns the name of cublas shared library.

Definition at line 50 of file cublas_symbols.cpp.

51 {
52  // Get the extension name of a shared library depending on OS
53  std::string lib_extension;
54 
55  #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) || \
56  defined(__NT__)
57  lib_extension = "lib";
58  #elif __APPLE__
59  lib_extension = "dylib";
60  #elif __linux__
61  lib_extension = "so";
62  #else
63  #error "Unknown compiler"
64  #endif
65 
66  // Check cublas version
67  #ifndef CUBLAS_VER_MAJOR
68  #error "CUBLAS_VER_MAJOR is not defined."
69  #endif
70 
71  // cublas shared library base name
72  std::string lib_base_name = "libcublas";
73 
74  // Construct the lib name
75  std::ostringstream oss;
76  // oss << lib_base_name << "." << lib_extension;
77  oss << lib_base_name << "." << lib_extension << "." \
78  << CUBLAS_VER_MAJOR;
79 
80  std::string lib_name = oss.str();
81  return lib_name;
82 }

Referenced by cublasCreate_v2(), cublasDaxpy(), cublasDcopy(), cublasDdot(), cublasDestroy_v2(), cublasDgemv_v2(), cublasDnrm2(), cublasDscal(), cublasSaxpy(), cublasScopy(), cublasSdot(), cublasSgemv_v2(), cublasSnrm2(), and cublasSscal().

Here is the caller graph for this function:

Member Data Documentation

◆ cublasCreate

cublasCreate_type cublasSymbols::cublasCreate = NULL
static

Definition at line 54 of file cublas_symbols.h.

Referenced by cublasCreate_v2().

◆ cublasDaxpy

cublasDaxpy_type cublasSymbols::cublasDaxpy = NULL
static

Definition at line 61 of file cublas_symbols.h.

Referenced by cublasDaxpy().

◆ cublasDcopy

cublasDcopy_type cublasSymbols::cublasDcopy = NULL
static

Definition at line 59 of file cublas_symbols.h.

Referenced by cublasDcopy().

◆ cublasDdot

cublasDdot_type cublasSymbols::cublasDdot = NULL
static

Definition at line 63 of file cublas_symbols.h.

Referenced by cublasDdot().

◆ cublasDestroy

cublasDestroy_type cublasSymbols::cublasDestroy = NULL
static

Definition at line 55 of file cublas_symbols.h.

Referenced by cublasDestroy_v2().

◆ cublasDgemv

cublasDgemv_type cublasSymbols::cublasDgemv = NULL
static

Definition at line 57 of file cublas_symbols.h.

Referenced by cublasDgemv_v2().

◆ cublasDnrm2

cublasDnrm2_type cublasSymbols::cublasDnrm2 = NULL
static

Definition at line 65 of file cublas_symbols.h.

Referenced by cublasDnrm2().

◆ cublasDscal

cublasDscal_type cublasSymbols::cublasDscal = NULL
static

Definition at line 67 of file cublas_symbols.h.

Referenced by cublasDscal().

◆ cublasSaxpy

cublasSaxpy_type cublasSymbols::cublasSaxpy = NULL
static

Definition at line 60 of file cublas_symbols.h.

Referenced by cublasSaxpy().

◆ cublasScopy

cublasScopy_type cublasSymbols::cublasScopy = NULL
static

Definition at line 58 of file cublas_symbols.h.

Referenced by cublasScopy().

◆ cublasSdot

cublasSdot_type cublasSymbols::cublasSdot = NULL
static

Definition at line 62 of file cublas_symbols.h.

Referenced by cublasSdot().

◆ cublasSgemv

cublasSgemv_type cublasSymbols::cublasSgemv = NULL
static

Definition at line 56 of file cublas_symbols.h.

Referenced by cublasSgemv_v2().

◆ cublasSnrm2

cublasSnrm2_type cublasSymbols::cublasSnrm2 = NULL
static

Definition at line 64 of file cublas_symbols.h.

Referenced by cublasSnrm2().

◆ cublasSscal

cublasSscal_type cublasSymbols::cublasSscal = NULL
static

Definition at line 66 of file cublas_symbols.h.

Referenced by cublasSscal().


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