QDMI v1.3.3-dev
Quantum Device Management Interface
Loading...
Searching...
No Matches
device.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 - 2026 QDMI Maintainers
3 * All rights reserved.
4 *
5 * Licensed under the Apache License v2.0 with LLVM Exceptions (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://llvm.org/LICENSE.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 *
17 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
18 */
19
23
24#pragma once
25
26#include "qdmi/constants.h" // IWYU pragma: export
27#include "qdmi/export.h" // IWYU pragma: export
28#include "qdmi/types.h" // IWYU pragma: export
29
30#ifdef __cplusplus
31#include <cstddef>
32
33extern "C" {
34#else
35#include <stddef.h>
36#endif
37
38// The following clang-tidy warning cannot be addressed because this header is
39// used from both C and C++ code.
40// NOLINTBEGIN(performance-enum-size,modernize-use-using,modernize-redundant-void-arg)
41
60
69QDMI_EXPORT int QDMI_device_initialize(void);
70
80QDMI_EXPORT int QDMI_device_finalize(void);
81
102
108typedef struct QDMI_Device_Session_impl_d *QDMI_Device_Session;
109
126
179QDMI_EXPORT int
182 size_t size, const void *value);
183
211
219 // end of device_session_interface
221
231
285 QDMI_Device_Session session, QDMI_Device_Property prop, size_t size,
286 void *value, size_t *size_ret);
287
344 size_t size, void *value, size_t *size_ret);
345
422 QDMI_Device_Session session, QDMI_Operation operation, size_t num_sites,
423 const QDMI_Site *sites, size_t num_params, const double *params,
424 QDMI_Operation_Property prop, size_t size, void *value, size_t *size_ret);
425 // end of device_query_interface
427
449
459typedef struct QDMI_Device_Job_impl_d *QDMI_Device_Job;
460
481QDMI_EXPORT int
483 QDMI_Device_Job *job);
484
518 const char *job_id,
519 QDMI_Device_Job *job);
520
574 size_t size, const void *value);
575
628 size_t size, void *value,
629 size_t *size_ret);
630
647
661
676 QDMI_Job_Status *status);
677
696QDMI_EXPORT int QDMI_device_job_wait(QDMI_Device_Job job, size_t timeout);
697
748 QDMI_Job_Result result, size_t size,
749 void *data, size_t *size_ret);
750
758 // end of device_job_interface
760
783typedef struct QDMI_Child_Device_impl_d *QDMI_Child_Device;
784 // end of device_interface
786
787// NOLINTEND(performance-enum-size,modernize-use-using,modernize-redundant-void-arg)
788
789#ifdef __cplusplus
790} // extern "C"
791#endif
Defines all enums used within QDMI across the QDMI Client Interface and the QDMI Device Interface.
enum QDMI_JOB_STATUS_T QDMI_Job_Status
Job status type.
Definition constants.h:872
enum QDMI_JOB_RESULT_T QDMI_Job_Result
Job result type.
Definition constants.h:1166
enum QDMI_DEVICE_JOB_PARAMETER_T QDMI_Device_Job_Parameter
Device job parameter type.
Definition constants.h:216
enum QDMI_SITE_PROPERTY_T QDMI_Site_Property
Site property type.
Definition constants.h:694
enum QDMI_DEVICE_JOB_PROPERTY_T QDMI_Device_Job_Property
Device job property type.
Definition constants.h:282
enum QDMI_DEVICE_SESSION_PARAMETER_T QDMI_Device_Session_Parameter
Device session parameter type.
Definition constants.h:157
enum QDMI_OPERATION_PROPERTY_T QDMI_Operation_Property
Operation property type.
Definition constants.h:844
enum QDMI_DEVICE_PROPERTY_T QDMI_Device_Property
Device property type.
Definition constants.h:459
Defines macros for controlling the visibility of symbols.
struct QDMI_Child_Device_impl_d * QDMI_Child_Device
A handle for a child device.
Definition device.h:783
int QDMI_device_initialize(void)
Initialize a device.
int QDMI_device_finalize(void)
Finalize a device.
int QDMI_device_job_get_results(QDMI_Device_Job job, QDMI_Job_Result result, size_t size, void *data, size_t *size_ret)
Retrieve the results of a job.
int QDMI_device_job_set_parameter(QDMI_Device_Job job, QDMI_Device_Job_Parameter param, size_t size, const void *value)
Set a parameter for a job.
int QDMI_device_job_query_property(QDMI_Device_Job job, QDMI_Device_Job_Property prop, size_t size, void *value, size_t *size_ret)
Query a job property.
int QDMI_device_session_open_device_job(QDMI_Device_Session session, const char *job_id, QDMI_Device_Job *job)
Open an existing device job.
int QDMI_device_session_create_device_job(QDMI_Device_Session session, QDMI_Device_Job *job)
Create a job.
int QDMI_device_job_check(QDMI_Device_Job job, QDMI_Job_Status *status)
Check the status of a job.
int QDMI_device_job_cancel(QDMI_Device_Job job)
Cancel an already submitted job.
int QDMI_device_job_wait(QDMI_Device_Job job, size_t timeout)
Wait for a job to finish.
struct QDMI_Device_Job_impl_d * QDMI_Device_Job
A handle for a device job.
Definition device.h:459
int QDMI_device_job_submit(QDMI_Device_Job job)
Submit a job to the device.
void QDMI_device_job_free(QDMI_Device_Job job)
Free a job.
int QDMI_device_session_query_operation_property(QDMI_Device_Session session, QDMI_Operation operation, size_t num_sites, const QDMI_Site *sites, size_t num_params, const double *params, QDMI_Operation_Property prop, size_t size, void *value, size_t *size_ret)
Query an operation property.
int QDMI_device_session_query_site_property(QDMI_Device_Session session, QDMI_Site site, QDMI_Site_Property prop, size_t size, void *value, size_t *size_ret)
Query a site property.
int QDMI_device_session_query_device_property(QDMI_Device_Session session, QDMI_Device_Property prop, size_t size, void *value, size_t *size_ret)
Query a device property.
int QDMI_device_session_init(QDMI_Device_Session session)
Initialize a device session.
struct QDMI_Device_Session_impl_d * QDMI_Device_Session
A handle for a device session.
Definition device.h:108
void QDMI_device_session_free(QDMI_Device_Session session)
Free a QDMI device session.
int QDMI_device_session_set_parameter(QDMI_Device_Session session, QDMI_Device_Session_Parameter param, size_t size, const void *value)
Set a parameter for a device session.
int QDMI_device_session_alloc(QDMI_Device_Session *session)
Allocate a new device session.
Defines all types used within QDMI across the QDMI Client Interface and the QDMI Device Interface.
struct QDMI_Site_impl_d * QDMI_Site
A handle for a site.
Definition types.h:54
struct QDMI_Operation_impl_d * QDMI_Operation
A handle for an operation.
Definition types.h:73