This code demonstrates a usage of cuBLAS rotg
function to apply the Givens rotation matrix to vector x and y
A = 2.10
B = 1.20
This functions zeros out the second entry of a 2 x 1 vector (a,b)T
See documentation for further details.
All GPUs supported by CUDA Toolkit (https://developer.nvidia.com/cuda-gpus)
Linux
Windows
x86_64
ppc64le
arm64-sbsa
- A Linux/Windows system with recent NVIDIA drivers.
- CMake version 3.18 minimum
$ mkdir build
$ cd build
$ cmake ..
$ make
Make sure that CMake finds expected CUDA Toolkit. If that is not the case you can add argument -DCMAKE_CUDA_COMPILER=/path/to/cuda/bin/nvcc
to cmake command.
$ mkdir build
$ cd build
$ cmake -DCMAKE_GENERATOR_PLATFORM=x64 ..
$ Open cublas_examples.sln project in Visual Studio and build
$ ./cublas_rotg_example
Sample example output:
A
2.10
=====
B
1.20
=====
A
2.42
=====
B
0.50
=====