Skip to content

🚸 Support for "Bring-your-own-tokens" Driver #161

@ystade

Description

@ystade

What's the problem this feature will solve?

Right now, when the driver establishes a connection to a device, i.e., a Device_Session it must know the respective authentication information for the device. However, in a scenario, where the client, not the driver, bought the compute power of the quantum resources and, hence, owns the respective tokens, it must be able to provide the tokens to the driver so that they can be forwarded to the device. Moreover, this must happen on a per-device basis.

Describe the solution you'd like

Consequently, this issue proposes a new function for the client interface:

/**
 * @brief Set a parameter for a session between the driver and a device.
 * @param[in] device A handle to the device of a client session. Must not be @c NULL.
 * @param[in] param The parameter to set. Must be one of the values specified
 * for @ref QDMI_Device_Parameter.
 * @param[in] size The size of the data pointed to by @p value in bytes. Must
 * not be zero, except when @p value is @c NULL, in which case it is ignored.
 * @param[in] value A pointer to the memory location that contains the value of
 * the parameter to be set. The data pointed to by @p value is copied and can be
 * safely reused after this function returns. If this is @c NULL, it is ignored.
 * @return @ref QDMI_SUCCESS if the driver supports the specified @p param and,
 * when @p value is not @c NULL, the value of the parameter was set
 * successfully.
 * @return @ref QDMI_ERROR_NOTSUPPORTED if the driver does not support the
 * parameter or the value of the parameter.
 * @return @ref QDMI_ERROR_INVALIDARGUMENT if
 *  - @p session is @c NULL,
 *  - @p param is invalid, or
 *  - @p value is not @c NULL and @p size is zero or not the expected size for
 *    the parameter (if specified by the @ref QDMI_Device_Parameter
 *    documentation).
 * @return @ref QDMI_ERROR_BADSTATE if the parameter cannot be set in the
 * current state of the session.
 * todo: What is a bad state here?
 * @return @ref QDMI_ERROR_FATAL if an unexpected error occurred.
 *
 * @note By calling this function with @p value set to @c NULL, the function can
 * be used to check if the driver supports the specified parameter without
 * setting a value.
 */
int QDMI_device_set_parameter(QDMI_Session session,
                               QDMI_Device_Parameter param, size_t size,
                               const void *value);

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or feature request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions