12 #ifndef PLSSVM_BACKENDS_SYCL_Q_KERNEL_HPP_
13 #define PLSSVM_BACKENDS_SYCL_Q_KERNEL_HPP_
18 #include "sycl/sycl.hpp"
42 q_{ q }, data_d_{ data_d }, data_last_{ data_last }, num_rows_{ num_rows }, feature_range_{ feature_range } {}
52 temp += data_d_[i * num_rows_ + index] * data_last_[i];
90 q_{ q }, data_d_{ data_d }, data_last_{ data_last }, num_rows_{ num_rows }, num_cols_{ num_cols }, degree_{ degree }, gamma_{ gamma }, coef0_{ coef0 } {}
100 temp += data_d_[i * num_rows_ + index] * data_last_[i];
102 q_[index] = ::sycl::pow(gamma_ * temp + coef0_,
static_cast<real_type>(degree_));
123 template <
typename T>
139 q_{ q }, data_d_{ data_d }, data_last_{ data_last }, num_rows_{ num_rows }, num_cols_{ num_cols }, gamma_{ gamma } {}
149 temp += (data_d_[i * num_rows_ + index] - data_last_[i]) * (data_d_[i * num_rows_ + index] - data_last_[i]);
151 q_[index] = ::sycl::exp(-gamma_ * temp);
Functor to calculate the q vector using the linear C-SVM kernel.
Definition: q_kernel.hpp:28
device_kernel_q_linear(real_type *q, const real_type *data_d, const real_type *data_last, const kernel_index_type num_rows, const kernel_index_type feature_range)
Construct a new device kernel calculating the q vector using the linear C-SVM kernel.
Definition: q_kernel.hpp:41
T real_type
The type of the data.
Definition: q_kernel.hpp:31
void operator()(::sycl::id< 1 > index) const
Function call operator overload performing the actual calculation.
Definition: q_kernel.hpp:49
Functor to calculate the q vector using the polynomial C-SVM kernel.
Definition: q_kernel.hpp:73
T real_type
The type of the data.
Definition: q_kernel.hpp:76
device_kernel_q_polynomial(real_type *q, const real_type *data_d, const real_type *data_last, const kernel_index_type num_rows, const kernel_index_type num_cols, const int degree, const real_type gamma, const real_type coef0)
Construct a new device kernel calculating the q vector using the polynomial C-SVM kernel.
Definition: q_kernel.hpp:89
void operator()(::sycl::id< 1 > index) const
Function call operator overload performing the actual calculation.
Definition: q_kernel.hpp:97
Functor to calculate the q vector using the radial basis functions C-SVM kernel.
Definition: q_kernel.hpp:124
T real_type
The type of the data.
Definition: q_kernel.hpp:127
device_kernel_q_rbf(real_type *q, const real_type *data_d, const real_type *data_last, const kernel_index_type num_rows, const kernel_index_type num_cols, const real_type gamma)
Construct a new device kernel calculating the q vector using the radial basis functions C-SVM kernel.
Definition: q_kernel.hpp:138
void operator()(::sycl::id< 1 > index) const
Function call operator overload performing the actual calculation.
Definition: q_kernel.hpp:146
Global type definitions and compile-time constants.
Namespace containing the C-SVM using the SYCL backend with the preferred SYCL implementation....
Definition: atomics.hpp:18
int kernel_index_type
Integer type used inside kernels.
Definition: constants.hpp:19