- CUDA Toolkit
In linux execute the following to install:
sudo apt install nvidia-cuda-toolkit
If you are importing this library in your code, compile your code using nvcc.
Sample:
nvcc myprogram.cpp -o output.exe
- Vector Addition
- Vector Substraction
- Vector dot product
- Multiplication with constantt
- Division with constant
// Two vectors of size 10
CudaVector<int> a(10);
CudaVector<int> b(10);
CudaVector<int> c = a + b;
for(int i=0; i<c.size(); i++)
std::cout<<c[i]<<", ";
cout<<std::endl;