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

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

Classes

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

Functions

template<typename value_type , typename size_type >
__global__ void fill_array (value_type *data, const value_type value, const size_type pos, const size_type count)
 Fill count values of the array data with the value starting at position pos. More...
 
void gpu_assert (cudaError_t code)
 Check the CUDA error code. If code signals an error, throw a plssvm::cuda::backend_exception. More...
 
int get_device_count ()
 Returns the number of available CUDA devices. More...
 
void set_device (int device)
 Set the device to the active CUDA device. More...
 
void peek_at_last_error ()
 Returns the last error from a CUDA runtime call.
 
void device_synchronize (int device)
 Wait for the compute device to finish. More...
 

Detailed Description

Namespace containing CUDA 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::cuda::detail::fill_array ( value_type *  data,
const value_type  value,
const size_type  pos,
const size_type  count 
)

Fill count values of the array data with the value starting at position pos.

Template Parameters
value_typethe type of the array and fill value
size_typethe size type
Parameters
[out]datathe array to fill
[in]valuethe value to fill the array with
[in]posthe position to start filling the array
[in]countthe number of values to fill

◆ gpu_assert()

void plssvm::cuda::detail::gpu_assert ( cudaError_t  code)

Check the CUDA error code. If code signals an error, throw a plssvm::cuda::backend_exception.

The exception contains the following message: "CUDA assert 'CUDA_ERROR_NAME' (CUDA_ERROR_CODE): CUDA_ERROR_STRING".

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

◆ get_device_count()

int plssvm::cuda::detail::get_device_count ( )

Returns the number of available CUDA devices.

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

◆ set_device()

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

Set the device to the active CUDA device.

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

◆ device_synchronize()

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

Wait for the compute device to finish.

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

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