12 #ifndef PLSSVM_BACKENDS_HIP_DETAIL_DEVICE_PTR_HPP_
13 #define PLSSVM_BACKENDS_HIP_DETAIL_DEVICE_PTR_HPP_
Small wrapper class around a GPU device pointer together with commonly used device functions for all ...
Definition: gpu_device_ptr.hpp:29
const value_type * const_host_pointer_type
The const type of the host pointer corresponding to the wrapped device pointer.
Definition: gpu_device_ptr.hpp:39
queue_type queue_
The device queue used to manage the device memory associated with this device pointer.
Definition: gpu_device_ptr.hpp:234
T value_type
The type of the values used in the device_ptr.
Definition: gpu_device_ptr.hpp:35
T * device_pointer_type
The type of the device pointer.
Definition: gpu_device_ptr.hpp:45
size_type size() const noexcept
Get the number of elements in the wrapped device_ptr.
Definition: gpu_device_ptr.hpp:121
int queue_type
The type of the device queue used to manipulate the managed device memory.
Definition: gpu_device_ptr.hpp:43
size_type size_
The size of the managed memory.
Definition: gpu_device_ptr.hpp:238
device_pointer_type data_
The device pointer pointing to the managed memory.
Definition: gpu_device_ptr.hpp:236
value_type * host_pointer_type
The type of the host pointer corresponding to the wrapped device pointer.
Definition: gpu_device_ptr.hpp:37
void fill(value_type value, size_type pos=0)
Fill all values with the value starting at position pos.
void copy_to_host(std::vector< value_type > &buffer) const
Copy device_ptr::size() many values from the device to the host buffer buffer.
void copy_to_device(const std::vector< value_type > &data_to_copy)
Copy device_ptr::size() many values from data_to_copy to the device.
void memset(int pattern, size_type pos=0)
Memset all bytes using the pattern starting at position pos.
std::size_t size_type
The used size type.
Definition: gpu_device_ptr.hpp:41
Small wrapper class around a HIP device pointer together with commonly used device functions.
Definition: device_ptr.hip.hpp:25
device_ptr & operator=(const device_ptr &)=delete
Delete copy-assignment-operator to make device_ptr a move only type.
device_ptr()=default
Default construct a HIP device_ptr with a size of 0.
device_ptr(const device_ptr &)=delete
Delete copy-constructor to make device_ptr a move only type.
void memset(int pattern, size_type pos, size_type num_bytes) override
Memset up-to num_bytes values to pattern starting at position pos.
~device_ptr() override
Free the memory managed by the device_ptr.
device_ptr(size_type size, queue_type device=0)
Allocates size * sizeof(T) bytes on the device with ID device.
void copy_to_device(const_host_pointer_type data_to_copy, size_type pos, size_type count) override
Copy up-to count many values from data_to_copy to the device starting at device pointer position pos.
void copy_to_host(host_pointer_type buffer, size_type pos, size_type count) const override
Copy up-to count many values from the device starting at device pointer position pos to the host buff...
device_ptr(device_ptr &&other) noexcept=default
Move-constructor as device_ptr is a move-only type.
void fill(value_type value, size_type pos, size_type count) override
Fill up-to count values to value starting at position pos.
device_ptr & operator=(device_ptr &&other) noexcept=default
Move-assignment-operator as device_ptr is a move-only type.
Defines the base class for all C-SVM backends using a GPU. Used for code duplication reduction.
Namespace containing HIP backend specific implementation details. Should not directly be used by user...
Definition: device_ptr.hip.hpp:18