A basic set of CUDA examples for educational purposes.
vecAdd.cu
: [N]+[N] vector additionmatAdd.cu
: [MxN]+[MxN] matrix additionmatHad.cu
: [MxN]⊙[MxN] Hadamard (element-wise) productmatMul.cu
: [MxN][NxP] matrix multiplication (naive)transpose.cu
: Tiled matrix transpose (with avoidance of memory bank conflicts)coalesced.cu
: Coalesced memory accessstats.cu
: displays some GPU device information fromcudaGetDeviceProperties()
Makefile automatically detects all .cu
files and compiles with nvcc
.
git clone https://github.com/LDRyan0/CUDA-Examples.git
cd CUDA-Examples/src/
make
make debug
to compile with-DDEBUG
(used for checking ofcudaError_t
return types)make release
adds-O3
and--use_fast_math