13 #ifndef XACC_XACC_INTERNAL_COMPILER_HPP_
14 #define XACC_XACC_INTERNAL_COMPILER_HPP_
20 class CompositeInstruction;
21 class AcceleratorBuffer;
24 namespace internal_compiler {
25 extern std::shared_ptr<Accelerator> qpu;
26 extern std::shared_ptr<CompositeInstruction> lastCompiled;
27 extern bool __execute;
29 enum OptLevel { DEFAULT, LEVEL1, LEVEL2, LEVEL3 };
31 void compiler_InitializeXACC(
const char *qpu_backend =
"qpp",
32 const std::vector<std::string> cmd_line_args = {});
33 void compiler_InitializeXACC(
const char *qpu_backend,
int shots);
35 void setAccelerator(
const char *qpu_backend);
36 void setAccelerator(
const char *qpu_backend,
int shots);
37 std::shared_ptr<Accelerator> get_qpu();
39 void __set_verbose(
bool verbose);
43 std::shared_ptr<CompositeInstruction> compile(
const char *compiler_name,
44 const char *kernel_src);
46 std::shared_ptr<CompositeInstruction> getLastCompiled();
47 std::shared_ptr<CompositeInstruction> getCompiled(
const char *kernel_name);
50 void optimize(std::shared_ptr<CompositeInstruction> program,
51 const OptLevel opt = DEFAULT);
55 void execute(AcceleratorBuffer *buffer,
56 std::vector<std::shared_ptr<CompositeInstruction>> programs);
57 void execute(AcceleratorBuffer *buffer,
58 std::shared_ptr<CompositeInstruction> program,
59 double *parameters =
nullptr);
60 void execute(AcceleratorBuffer **buffers,
const int nBuffers,
61 std::shared_ptr<CompositeInstruction> program,
62 double *parameters =
nullptr);