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 debugto compile with-DDEBUG(used for checking ofcudaError_treturn types)make releaseadds-O3and--use_fast_math