1#ifndef STAN_MATH_OPENCL_PRIM_GP_EXP_QUAD_COV_HPP
2#define STAN_MATH_OPENCL_PRIM_GP_EXP_QUAD_COV_HPP
10#include <CL/opencl.hpp>
26template <
typename T1,
typename T2,
typename T3,
27 typename = require_all_arithmetic_t<T1, T2, T3>>
29 const matrix_cl<T1>& x,
const T2 sigma,
const T3 length_scale) {
33 sigma * sigma, -0.5 /
square(length_scale),
35 }
catch (
const cl::Error&
e) {
58template <
typename T1,
typename T2,
typename T3,
typename T4,
62 const T4 length_scale) {
67 cl::NDRange(x.
cols(), y.
cols()), x, y, res, sigma * sigma,
69 }
catch (
const cl::Error&
e) {
Represents an arithmetic matrix on the OpenCL device.
require_all_t< std::is_arithmetic< std::decay_t< Types > >... > require_all_arithmetic_t
Require all of the types satisfy std::is_arithmetic.
void check_opencl_error(const char *function, const cl::Error &e)
Throws the domain error with specifying the OpenCL error that occurred.
const kernel_cl< in_buffer, in_buffer, out_buffer, double, double, int, int, int > gp_exp_quad_cov_cross("gp_exp_quad_cov_cross", {gp_exp_quad_cov_cross_kernel_code})
See the docs for gp_exp_quad_cov_cross() .
const kernel_cl< in_buffer, out_buffer, double, double, int, int > gp_exp_quad_cov("gp_exp_quad_cov", {gp_exp_quad_cov_kernel_code})
See the docs for gp_exp_quad_cov() .
matrix_cl< return_type_t< T1, T2, T3 > > gp_exp_quad_cov(const matrix_cl< T1 > &x, const T2 sigma, const T3 length_scale)
Squared exponential kernel on the GPU.
static constexpr double e()
Return the base of the natural logarithm.
void check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Check if the provided sizes match.
fvar< T > square(const fvar< T > &x)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...