Adds the provided delegate data blobs to the execution plan.
(
program: Program, plan: ExecutionPlan, blobs: Sequence[bytes]
)
| 58 | |
| 59 | |
| 60 | def add_delegate_data( |
| 61 | program: Program, plan: ExecutionPlan, blobs: Sequence[bytes] |
| 62 | ) -> None: |
| 63 | """Adds the provided delegate data blobs to the execution plan.""" |
| 64 | di = len(plan.delegates) |
| 65 | for blob in blobs: |
| 66 | data_index: int = len(program.backend_delegate_data) |
| 67 | program.backend_delegate_data.append( |
| 68 | BackendDelegateInlineData( |
| 69 | data=blob, |
| 70 | ) |
| 71 | ) |
| 72 | delegate = BackendDelegate( |
| 73 | id=f"delegate{di}", |
| 74 | processed=BackendDelegateDataReference( |
| 75 | location=DataLocation.INLINE, |
| 76 | index=data_index, |
| 77 | ), |
| 78 | compile_specs=[], |
| 79 | ) |
| 80 | plan.delegates.append(delegate) |
| 81 | di += 1 |
| 82 | |
| 83 | |
| 84 | def canonicalize_delegate_indices(program: Program) -> Program: |
no test coverage detected