-
-
Notifications
You must be signed in to change notification settings - Fork 190
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 OpenCL ref_type #2404
added OpenCL ref_type #2404
Conversation
…4.1 (tags/RELEASE_600/final)
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. One test suggestion
: public is_trivial_kg_expression<std::decay_t<T>> {}; | ||
template <typename T> | ||
struct is_trivial_kg_expression<math::calc_if_<true, T>> | ||
: public is_trivial_kg_expression<std::decay_t<T>> {}; |
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.
[optional] Only suggestion I here is that for each one of these just do a double check test:
EXPECT_TRUE(std::is_same<calc_if_<false, T1>, the_other_expected_type>::value);
EXPECT_TRUE(std::is_same<calc_if_<true, T2>, the_expected_type>::value);
So don't worry about the reference behavior or checking values (current tests cover that) -- just check the type calculations.
I guess these things are trivially true here in the code but if something broke in the future it would be easier to figure it out with an explicit test than reverse engineering it from wherever it does break.
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.
Half of these definitions are recursive - the value depends on child expression. Also types listed here are just ones that can be trivial. There are many other expressions that can not be trivial. So I think writing tests for ~100 different cases is not worth it, given how simple the implementation is.
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
Summary
Added reference (
ref_type
) for kernel generator expressions.ref_type_for_opencl_test.cpp
is not a new file; it has been renamed fromref_type_test.cpp
.Tests
Added tests for OpenCL
ref_type
.Side Effects
None.
Release notes
Added reference (
ref_type
) for kernel generator expressions.Checklist
Math issue #(issue number)
Copyright holder: Tadej Ciglarič
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested