imate
C++/CUDA Reference
cublas_symbols.cpp File Reference
#include "./cublas_symbols.h"
#include <cublas_api.h>
#include <cstdlib>
#include <sstream>
#include "./dynamic_loading.h"
Include dependency graph for cublas_symbols.cpp:

Go to the source code of this file.

Functions

cublasStatus_t cublasCreate_v2 (cublasHandle_t *handle)
 Definition of CUDA's cublasCreate function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasDestroy_v2 (cublasHandle_t handle)
 Definition of CUDA's cublasDestroy function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasSgemv_v2 (cublasHandle_t handle, cublasOperation_t trans, int m, int n, const float *alpha, const float *A, int lda, const float *x, int incx, const float *beta, float *y, int incy)
 Definition of CUDA's cublasSgemv function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasDgemv_v2 (cublasHandle_t handle, cublasOperation_t trans, int m, int n, const double *alpha, const double *A, int lda, const double *x, int incx, const double *beta, double *y, int incy)
 Definition of CUDA's cublasDgemv function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasScopy (cublasHandle_t handle, int n, const float *x, int incx, float *y, int incy)
 Definition of CUDA's cublasScopy function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasDcopy (cublasHandle_t handle, int n, const double *x, int incx, double *y, int incy)
 Definition of CUDA's cublasDcopy function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasSaxpy (cublasHandle_t handle, int n, const float *alpha, const float *x, int incx, float *y, int incy)
 Definition of CUDA's cublasSaxpy function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasDaxpy (cublasHandle_t handle, int n, const double *alpha, const double *x, int incx, double *y, int incy)
 Definition of CUDA's cublasDaxpy function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasSdot (cublasHandle_t handle, int n, const float *x, int incx, const float *y, int incy, float *result)
 Definition of CUDA's cublasSdot function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasDdot (cublasHandle_t handle, int n, const double *x, int incx, const double *y, int incy, double *result)
 Definition of CUDA's cublasDdot function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasSnrm2 (cublasHandle_t handle, int n, const float *x, int incx, float *result)
 Definition of CUDA's cublasSnrm2 function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasDnrm2 (cublasHandle_t handle, int n, const double *x, int incx, double *result)
 Definition of CUDA's cublasDnrm2 function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasSscal (cublasHandle_t handle, int n, const float *alpha, float *x, int incx)
 Definition of CUDA's cublasSscal function using dynamically loaded cublas library. More...
 
cublasStatus_t cublasDscal (cublasHandle_t handle, int n, const double *alpha, double *x, int incx)
 Definition of CUDA's cublasDscal function using dynamically loaded cublas library. More...
 

Function Documentation

◆ cublasCreate_v2()

cublasStatus_t cublasCreate_v2 ( cublasHandle_t *  handle)

Definition of CUDA's cublasCreate function using dynamically loaded cublas library.

Definition at line 97 of file cublas_symbols.cpp.

98 {
99  if (cublasSymbols::cublasCreate == NULL)
100  {
101  std::string lib_name = cublasSymbols::get_lib_name();
102  const char* symbol_name = "cublasCreate_v2";
103 
105  dynamic_loading::load_symbol<cublasCreate_type>(
106  lib_name.c_str(),
107  symbol_name);
108  }
109 
110  return cublasSymbols::cublasCreate(handle);
111 }
static cublasCreate_type cublasCreate
static std::string get_lib_name()
Returns the name of cublas shared library.

References cublasSymbols::cublasCreate, and cublasSymbols::get_lib_name().

Here is the call graph for this function:

◆ cublasDaxpy()

cublasStatus_t cublasDaxpy ( cublasHandle_t  handle,
int  n,
const double *  alpha,
const double *  x,
int  incx,
double *  y,
int  incy 
)

Definition of CUDA's cublasDaxpy function using dynamically loaded cublas library.

Definition at line 308 of file cublas_symbols.cpp.

