-
Notifications
You must be signed in to change notification settings - Fork 6
CabanaSliceFactory now works with multiple types. #3
New issue
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
Conversation
fixed build errors, swapped ExecutionSpace and MemorySpace
…multiple of 4 bytes
cwsmith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. There is one small change in the driver and a comment about a future cleanup/revision to the interface.
…e is now used for tests
| template <class ExecutionSpace, class MemorySpace, class T, int width, int vecLen> | ||
| template <class ExecutionSpace, class MemorySpace, class... Ts> | ||
| class CabSliceFactory { | ||
| static constexpr int vecLen = Impl::PerformanceTraits<ExecutionSpace>::vector_length/8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the division by 8? Is the vector_length reported in bits?
Can you point me at where Cabana uses this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I divided it by eight because when I changed to this vector length instead of the user defined one, the stride calculation got messed up, being eight times larger than it should have been which gave me errors. I have just revised the calculation to be correct and not divide the vector length by 8.
Cabana uses this here as a default template parameter for the AoSoA
https://github.com/ECP-copa/Cabana/blob/1c44a7fef24b61f73e629ddd2084c4d05b0ec977/core/src/Cabana_AoSoA.hpp#L146:~:text=int%20VectorLength%20%3D%20Impl,DeviceType%3A%3Aexecution_space%3E%3A%3Avector_length
|
|
||
| int main(int argc, char* argv[]) { | ||
| // AoSoA parameters | ||
| const int vecLen = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this still be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope. It will be removed in the next version
| auto slice_wrapper3 = cabSliceFactory.makeSliceCab<3>(); | ||
|
|
||
| // simd_parallel_for setup | ||
| Cabana::SimdPolicy<vecLen, ExecutionSpace> simd_policy(0, num_tuples); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we eliminate the vecLen here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
No description provided.