1#ifndef STAN_MATH_OPENCL_ZEROS_HPP
2#define STAN_MATH_OPENCL_ZEROS_HPP
12#include <CL/opencl.hpp>
31template <matrix_cl_view matrix_view>
35 "zeros_strict_tri",
"matrix_view",
36 "matrix_cl_view::Entire is not a valid template parameter value",
"");
40 "zeros_strict_tri",
"matrix_view",
41 "matrix_cl_view::Diagonal is not a valid template parameter value",
"");
43 if (this->
size() == 0) {
46 this->view_ =
both(this->view_,
invert(matrix_view));
49 *
this, 0.0, this->
rows(), this->
cols(),
51}
catch (
const cl::Error&
e) {
The API to access the methods and values in opencl_context_base.
void check_opencl_error(const char *function, const cl::Error &e)
Throws the domain error with specifying the OpenCL error that occurred.
void zeros_strict_tri()
Stores zeros in the strict's triangular part (excluding the diagonal) of a matrix on the OpenCL devic...
cl::CommandQueue & queue() noexcept
Returns the reference to the active OpenCL command queue for the device.
const kernel_cl< out_buffer, double, int, int, matrix_cl_view > fill_strict_tri("fill_strict_tri", {indexing_helpers, view_kernel_helpers, fill_strict_tri_kernel_code})
See the docs for fill_strict_tri_kernel_code() .
int64_t cols(const T_x &x)
Returns the number of columns in the specified kernel generator expression.
const matrix_cl_view both(const matrix_cl_view left_view, const matrix_cl_view right_view)
Determines which parts are nonzero in both input views.
int64_t rows(const T_x &x)
Returns the number of rows in the specified kernel generator expression.
const matrix_cl_view invert(const matrix_cl_view view)
Inverts a view.
int64_t size(const T &m)
Returns the size (number of the elements) of a matrix_cl or var_value<matrix_cl<T>>.
static constexpr double e()
Return the base of the natural logarithm.
void invalid_argument(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
Throw an invalid_argument exception with a consistently formatted message.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...