316 {
317  if (cublasSymbols::cublasDaxpy == NULL)
318  {
319  std::string lib_name = cublasSymbols::get_lib_name();
320  const char* symbol_name = "cublasDaxpy_v2";
321 
323  dynamic_loading::load_symbol<cublasDaxpy_type>(
324  lib_name.c_str(),
325  symbol_name);
326  }
327 
328  return cublasSymbols::cublasDaxpy(handle, n, alpha, x, incx, y, incy);
329 }
static cublasDaxpy_type cublasDaxpy

References cublasSymbols::cublasDaxpy, and cublasSymbols::get_lib_name().

Referenced by cublas_interface::cublasXaxpy< double >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cublasDcopy()

cublasStatus_t cublasDcopy ( cublasHandle_t  handle,
int  n,
const double *  x,
int  incx,
double *  y,
int  incy 
)

Definition of CUDA's cublasDcopy function using dynamically loaded cublas library.

Definition at line 248 of file cublas_symbols.cpp.

254 {
255  if (cublasSymbols::cublasDcopy == NULL)
256  {
257  std::string lib_name = cublasSymbols::get_lib_name();
258  const char* symbol_name = "cublasDcopy_v2";
259 
261  dynamic_loading::load_symbol<cublasDcopy_type>(
262  lib_name.c_str(),
263  symbol_name);
264  }
265 
266  return cublasSymbols::cublasDcopy(handle, n, x, incx, y, incy);
267 }
static cublasDcopy_type cublasDcopy

References cublasSymbols::cublasDcopy, and cublasSymbols::get_lib_name().

Referenced by cublas_interface::cublasXcopy< double >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cublasDdot()

cublasStatus_t cublasDdot ( cublasHandle_t  handle,
int  n,
const double *  x,
int  incx,
const double *  y,
int  incy,
double *  result 
)

Definition of CUDA's cublasDdot function using dynamically loaded cublas library.

Definition at line 370 of file cublas_symbols.cpp.

378 {
379  if (cublasSymbols::cublasDdot == NULL)
380  {
381  std::string lib_name = cublasSymbols::get_lib_name();
382  const char* symbol_name = "cublasDdot_v2";
383 
385  dynamic_loading::load_symbol<cublasDdot_type>(
386  lib_name.c_str(),
387  symbol_name);
388  }
389 
390  return cublasSymbols::cublasDdot(handle, n, x, incx, y, incy, result);
391 }
static cublasDdot_type cublasDdot

References cublasSymbols::cublasDdot, and cublasSymbols::get_lib_name().

Referenced by cublas_interface::cublasXdot< double >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cublasDestroy_v2()

cublasStatus_t cublasDestroy_v2 ( cublasHandle_t  handle)

Definition of CUDA's cublasDestroy function using dynamically loaded cublas library.

Definition at line 122 of file cublas_symbols.cpp.

123 {
124  if (cublasSymbols::cublasDestroy == NULL)
125  {
126  std::string lib_name = cublasSymbols::get_lib_name();
127  const char* symbol_name = "cublasDestroy_v2";
128 
130  dynamic_loading::load_symbol<cublasDestroy_type>(
131  lib_name.c_str(),
132  symbol_name);
133  }
134 
135  return cublasSymbols::cublasDestroy(handle);
136 }
static cublasDestroy_type cublasDestroy

References cublasSymbols::cublasDestroy, and cublasSymbols::get_lib_name().

Here is the call graph for this function:

◆ cublasDgemv_v2()

cublasStatus_t cublasDgemv_v2 ( cublasHandle_t  handle,
cublasOperation_t  trans,
int  m,
int  n,
const double *  alpha,
const double *  A,
int  lda,
const double *  x,
int  incx,
const double *  beta,
double *  y,
int  incy 
)

Definition of CUDA's cublasDgemv function using dynamically loaded cublas library.

Definition at line 182 of file cublas_symbols.cpp.

195 {
196  if (cublasSymbols::cublasDgemv == NULL)
197  {
198  std::string lib_name = cublasSymbols::get_lib_name();
199  const char* symbol_name = "cublasDgemv_v2";
200 
202  dynamic_loading::load_symbol<cublasDgemv_type>(
203  lib_name.c_str(),
204  symbol_name);
205  }
206 
207  return cublasSymbols::cublasDgemv(handle, trans, m, n, alpha, A, lda, x,
208  incx, beta, y, incy);
209 }
static cublasDgemv_type cublasDgemv

