We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Did some testing with your/harris prefix sum code. I'm wondering if cuda does something different here:
fluids3/fluids/prefix_sum.cu
Line 24 in 95ebd2c
Should be changed to:
#define CONFLICT_FREE_OFFSET(index) (((index) >> LOG_NUM_BANKS) + ((index) >> (2*LOG_NUM_BANKS)))
due to C++ Operator Precedence of + over >>. Ran this code to test it:
#include <iostream> #define NUM_BANKS 32 #define LOG_NUM_BANKS 5 #define CONFLICT_FREE_OFFSET_ONCE(n) ((n) >> LOG_NUM_BANKS) #define CONFLICT_FREE_OFFSET_TWICE(n) (((n) >> LOG_NUM_BANKS) + ((n) >> (2 * LOG_NUM_BANKS))) #define CONFLICT_FREE_OFFSET_HARRIS(n) ((n) >> LOG_NUM_BANKS + (n) >> (2 * LOG_NUM_BANKS)) int main(){ for(int i=0 ; i<1024;i++){ int ai = i; int bi = i+1024; std::cout<< i << " bankOffsetA: " << CONFLICT_FREE_OFFSET_ONCE(ai)<< " bankOffsetB: " << CONFLICT_FREE_OFFSET_ONCE(bi) <<" Fluids" <<std::endl; std::cout<< i << " bankOffsetA: " << CONFLICT_FREE_OFFSET_TWICE(ai)<< " bankOffsetB: " << CONFLICT_FREE_OFFSET_TWICE(bi) <<" Test" <<std::endl; std::cout<< i << " bankOffsetA: " << CONFLICT_FREE_OFFSET_HARRIS(ai)<< " bankOffsetB: " << CONFLICT_FREE_OFFSET_HARRIS(bi) <<" Harris" <<std::endl; std::cout<<std::endl; } return 0; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Did some testing with your/harris prefix sum code. I'm wondering if cuda does something different here:
fluids3/fluids/prefix_sum.cu
Line 24 in 95ebd2c
Should be changed to:
due to C++ Operator Precedence of + over >>.
Ran this code to test it:
The text was updated successfully, but these errors were encountered: