|
9 | 9 | #include "common/BraketExecutor.h"
|
10 | 10 | #include "common/BraketServerHelper.h"
|
11 | 11 |
|
| 12 | +#include <aws/braket/model/Association.h> |
| 13 | +#include <aws/braket/model/AssociationType.h> |
12 | 14 | #include <aws/braket/model/CreateQuantumTaskRequest.h>
|
13 | 15 | #include <aws/braket/model/GetQuantumTaskRequest.h>
|
14 | 16 | #include <aws/braket/model/QuantumTaskStatus.h>
|
@@ -100,7 +102,8 @@ void tryCreateBucket(Aws::S3Crt::S3CrtClient &client, std::string const ®ion,
|
100 | 102 |
|
101 | 103 | namespace cudaq {
|
102 | 104 | BraketExecutor::BraketExecutor()
|
103 |
| - : api(options), jobToken(std::getenv("AMZN_BRAKET_JOB_TOKEN")) {} |
| 105 | + : api(options), jobToken(std::getenv("AMZN_BRAKET_JOB_TOKEN")), |
| 106 | + reservationArn(std::getenv("AMZN_BRAKET_RESERVATION_TIME_WINDOW_ARN")) {} |
104 | 107 |
|
105 | 108 | /// @brief Set the server helper
|
106 | 109 | void BraketExecutor::setServerHelper(ServerHelper *helper) {
|
@@ -190,6 +193,15 @@ BraketExecutor::execute(std::vector<KernelExecution> &codesToExecute,
|
190 | 193 | req.SetShots(message["shots"]);
|
191 | 194 | if (jobToken)
|
192 | 195 | req.SetJobToken(jobToken);
|
| 196 | + |
| 197 | + if (reservationArn) { |
| 198 | + Aws::Braket::Model::Association assoc; |
| 199 | + assoc.SetArn(reservationArn); |
| 200 | + assoc.SetType( |
| 201 | + Aws::Braket::Model::AssociationType::RESERVATION_TIME_WINDOW_ARN); |
| 202 | + req.AddAssociations(std::move(assoc)); |
| 203 | + } |
| 204 | + |
193 | 205 | req.SetOutputS3Bucket(defaultBucket);
|
194 | 206 | req.SetOutputS3KeyPrefix(defaultPrefix);
|
195 | 207 |
|
|
0 commit comments