-
Notifications
You must be signed in to change notification settings - Fork 75
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
Added tests for existing math operators #828
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.
Thanks for your first PR. Only a few small changes are required
All the build jobs complain about some compilation issues. Are you working on it? |
Actually I do not really like the code because of the functions pointers (it is also not working). I discussed with @psychocoderHPC again, and that I like the simple row-wise-like enumeration of the related math functions+range. // sketching a possible functor layout for math test
struct TestOpFoo {
static constexpr Range range = Range::Unrestricted;
static constexpr OpType optype = OpType::Unary;
ALPAKA_FN_ACC
template<typename T>
auto operator() ( T arg1 ) -> T {
return alpaka::math::foo( arg1 );
}
ALPAKA_FN_HOST
template<typename T>
auto expect( T arg1 ) -> T {
return std::foo(arg1);
}
};
// creating a tuple with all the Ops, passing it to single kernel
// OR using a compile-time foreach, invoking a kernel for each functor
... Then for each math function a functor has to be written and registered for the test kernel. Just need a clean way to compact functors and their processing ... Btw, code-style should be discussed, too ( eg. curly braces for initialization, except for elemental types, where assignment is ok, like in for-loops ). Edits: typo + edit after 1st paragraph |
re-written and pushed in #847 separately, so closing this. |
Tested StdLib-backend fully.
Tested Cuda-backend compiling.
Not tested Hip-backend.
Edit: Refractored Code according to https://github.com/ComputationalRadiationPhysics/contributing/blob/master/codingGuideLines/cpp.md.