PLSSVM - Parallel Least Squares Support Vector Machine  2.0.0
A Least Squares Support Vector Machine implementation using different backends.
Classes | Functions
plssvm::hip::detail Namespace Reference

Namespace containing HIP backend specific implementation details. Should not directly be used by users. More...

Classes

class  device_ptr
 Small wrapper class around a HIP device pointer together with commonly used device functions. More...
 

Functions

template<typename value_type , typename size_type >
__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. More...
 
void gpu_assert (hipError_t code)
 Check the HIP error code. If code signals an error, throw a plssvm::hip::backend_exception. More...
 
int get_device_count ()
 Returns the number of available HIP devices. More...
 
void set_device (int device)
 Set the device to the active HIP device. More...
 
void peek_at_last_error ()
 Returns the last error from a HIP runtime call.
 
void device_synchronize (int device)
 Wait for the compute device to finish. More...
 

Detailed Description

Namespace containing HIP backend specific implementation details. Should not directly be used by users.

Function Documentation

◆ fill_array()

template<typename value_type , typename size_type >
__global__ void plssvm::hip::detail::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.

Template Parameters
value_typethe type of the array
size_typethe unsigned size_type
Parameters
[in,out]datathe array to fill
[in]valuethe value to fill the array with
[in]posthe position at which to start te filling
[in]countthe number of values to fill in the array starting at pos

◆ gpu_assert()

void plssvm::hip::detail::gpu_assert ( hipError_t  code)

Check the HIP error code. If code signals an error, throw a plssvm::hip::backend_exception.

The exception contains the following message: "HIP assert 'HIP_ERROR_NAME' (HIP_ERROR_CODE): HIP_ERROR_STRING".

Parameters
[in]codethe HIP error code to check
Exceptions
plssvm::hip::backend_exceptionif the error code signals a failure

◆ get_device_count()

int plssvm::hip::detail::get_device_count ( )

Returns the number of available HIP devices.

Returns
the number of devices ([[nodiscard]])

◆ set_device()

void plssvm::hip::detail::set_device ( int  device)

Set the device to the active HIP device.

Parameters
[in]devicethe now active device
Exceptions
plssvm::hip::backend_exceptionif the given device ID is smaller than 0 or greater or equal than the available number of devices

◆ device_synchronize()

void plssvm::hip::detail::device_synchronize ( int  device)

Wait for the compute device to finish.

Calls plssvm::hip::detail::peek_at_last_error() before synchronizing.

Parameters
[in]devicethe HIP device to synchronize
Exceptions
plssvm::hip::backend_exceptionif the given device ID is smaller than 0 or greater or equal than the available number of devices