imate
C++/CUDA Reference
cusparseSymbols Class Reference

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

#include <cusparse_symbols.h>

Static Public Member Functions

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

Static Public Attributes

static cusparseCreate_type cusparseCreate = NULL
 
static cusparseDestroy_type cusparseDestroy = NULL
 
static cusparseCreateCsr_type cusparseCreateCsr = NULL
 
static cusparseCreateDnVec_type cusparseCreateDnVec = NULL
 
static cusparseDestroySpMat_type cusparseDestroySpMat = NULL
 
static cusparseDestroyDnVec_type cusparseDestroyDnVec = NULL
 
static cusparseSpMV_bufferSize_type cusparseSpMV_bufferSize = NULL
 
static cusparseSpMV_type cusparseSpMV = NULL
 

Detailed Description

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

Definition at line 47 of file cusparse_symbols.h.

Member Function Documentation

◆ get_lib_name()

std::string cusparseSymbols::get_lib_name ( )
static

Returns the name of cusparse shared library.

Definition at line 44 of file cusparse_symbols.cpp.

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

Referenced by cusparseCreate(), cusparseCreateCsr(), cusparseCreateDnVec(), cusparseDestroy(), cusparseDestroyDnVec(), cusparseDestroySpMat(), cusparseSpMV(), and cusparseSpMV_bufferSize().

Here is the caller graph for this function:

Member Data Documentation

◆ cusparseCreate

cusparseCreate_type cusparseSymbols::cusparseCreate = NULL
static

Definition at line 54 of file cusparse_symbols.h.

Referenced by cusparseCreate().

◆ cusparseCreateCsr

cusparseCreateCsr_type cusparseSymbols::cusparseCreateCsr = NULL
static

Definition at line 56 of file cusparse_symbols.h.

Referenced by cusparseCreateCsr().

◆ cusparseCreateDnVec

cusparseCreateDnVec_type cusparseSymbols::cusparseCreateDnVec = NULL
static

Definition at line 57 of file cusparse_symbols.h.

Referenced by cusparseCreateDnVec().

◆ cusparseDestroy

cusparseDestroy_type cusparseSymbols::cusparseDestroy = NULL
static

Definition at line 55 of file cusparse_symbols.h.

Referenced by cusparseDestroy().

◆ cusparseDestroyDnVec

cusparseDestroyDnVec_type cusparseSymbols::cusparseDestroyDnVec = NULL
static

Definition at line 59 of file cusparse_symbols.h.

Referenced by cusparseDestroyDnVec().

◆ cusparseDestroySpMat

cusparseDestroySpMat_type cusparseSymbols::cusparseDestroySpMat = NULL
static

Definition at line 58 of file cusparse_symbols.h.

Referenced by cusparseDestroySpMat().

◆ cusparseSpMV

cusparseSpMV_type cusparseSymbols::cusparseSpMV = NULL
static

Definition at line 61 of file cusparse_symbols.h.

Referenced by cusparseSpMV().

◆ cusparseSpMV_bufferSize

cusparseSpMV_bufferSize_type cusparseSymbols::cusparseSpMV_bufferSize = NULL
static

Definition at line 60 of file cusparse_symbols.h.

Referenced by cusparseSpMV_bufferSize().


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