imate
C++/CUDA Reference
Loading...
Searching...
No Matches
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.
 

Static Public Attributes

static cusparseCreate_type cusparseCreate = NULL
 
static cusparseDestroy_type cusparseDestroy = NULL
 
static cusparseCreateCsr_type cusparseCreateCsr = NULL
 
static cusparseCreateCsc_type cusparseCreateCsc = 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 48 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 45 of file cusparse_symbols.cpp.

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

Referenced by cusparseCreate(), cusparseCreateCsc(), 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 55 of file cusparse_symbols.h.

Referenced by cusparseCreate().

◆ cusparseCreateCsc

cusparseCreateCsc_type cusparseSymbols::cusparseCreateCsc = NULL
static

Definition at line 58 of file cusparse_symbols.h.

Referenced by cusparseCreateCsc().

◆ cusparseCreateCsr

cusparseCreateCsr_type cusparseSymbols::cusparseCreateCsr = NULL
static

Definition at line 57 of file cusparse_symbols.h.

Referenced by cusparseCreateCsr().

◆ cusparseCreateDnVec

cusparseCreateDnVec_type cusparseSymbols::cusparseCreateDnVec = NULL
static

Definition at line 59 of file cusparse_symbols.h.

Referenced by cusparseCreateDnVec().

◆ cusparseDestroy

cusparseDestroy_type cusparseSymbols::cusparseDestroy = NULL
static

Definition at line 56 of file cusparse_symbols.h.

Referenced by cusparseDestroy().

◆ cusparseDestroyDnVec

cusparseDestroyDnVec_type cusparseSymbols::cusparseDestroyDnVec = NULL
static

Definition at line 61 of file cusparse_symbols.h.

Referenced by cusparseDestroyDnVec().

◆ cusparseDestroySpMat

cusparseDestroySpMat_type cusparseSymbols::cusparseDestroySpMat = NULL
static

Definition at line 60 of file cusparse_symbols.h.

Referenced by cusparseDestroySpMat().

◆ cusparseSpMV

cusparseSpMV_type cusparseSymbols::cusparseSpMV = NULL
static

Definition at line 63 of file cusparse_symbols.h.

Referenced by cusparseSpMV().

◆ cusparseSpMV_bufferSize

cusparseSpMV_bufferSize_type cusparseSymbols::cusparseSpMV_bufferSize = NULL
static

Definition at line 62 of file cusparse_symbols.h.

Referenced by cusparseSpMV_bufferSize().


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