mlberkeley / CUDA-intro

Example of how to use cuda

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CUDA_intro

Setup

Add the following lines to your ~/.profile to add nvcc to the path:

export PATH="/usr/local/cuda-11.6/bin:$PATH"
export PATH="~/.local/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-11.6/lib64:$LD_LIBRARY_PATH"

Create a virtual env and install numba:

python -m venv venv
source venv/bin/activate
pip install numba cuda-python numpy

vec_add

Implement a vector add function in CUDA C++

Build: make build

Run: make run

numba

Implement a vector add function in Python using Numba

Run: make run

About

Example of how to use cuda


Languages

Language:Cuda 62.5%Language:Python 30.8%Language:Makefile 6.7%