ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
ActsPlugins::Device Struct Reference

A simple device description struct. More...

#include <ActsPlugins/Gnn/Tensor.hpp>

Public Types

enum class  Type { eCPU , eCUDA }
 Device type enumeration. More...

Public Member Functions

bool isCpu () const
 Check if device is configured for CPU execution.
bool isCuda () const
 Check if device is configured for CUDA execution.
bool operator== (const Device &) const =default

Static Public Member Functions

static Device Cpu ()
 Create a CPU device descriptor.
static Device Cuda (std::size_t index=0)
 Create a CUDA device descriptor.

Public Attributes

std::size_t index = 0
 Device index for multi-GPU systems.
Type type = Type::eCPU
 Device type (CPU or CUDA).

Detailed Description

A simple device description struct.

Member Enumeration Documentation

◆ Type

enum class ActsPlugins::Device::Type
strong

Device type enumeration.

Enumerator
eCPU 
eCUDA 

Member Function Documentation

◆ Cpu()

Device ActsPlugins::Device::Cpu ( )
static

Create a CPU device descriptor.

Returns
Device object configured for CPU execution

◆ Cuda()

Device ActsPlugins::Device::Cuda ( std::size_t index = 0)
static

Create a CUDA device descriptor.

Parameters
indexGPU device index for multi-GPU systems (default: 0)
Returns
Device object configured for CUDA execution on specified GPU

◆ isCpu()

bool ActsPlugins::Device::isCpu ( ) const

Check if device is configured for CPU execution.

Returns
True if device type is CPU, false otherwise

◆ isCuda()

bool ActsPlugins::Device::isCuda ( ) const

Check if device is configured for CUDA execution.

Returns
True if device type is CUDA, false otherwise

◆ operator==()

bool ActsPlugins::Device::operator== ( const Device & ) const
default

Member Data Documentation

◆ index

std::size_t ActsPlugins::Device::index = 0

Device index for multi-GPU systems.

◆ type

Type ActsPlugins::Device::type = Type::eCPU

Device type (CPU or CUDA).