PLSSVM - Parallel Least Squares Support Vector Machine  2.0.0
A Least Squares Support Vector Machine implementation using different backends.
fill_kernel.hip.hpp
Go to the documentation of this file.
1 
12 #ifndef PLSSVM_BACKENDS_HIP_DETAIL_FILL_KERNEL_HPP_
13 #define PLSSVM_BACKENDS_HIP_DETAIL_FILL_KERNEL_HPP_
14 #pragma once
15 
16 #include "hip/hip_runtime.h" // HIP runtime functions
17 #include "hip/hip_runtime_api.h" // HIP runtime functions
18 
19 namespace plssvm::hip::detail {
20 
30 template <typename value_type, typename size_type>
31 __global__ void fill_array(value_type *data, value_type value, size_type pos, size_type count) {
32  const unsigned int idx = blockIdx.x * blockDim.x + threadIdx.x;
33  // fill the array
34  if (idx < count) {
35  data[pos + idx] = value;
36  }
37 }
38 
39 } // namespace plssvm::hip::detail
40 
41 #endif // PLSSVM_BACKENDS_HIP_DETAIL_FILL_KERNEL_HPP_
Namespace containing HIP backend specific implementation details. Should not directly be used by user...
Definition: device_ptr.hip.hpp:18
__global__ void fill_array(value_type *data, value_type value, size_type pos, size_type count)
Fill the array data with count values value starting at position pos.
Definition: fill_kernel.hip.hpp:31