Skip to content

kathsucurry/cuda_reduction_sum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reduction (Sum)

This code repo corresponds to the "Reduction (Sum)" blog post series:

Setup

mkdir build && cd build
cmake ..
cmake --build .

Notes

The threads in Kernel 0 to 3 only process one element each, i.e., num_elements_per_batch and NUM_THREADS_PER_BATCH must be identical. If the values differ, it would cause incorrect sum error since each thread only processes one element.

Similarly, num_elements_per_batch for running Kernel 7 has to be NUM_THREADS_PER_BATCH * <multiple of 4>.

A next step for cleaner code and easier usage is to automate or add additional checks to prevent the issues above.

Resources

About

Implement and optimize reduction (sum) algorithm with CUDA.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors