GPUPeople / spECK

Efficient SpGEMM on GPU using CUDA and CSR
MIT License
50 stars 16 forks source link

one code snippet makes me confused, I wonder if its valid #8

Closed zzzlxhhh closed 2 years ago

zzzlxhhh commented 2 years ago

Sorry to bother you. I find one code snippet in the function [readOperations] in "include/common.cuh" file confusing.
image

I'm confused about the use of atomicadd. here, we want the maxComputationsPerRow, so I think we should use atomicmax instead. You all have done a great work in SpGEMM giving such a elegent code. So far, I've learnt a lot from your work. But I'm confused about how atomicadd works here. It would be highly appreciated if you can give some hints.

dabeschte commented 2 years ago

Sorry, I forgot to write back. You are of course absolutely right. Fortunately, this does not seem like it would cause any problems besides potentially allocating more resources per row and therefore running slower than it had to.

I will take a quick look at the code and see if using atomicMax here hopefully does not cause any issues.

Thanks for letting me know! And sorry for taking so long

dabeschte commented 2 years ago

Yes, looks like atomicMax works. Which also makes a lot of sense. Reads like a typical copy&paste error. Thanks again :)

zzzlxhhh commented 2 years ago

Glad we fixed it!