QDMI v1.3.2
Quantum Device Management Interface
Loading...
Searching...
No Matches
QDMI Device Interface

Description

Describes the functions to be implemented by a device or backend to be used with QDMI.

This is an interface between the QDMI driver and the device. It includes functions to initialize and finalize a device, as well as to manage sessions between a QDMI driver and a device, query properties of the device, and submit jobs to the device.

The device interface is split into three parts:

Interfaces

 QDMI Device Session Interface
 Provides functions to manage sessions between the driver and device.
 QDMI Device Query Interface
 Provides functions to query properties of a device.
 QDMI Device Job Interface
 Provides functions to manage jobs on a device.

Typedefs

typedef struct QDMI_Child_Device_impl_d * QDMI_Child_Device
 A handle for a child device.

Functions

int QDMI_device_initialize (void)
 Initialize a device.
int QDMI_device_finalize (void)
 Finalize a device.

Typedef Documentation

◆ QDMI_Child_Device

typedef struct QDMI_Child_Device_impl_d* QDMI_Child_Device

A handle for a child device.

An opaque pointer to an implementation of the QDMI child device concept. A child device generally represents a core or processing unit of a multicore device. Each implementation of the QDMI Device Interface may define the actual implementation of the concept.

Note
Only authors of a multicore device library that want to facilitate job execution on a dedicated core and/or need to expose device properties on a child device level must implement the concept.

A simple example of an implementation is a struct that merely contains an index, which can be used to identify the respective core / processing unit.

struct QDMI_Child_Device_impl_d {
size_t id;
};
See also
QDMI_DEVICE_PROPERTY_CHILDDEVICES
QDMI_DEVICE_SESSION_PARAMETER_CHILDDEVICE

Function Documentation

◆ QDMI_device_initialize()

int QDMI_device_initialize ( void )

Initialize a device.

A device can expect that this function is called exactly once in the beginning and has returned before any other functions are invoked on that device.

Returns
QDMI_SUCCESS if the device was initialized successfully.
QDMI_ERROR_FATAL if an unexpected error occurred.

◆ QDMI_device_finalize()

int QDMI_device_finalize ( void )

Finalize a device.

A device can expect that this function is called exactly once at the end of using the device, and no other functions are invoked on that device afterward.

Returns
QDMI_SUCCESS if the device was finalized successfully.
QDMI_ERROR_FATAL if the finalization failed, this could, for example, be due to a job that is still running.