Automatic Differentiation
 
Loading...
Searching...
No Matches
matrix_vector_multiply.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_KERNEL_GENERATOR_MATRIX_VECTOR_MULTIPLY_HPP
2#define STAN_MATH_OPENCL_KERNEL_GENERATOR_MATRIX_VECTOR_MULTIPLY_HPP
3#ifdef STAN_OPENCL
4
10#include <utility>
11
12namespace stan {
13namespace math {
14
25template <typename T_matrix, typename T_vector,
26 typename = require_all_kernel_expressions_t<T_matrix, T_vector>>
27inline auto matrix_vector_multiply(T_matrix&& matrix, T_vector&& vector) {
29 std::forward<T_matrix>(matrix),
30 colwise_broadcast(transpose(std::forward<T_vector>(vector)))));
31}
32
33} // namespace math
34} // namespace stan
35
36#endif
37#endif
elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > elt_multiply(T_a &&a, T_b &&b)
auto transpose(Arg &&a)
Transposes a kernel generator expression.
auto rowwise_sum(T &&a)
Rowwise sum reduction of a kernel generator expression.
auto colwise_broadcast(T &&a)
Broadcast an expression in colwise dimmension.
auto matrix_vector_multiply(T_matrix &&matrix, T_vector &&vector)
Multiplies a matrix and a vector on an OpenCL device.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9