Commit 89761d73 authored by Nguyen, Thien Minh's avatar Nguyen, Thien Minh
Browse files

Added boiler-plate for missing callable API (Q# kernels)



Needs to implement runtime for these.

Signed-off-by: default avatarThien Nguyen <nguyentm@ornl.gov>
parent e4840f1f
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -159,7 +159,18 @@ void __quantum__rt__capture_update_reference_count(Callable *clb,
void __quantum__rt__capture_update_alias_count(Callable *clb, int32_t count);
void __quantum__rt__callable_memory_management(int32_t index, Callable *clb,
                                               int64_t parameter);

Callable *__quantum__rt__callable_make_adjoint(Callable *clb);
Callable *__quantum__rt__callable_make_controlled(Callable *clb);
// Implementation table: 4x callables of a specific signature
typedef struct impl_table_t {
  void (*f[4])(TuplePtr, TuplePtr, TuplePtr);
} impl_table_t;
typedef struct mem_management_cb_t {
  void (*f[2])(TuplePtr, int64_t);
} mem_management_cb_t;
// Create callable (from Q#): 
// See spec: https://github.com/microsoft/qsharp-language/blob/main/Specifications/QIR/Callables.md
Callable* __quantum__rt__callable_create(impl_table_t* ft, mem_management_cb_t* callbacks, TuplePtr capture);
// Classical Runtime: 
// https://github.com/microsoft/qsharp-language/blob/main/Specifications/QIR/Classical-Runtime.md#classical-runtime
void __quantum__rt__fail(QirString *str);
+10 −0
Original line number Diff line number Diff line
@@ -40,4 +40,14 @@ void __quantum__rt__callable_memory_management(int32_t index, Callable *clb,
  if (verbose)
    std::cout << "CALL: " << __PRETTY_FUNCTION__ << "\n";
}

Callable *__quantum__rt__callable_make_adjoint(Callable *clb) {
  std::cout << "CALL: " << __PRETTY_FUNCTION__ << "\n";
}
Callable *__quantum__rt__callable_make_controlled(Callable *clb) {
  std::cout << "CALL: " << __PRETTY_FUNCTION__ << "\n";
}
Callable* __quantum__rt__callable_create(impl_table_t* ft, mem_management_cb_t* callbacks, TuplePtr capture) {
  std::cout << "CALL: " << __PRETTY_FUNCTION__ << "\n";
}
}
 No newline at end of file