petsc4py.PETSc.Device#

class petsc4py.PETSc.Device#

Bases: object

The device object.

Represents a handle to an accelerator (which may be the host).

Enumerations

Type

The type of device.

Methods Summary

configure()

Configure and setup a device object.

create([dtype, device_id])

Create a device object.

destroy()

Destroy a device object.

getDeviceId()

Return the device id.

getDeviceType()

Return the type of the device.

setDefaultType(device_type)

Set the device type to be used as the default in subsequent calls to create.

view([viewer])

View a device object.

Attributes Summary

device_id

The device id.

type

The device type.

Methods Documentation

configure()#

Configure and setup a device object.

Not collective.

Source code at petsc4py/PETSc/Device.pyx:128

Return type:

None

classmethod create(dtype=None, device_id=DECIDE)#

Create a device object.

Not collective.

Parameters:
  • dtype (Type | None) – The type of device to create (or None for the default).

  • device_id (int) – The numeric id of the device to create.

Return type:

Device

Source code at petsc4py/PETSc/Device.pyx:90

destroy()#

Destroy a device object.

Not collective.

Source code at petsc4py/PETSc/Device.pyx:116

Return type:

None

getDeviceId()#

Return the device id.

Not collective.

Source code at petsc4py/PETSc/Device.pyx:176

Return type:

int

getDeviceType()#

Return the type of the device.

Not collective.

Source code at petsc4py/PETSc/Device.pyx:161

Return type:

str

static setDefaultType(device_type)#

Set the device type to be used as the default in subsequent calls to create.

Not collective.

Source code at petsc4py/PETSc/Device.pyx:191

Parameters:

device_type (Type | str) –

Return type:

None

view(viewer=None)#

View a device object.

Collective.

Parameters:

viewer (Viewer | None) – A Viewer instance or None for the default viewer.

Return type:

None

See also

PetscDeviceView

Source code at petsc4py/PETSc/Device.pyx:140

Attributes Documentation

device_id#

The device id.

Source code at petsc4py/PETSc/Device.pyx:211

type#

The device type.

Source code at petsc4py/PETSc/Device.pyx:206