-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add cuda-compatible ippl::Tuple with test #250
Conversation
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.
Could use some additional empty lines to space out some things but otherwise seems good.
#include <memory> | ||
#include <Ippl.h> | ||
//#include <Kokkos_Core.hpp> | ||
#define alwaysAssert(X) do{if(!(X)){std::cerr<<"Assertion " << #X << " failed: " << __FILE__ << ": " << __LINE__ << '\n'; exit(-1);}}while(false) |
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 would split this macro over several lines for readability.
However, this program also feels more like a unit test. Instead of building your own assert
, you could just use the ones already in GTest.
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.
Ah yes, that was a bit of a hack, also I just went off tests/vector
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.
@aaadelmann What do you think? I would argue that the nature of this program makes it more suited to be included as a unit test. I had previously argued in favor of trimming most of the test/
programs anyway in favor of converting them to more helpful, illustrative example programs and restricting actual internal testing to either the unit tests or programs that are not tracked with the repository, or just minimal testbeds.
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.
@manuel5975p please open an issue for the unit test! @Arc676 please approve
Add
__device__
-compliantippl::Tuple
type, inspired by std::tupleCurrently only in one file
Types/Tuple.h
, since most functions are trivial one-liners.Some examples:
Arithmetic operators are only enable for tuples in which all types satisfy is_arithmetic
Tests work for Serial, OpenMP and Cuda, including a
parallel_for
and aparallel_reduce
loop.A usecase for this is Boundary Conditions for FDTD (and also general BCs) since the axis along which the wave vanishes should be a template parameter.