QDMI v1.3.4-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
311 QDMI_Device_Session session, const QDMI_Program_Format *format, size_t size,
312 QDMI_Program_Feature *value, size_t *size_ret);
313
370 size_t size, void *value, size_t *size_ret);
371
448 QDMI_Device_Session session, QDMI_Operation operation, size_t num_sites,
449 const QDMI_Site *sites, size_t num_params, const double *params,
450 QDMI_Operation_Property prop, size_t size, void *value, size_t *size_ret);
451 // end of device_query_interface
453
477
487typedef struct QDMI_Device_Job_impl_d *QDMI_Device_Job;
488
509QDMI_EXPORT int
511 QDMI_Device_Job *job);
512
556 QDMI_Device_Session session, const char *job_id, QDMI_Device_Job *job);
557
612 size_t size, const void *value);
613
665 const QDMI_Program_Format *format,
666 size_t count, const size_t *sizes,
667 const void *const *programs);
668
721 size_t size, void *value,
722 size_t *size_ret);
723
741
755
770 QDMI_Job_Status *status);
771
793QDMI_EXPORT int QDMI_device_job_wait(QDMI_Device_Job job, size_t timeout);
794
841 size_t program_index,
842 QDMI_Job_Result result, size_t size,
843 void *data, size_t *size_ret);
844
854 // end of device_job_interface
856
879typedef struct QDMI_Child_Device_impl_d *QDMI_Child_Device;
880 // end of device_interface
882
883// NOLINTEND(performance-enum-size,modernize-use-using,modernize-redundant-void-arg)
884
885#ifdef __cplusplus
886} // extern "C"
887#endif
Defines constants and value types used within QDMI across the QDMI Client Interface and the QDMI Devi...
enum QDMI_JOB_STATUS_T QDMI_Job_Status
Job status type.
Definition constants.h:933
enum QDMI_JOB_RESULT_T QDMI_Job_Result
Job result type.
Definition constants.h:1383
enum QDMI_DEVICE_JOB_PARAMETER_T QDMI_Device_Job_Parameter
Device job parameter type.
Definition constants.h:228
enum QDMI_SITE_PROPERTY_T QDMI_Site_Property
Site property type.
Definition constants.h:753
enum QDMI_DEVICE_JOB_PROPERTY_T QDMI_Device_Job_Property
Device job property type.
Definition constants.h:325
enum QDMI_DEVICE_SESSION_PARAMETER_T QDMI_Device_Session_Parameter
Device session parameter type.
Definition constants.h:175
enum QDMI_OPERATION_PROPERTY_T QDMI_Operation_Property
Operation property type.
Definition constants.h:905
enum QDMI_DEVICE_PROPERTY_T QDMI_Device_Property
Device property type.
Definition constants.h:516
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:879
int QDMI_device_initialize(void)
Initialize a device.
int QDMI_device_finalize(void)
Finalize a device.
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_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_session_retrieve_device_job_by_id(QDMI_Device_Session session, const char *job_id, QDMI_Device_Job *job)
Retrieve an existing device job by its ID.
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:487
int QDMI_device_job_submit(QDMI_Device_Job job)
Submit a job to the device.
int QDMI_device_job_get_results(QDMI_Device_Job job, size_t program_index, QDMI_Job_Result result, size_t size, void *data, size_t *size_ret)
Retrieve one program's results from a job.
int QDMI_device_job_set_programs(QDMI_Device_Job job, const QDMI_Program_Format *format, size_t count, const size_t *sizes, const void *const *programs)
Set one or more programs for a job.
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_query_program_features(QDMI_Device_Session session, const QDMI_Program_Format *format, size_t size, QDMI_Program_Feature *value, size_t *size_ret)
Query the complete optional feature guarantees for one exact program format.
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.
One optional feature guarantee for an exact program format.
Definition constants.h:1110
Exact program format accepted by a device.
Definition constants.h:1031
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