References cublasSymbols::cublasDgemv, and cublasSymbols::get_lib_name().

Here is the call graph for this function:

◆ cublasDnrm2()

cublasStatus_t cublasDnrm2 ( cublasHandle_t  handle,
int  n,
const double *  x,
int  incx,
double *  result 
)

Definition of CUDA's cublasDnrm2 function using dynamically loaded cublas library.

Definition at line 430 of file cublas_symbols.cpp.

436 {
437  if (cublasSymbols::cublasDnrm2 == NULL)
438  {
439  std::string lib_name = cublasSymbols::get_lib_name();
440  const char* symbol_name = "cublasDnrm2_v2";
441 
443  dynamic_loading::load_symbol<cublasDnrm2_type>(
444  lib_name.c_str(),
445  symbol_name);
446  }
447 
448  return cublasSymbols::cublasDnrm2(handle, n, x, incx, result);
449 }
static cublasDnrm2_type cublasDnrm2

References cublasSymbols::cublasDnrm2, and cublasSymbols::get_lib_name().

Referenced by cublas_interface::cublasXnrm2< double >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cublasDscal()

cublasStatus_t cublasDscal ( cublasHandle_t  handle,
int  n,
const double *  alpha,
double *  x,
int  incx 
)

Definition of CUDA's cublasDscal function using dynamically loaded cublas library.

Definition at line 488 of file cublas_symbols.cpp.

494 {
495  if (cublasSymbols::cublasDscal == NULL)
496  {
497  std::string lib_name = cublasSymbols::get_lib_name();
498  const char* symbol_name = "cublasDscal_v2";
499 
501  dynamic_loading::load_symbol<cublasDscal_type>(
502  lib_name.c_str(),
503  symbol_name);
504  }
505 
506  return cublasSymbols::cublasDscal(handle, n, alpha, x, incx);
507 }
static cublasDscal_type cublasDscal

References cublasSymbols::cublasDscal, and cublasSymbols::get_lib_name().

Referenced by cublas_interface::cublasXscal< double >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cublasSaxpy()

cublasStatus_t cublasSaxpy ( cublasHandle_t  handle,
int  n,
const float *  alpha,
const float *  x,
int  incx,
float *  y,
int  incy 
)

Definition of CUDA's cublasSaxpy function using dynamically loaded cublas library.

Definition at line 277 of file cublas_symbols.cpp.

285 {
286  if (cublasSymbols::cublasSaxpy == NULL)
287  {
288  std::string lib_name = cublasSymbols::get_lib_name();
289  const char* symbol_name = "cublasSaxpy_v2";
290 
292  dynamic_loading::load_symbol<cublasSaxpy_type>(
293  lib_name.c_str(),
294  symbol_name);
295  }
296 
297  return cublasSymbols::cublasSaxpy(handle, n, alpha, x, incx, y, incy);
298 }
static cublasSaxpy_type cublasSaxpy

References cublasSymbols::cublasSaxpy, and cublasSymbols::get_lib_name().

Referenced by cublas_interface::cublasXaxpy< float >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cublasScopy()

cublasStatus_t cublasScopy ( cublasHandle_t  handle,
int  n,
const float *  x,
int  incx,
float *  y,
int  incy 
)

Definition of CUDA's cublasScopy function using dynamically loaded cublas library.

Definition at line 219 of file cublas_symbols.cpp.

225 {
226  if (cublasSymbols::cublasScopy == NULL)
227  {
228  std::string lib_name = cublasSymbols::get_lib_name();
229  const char* symbol_name = "cublasScopy_v2";
230 
232  dynamic_loading::load_symbol<cublasScopy_type>(
233  lib_name.c_str(),
234  symbol_name);
235  }
236 
237  return cublasSymbols::cublasScopy(handle, n, x, incx, y, incy);
238 }
static cublasScopy_type cublasScopy

References cublasSymbols::cublasScopy, and cublasSymbols::get_lib_name().

