12 #ifndef PLSSVM_BACKENDS_HIP_Q_KERNEL_HPP_
13 #define PLSSVM_BACKENDS_HIP_Q_KERNEL_HPP_
16 #include "hip/hip_runtime.h"
17 #include "hip/hip_runtime_api.h"
33 template <
typename real_type>
36 real_type temp{ 0.0 };
38 temp += data_d[i * num_rows + index] * data_last[i];
56 template <
typename real_type>
59 real_type temp{ 0.0 };
61 temp += data_d[i * num_rows + index] * data_last[i];
63 q[index] = pow(gamma * temp + coef0, degree);
77 template <
typename real_type>
80 real_type temp{ 0.0 };
82 temp += (data_d[i * num_rows + index] - data_last[i]) * (data_d[i * num_rows + index] - data_last[i]);
84 q[index] = exp(-gamma * temp);
Global type definitions and compile-time constants.
Namespace containing the C-SVM using the HIP backend.
Definition: csvm.hpp:34
__global__ void 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)
Calculates the q vector using the polynomial C-SVM kernel.
Definition: q_kernel.hip.hpp:57
__global__ void 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)
Calculates the q vector using the linear C-SVM kernel.
Definition: q_kernel.hip.hpp:34
__global__ void 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)
Calculates the q vector using the radial basis functions C-SVM kernel.
Definition: q_kernel.hip.hpp:78
int kernel_index_type
Integer type used inside kernels.
Definition: constants.hpp:19