-
-
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
Add OpenCL/prim add_diag, diag_matrix, subtract and minor OpenCL fixes #2250
Conversation
use prim util in add tests
…4.1 (tags/RELEASE_600/final)
@@ -185,7 +185,10 @@ class binary_operation : public operation_cl<Derived, T_res, T_a, T_b> { | |||
} | |||
|
|||
ADD_BINARY_OPERATION(addition_, operator+, common_scalar_t<T_a COMMA T_b>, "+"); | |||
ADD_BINARY_OPERATION(subtraction_, operator-, common_scalar_t<T_a COMMA T_b>, | |||
ADD_BINARY_OPERATION(addition_operator_, add, common_scalar_t<T_a COMMA T_b>, "+"); |
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.
You have the class names for addition aroud - the other one is operator. Also it might be better to add a wrapper function for add to delegate to operator instead of constructing another class
@@ -33,8 +33,7 @@ inline void check_diagonal_zeros(const char* function, const char* name, | |||
cl::Context ctx = opencl_context.context(); | |||
try { | |||
int zero_on_diagonal_flag = 0; | |||
matrix_cl<int> zeros_flag(1, 1); | |||
zeros_flag = to_matrix_cl(zero_on_diagonal_flag); | |||
matrix_cl<int> zeros_flag = constant(0, 1, 1); |
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] This looks good, but we could completely replace this function with kernel generator implementation.
Co-authored-by: Tadej Ciglarič <[email protected]>
…4.1 (tags/RELEASE_600/final)
Co-authored-by: Tadej Ciglarič <[email protected]>
…4.1 (tags/RELEASE_600/final)
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
Summary
This PR does the following:
Tests
All new functions have them, add/subtract now use the utility function.
Side Effects
/
Release notes
OpenCL: added prim support for add_diag(), diag_matrix(), subtract(), inv_cloglog() and clenead up superseded kernels/functions zeros and fill.
Checklist
Math issue Implement matrix_cl overloads for prim & rev functions #1854
Copyright holder: Rok Češnovar, Uni. of Ljubljana
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/)