Skip to content
Snippets Groups Projects
Commit 4e84ed59 authored by David Hrbáč's avatar David Hrbáč
Browse files

Links OK

parent 86fb5118
No related branches found
No related tags found
5 merge requests!368Update prace.md to document the change from qprace to qprod as the default...,!367Update prace.md to document the change from qprace to qprod as the default...,!366Update prace.md to document the change from qprace to qprod as the default...,!323extended-acls-storage-section,!219Virtual environment, upgrade MKdocs, upgrade Material design
...@@ -197,11 +197,11 @@ $ ./test.cuda ...@@ -197,11 +197,11 @@ $ ./test.cuda
### cuBLAS ### cuBLAS
The NVIDIA CUDA Basic Linear Algebra Subroutines (cuBLAS) library is a GPU-accelerated version of the complete standard BLAS library with 152 standard BLAS routines. A basic description of the library together with basic performance comparisons with MKL can be found [here](https://developer.nvidia.com/cublas "Nvidia cuBLAS"). The NVIDIA CUDA Basic Linear Algebra Subroutines (cuBLAS) library is a GPU-accelerated version of the complete standard BLAS library with 152 standard BLAS routines. A basic description of the library together with basic performance comparisons with MKL can be found [here][a].
#### cuBLAS Example: SAXPY #### cuBLAS Example: SAXPY
The SAXPY function multiplies the vector x by the scalar alpha, and adds it to the vector y, overwriting the latest vector with the result. A description of the cuBLAS function can be found in [NVIDIA CUDA documentation](http://docs.nvidia.com/cuda/cublas/index.html#cublas-lt-t-gt-axpy "Nvidia CUDA documentation "). Code can be pasted in the file and compiled without any modification. The SAXPY function multiplies the vector x by the scalar alpha, and adds it to the vector y, overwriting the latest vector with the result. A description of the cuBLAS function can be found in [NVIDIA CUDA documentation][b]. Code can be pasted in the file and compiled without any modification.
```cpp ```cpp
/* Includes, system */ /* Includes, system */
...@@ -283,8 +283,8 @@ int main(int argc, char **argv) ...@@ -283,8 +283,8 @@ int main(int argc, char **argv)
!!! note !!! note
cuBLAS has its own function for data transfers between CPU and GPU memory: cuBLAS has its own function for data transfers between CPU and GPU memory:
- [cublasSetVector](http://docs.nvidia.com/cuda/cublas/index.html#cublassetvector) - transfers data from CPU to GPU memory - [cublasSetVector][c] - transfers data from CPU to GPU memory
- [cublasGetVector](http://docs.nvidia.com/cuda/cublas/index.html#cublasgetvector) - transfers data from GPU to CPU memory - [cublasGetVector][d] - transfers data from GPU to CPU memory
To compile the code using the NVCC compiler a "-lcublas" compiler flag has to be specified: To compile the code using the NVCC compiler a "-lcublas" compiler flag has to be specified:
...@@ -307,3 +307,8 @@ $ ml cuda ...@@ -307,3 +307,8 @@ $ ml cuda
$ ml intel $ ml intel
$ icc -std=c99 test_cublas.c -o test_cublas_icc -lcublas -lcudart $ icc -std=c99 test_cublas.c -o test_cublas_icc -lcublas -lcudart
``` ```
[a]: https://developer.nvidia.com/cublas
[b]: http://docs.nvidia.com/cuda/cublas/index.html#cublas-lt-t-gt-axpy
[c]: http://docs.nvidia.com/cuda/cublas/index.html#cublassetvector
[d]: http://docs.nvidia.com/cuda/cublas/index.html#cublasgetvector
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment