imate
C++/CUDA Reference
Loading...
Searching...
No Matches
cublas_symbols.cpp File Reference
#include "./cublas_symbols.h"
#include <cstdlib>
#include <sstream>
#include "./dynamic_loading.h"
#include <cublas_api.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.
 
cublasStatus_t cublasDestroy_v2 (cublasHandle_t handle)
 Definition of CUDA's cublasDestroy function using dynamically loaded cublas library.
 
cublasStatus_t cublasSetMathMode (cublasHandle_t handle, cublasMath_t mode)
 Definition of CUDA's cublasSetmathMode function using dynamically loaded cublas library.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 

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 114 of file cublas_symbols.cpp.

115{
116 if (cublasSymbols::cublasCreate == NULL)
117 {
118 std::string lib_name = cublasSymbols::get_lib_name();
119 const char* symbol_name = "cublasCreate_v2";
120
122 dynamic_loading::load_symbol<cublasCreate_type>(
123 lib_name.c_str(),
124 symbol_name);
125 }
126
127 return cublasSymbols::cublasCreate(handle);
128}
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 353 of file cublas_symbols.cpp.

361{
362 if (cublasSymbols::cublasDaxpy == NULL)
363 {
364 std::string lib_name = cublasSymbols::get_lib_name();
365 const char* symbol_name = "cublasDaxpy_v2";
366
368 dynamic_loading::load_symbol<cublasDaxpy_type>(
369 lib_name.c_str(),
370 symbol_name);
371 }
372
373 return cublasSymbols::cublasDaxpy(handle, n, alpha, x, incx, y, incy);
374}
static cublasDaxpy_type cublasDaxpy

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

Referenced by cublas_api::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 293 of file cublas_symbols.cpp.

299{
300 if (cublasSymbols::cublasDcopy == NULL)
301 {
302 std::string lib_name = cublasSymbols::get_lib_name();
303 const char* symbol_name = "cublasDcopy_v2";
304
306 dynamic_loading::load_symbol<cublasDcopy_type>(
307 lib_name.c_str(),
308 symbol_name);
309 }
310
311 return cublasSymbols::cublasDcopy(handle, n, x, incx, y, incy);
312}
static cublasDcopy_type cublasDcopy

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

Referenced by cublas_api::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 415 of file cublas_symbols.cpp.

423{
424 if (cublasSymbols::cublasDdot == NULL)
425 {
426 std::string lib_name = cublasSymbols::get_lib_name();
427 const char* symbol_name = "cublasDdot_v2";
428
430 dynamic_loading::load_symbol<cublasDdot_type>(
431 lib_name.c_str(),
432 symbol_name);
433 }
434
435 return cublasSymbols::cublasDdot(handle, n, x, incx, y, incy, result);
436}
static cublasDdot_type cublasDdot

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

Referenced by cublas_api::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 139 of file cublas_symbols.cpp.

140{
142 {
143 std::string lib_name = cublasSymbols::get_lib_name();
144 const char* symbol_name = "cublasDestroy_v2";
145
147 dynamic_loading::load_symbol<cublasDestroy_type>(
148 lib_name.c_str(),
149 symbol_name);
150 }
151
152 return cublasSymbols::cublasDestroy(handle);
153}
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 227 of file cublas_symbols.cpp.

240{
241 if (cublasSymbols::cublasDgemv == NULL)
242 {
243 std::string lib_name = cublasSymbols::get_lib_name();
244 const char* symbol_name = "cublasDgemv_v2";
245
247 dynamic_loading::load_symbol<cublasDgemv_type>(
248 lib_name.c_str(),
249 symbol_name);
250 }
251
252 return cublasSymbols::cublasDgemv(handle, trans, m, n, alpha, A, lda, x,
253 incx, beta, y, incy);
254}
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 475 of file cublas_symbols.cpp.

481{
482 if (cublasSymbols::cublasDnrm2 == NULL)
483 {
484 std::string lib_name = cublasSymbols::get_lib_name();
485 const char* symbol_name = "cublasDnrm2_v2";
486
488 dynamic_loading::load_symbol<cublasDnrm2_type>(
489 lib_name.c_str(),
490 symbol_name);
491 }
492
493 return cublasSymbols::cublasDnrm2(handle, n, x, incx, result);
494}
static cublasDnrm2_type cublasDnrm2

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

Referenced by cublas_api::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 533 of file cublas_symbols.cpp.

539{
540 if (cublasSymbols::cublasDscal == NULL)
541 {
542 std::string lib_name = cublasSymbols::get_lib_name();
543 const char* symbol_name = "cublasDscal_v2";
544
546 dynamic_loading::load_symbol<cublasDscal_type>(
547 lib_name.c_str(),
548 symbol_name);
549 }
550
551 return cublasSymbols::cublasDscal(handle, n, alpha, x, incx);
552}
static cublasDscal_type cublasDscal

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

Referenced by cublas_api::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 322 of file cublas_symbols.cpp.

330{
331 if (cublasSymbols::cublasSaxpy == NULL)
332 {
333 std::string lib_name = cublasSymbols::get_lib_name();
334 const char* symbol_name = "cublasSaxpy_v2";
335
337 dynamic_loading::load_symbol<cublasSaxpy_type>(
338 lib_name.c_str(),
339 symbol_name);
340 }
341
342 return cublasSymbols::cublasSaxpy(handle, n, alpha, x, incx, y, incy);
343}
static cublasSaxpy_type cublasSaxpy

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

Referenced by cublas_api::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 264 of file cublas_symbols.cpp.

270{
271 if (cublasSymbols::cublasScopy == NULL)
272 {
273 std::string lib_name = cublasSymbols::get_lib_name();
274 const char* symbol_name = "cublasScopy_v2";
275
277 dynamic_loading::load_symbol<cublasScopy_type>(
278 lib_name.c_str(),
279 symbol_name);
280 }
281
282 return cublasSymbols::cublasScopy(handle, n, x, incx, y, incy);
283}
static cublasScopy_type cublasScopy

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

Referenced by cublas_api::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 384 of file cublas_symbols.cpp.

392{
393 if (cublasSymbols::cublasSdot == NULL)
394 {
395 std::string lib_name = cublasSymbols::get_lib_name();
396 const char* symbol_name = "cublasSdot_v2";
397
399 dynamic_loading::load_symbol<cublasSdot_type>(
400 lib_name.c_str(),
401 symbol_name);
402 }
403
404 return cublasSymbols::cublasSdot(handle, n, x, incx, y, incy, result);
405}
static cublasSdot_type cublasSdot

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

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

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

◆ cublasSetMathMode()

cublasStatus_t cublasSetMathMode ( cublasHandle_t  handle,
cublasMath_t  mode 
)

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

Definition at line 164 of file cublas_symbols.cpp.

167{
169 {
170 std::string lib_name = cublasSymbols::get_lib_name();
171 const char* symbol_name = "cublasSetMathMode_v2";
172
174 dynamic_loading::load_symbol<cublasSetMathMode_type>(
175 lib_name.c_str(),
176 symbol_name);
177 }
178
179 return cublasSymbols::cublasSetMathMode(handle, mode);
180}
static cublasSetMathMode_type cublasSetMathMode

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

Referenced by cuLinearOperator< DataType >::initialize_cublas_handle().

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 190 of file cublas_symbols.cpp.

203{
204 if (cublasSymbols::cublasSgemv == NULL)
205 {
206 std::string lib_name = cublasSymbols::get_lib_name();
207 const char* symbol_name = "cublasSgemv_v2";
208
210 dynamic_loading::load_symbol<cublasSgemv_type>(
211 lib_name.c_str(),
212 symbol_name);
213 }
214
215 return cublasSymbols::cublasSgemv(handle, trans, m, n, alpha, A, lda, x,
216 incx, beta, y, incy);
217}
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 446 of file cublas_symbols.cpp.

452{
453 if (cublasSymbols::cublasSnrm2 == NULL)
454 {
455 std::string lib_name = cublasSymbols::get_lib_name();
456 const char* symbol_name = "cublasSnrm2_v2";
457
459 dynamic_loading::load_symbol<cublasSnrm2_type>(
460 lib_name.c_str(),
461 symbol_name);
462 }
463
464 return cublasSymbols::cublasSnrm2(handle, n, x, incx, result);
465}
static cublasSnrm2_type cublasSnrm2

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

Referenced by cublas_api::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 504 of file cublas_symbols.cpp.

510{
511 if (cublasSymbols::cublasSscal == NULL)
512 {
513 std::string lib_name = cublasSymbols::get_lib_name();
514 const char* symbol_name = "cublasSscal_v2";
515
517 dynamic_loading::load_symbol<cublasSscal_type>(
518 lib_name.c_str(),
519 symbol_name);
520 }
521
522 return cublasSymbols::cublasSscal(handle, n, alpha, x, incx);
523}
static cublasSscal_type cublasSscal

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

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

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