Referenced by cublas_interface::cublasXcopy< float >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cublasSdot()

cublasStatus_t cublasSdot ( cublasHandle_t  handle,
int  n,
const float *  x,
int  incx,
const float *  y,
int  incy,
float *  result 
)

Definition of CUDA's cublasSdot function using dynamically loaded cublas library.

Definition at line 339 of file cublas_symbols.cpp.

347 {
348  if (cublasSymbols::cublasSdot == NULL)
349  {
350  std::string lib_name = cublasSymbols::get_lib_name();
351  const char* symbol_name = "cublasSdot_v2";
352 
354  dynamic_loading::load_symbol<cublasSdot_type>(
355  lib_name.c_str(),
356  symbol_name);
357  }
358 
359  return cublasSymbols::cublasSdot(handle, n, x, incx, y, incy, result);
360 }
static cublasSdot_type cublasSdot

References cublasSymbols::cublasSdot, and cublasSymbols::get_lib_name().

Referenced by cublas_interface::cublasXdot< float >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cublasSgemv_v2()

cublasStatus_t cublasSgemv_v2 ( cublasHandle_t  handle,
cublasOperation_t  trans,
int  m,
int  n,
const float *  alpha,
const float *  A,
int  lda,
const float *  x,
int  incx,
const float *  beta,
float *  y,
int  incy 
)

Definition of CUDA's cublasSgemv function using dynamically loaded cublas library.

Definition at line 145 of file cublas_symbols.cpp.

158 {
159  if (cublasSymbols::cublasSgemv == NULL)
160  {
161  std::string lib_name = cublasSymbols::get_lib_name();
162  const char* symbol_name = "cublasSgemv_v2";
163 
165  dynamic_loading::load_symbol<cublasSgemv_type>(
166  lib_name.c_str(),
167  symbol_name);
168  }
169 
170  return cublasSymbols::cublasSgemv(handle, trans, m, n, alpha, A, lda, x,
171  incx, beta, y, incy);
172 }
static cublasSgemv_type cublasSgemv

References cublasSymbols::cublasSgemv, and cublasSymbols::get_lib_name().

Here is the call graph for this function:

◆ cublasSnrm2()

cublasStatus_t cublasSnrm2 ( cublasHandle_t  handle,
int  n,
const float *  x,
int  incx,
float *  result 
)

Definition of CUDA's cublasSnrm2 function using dynamically loaded cublas library.

Definition at line 401 of file cublas_symbols.cpp.

407 {
408  if (cublasSymbols::cublasSnrm2 == NULL)
409  {
410  std::string lib_name = cublasSymbols::get_lib_name();
411  const char* symbol_name = "cublasSnrm2_v2";
412 
414  dynamic_loading::load_symbol<cublasSnrm2_type>(
415  lib_name.c_str(),
416  symbol_name);
417  }
418 
419  return cublasSymbols::cublasSnrm2(handle, n, x, incx, result);
420 }
static cublasSnrm2_type cublasSnrm2

References cublasSymbols::cublasSnrm2, and cublasSymbols::get_lib_name().

Referenced by cublas_interface::cublasXnrm2< float >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cublasSscal()

cublasStatus_t cublasSscal ( cublasHandle_t  handle,
int  n,
const float *  alpha,
float *  x,
int  incx 
)

Definition of CUDA's cublasSscal function using dynamically loaded cublas library.

Definition at line 459 of file cublas_symbols.cpp.

465 {
466  if (cublasSymbols::cublasSscal == NULL)
467  {
468  std::string lib_name = cublasSymbols::get_lib_name();
469  const char* symbol_name = "cublasSscal_v2";
470 
472  dynamic_loading::load_symbol<cublasSscal_type>(
473  lib_name.c_str(),
474  symbol_name);
475  }
476 
477  return cublasSymbols::cublasSscal(handle, n, alpha, x, incx);
478 }
static cublasSscal_type cublasSscal

References cublasSymbols::cublasSscal, and cublasSymbols::get_lib_name().

Referenced by cublas_interface::cublasXscal< float >().

Here is the call graph for this function:
Here is the caller graph for this function: