Commit a47082b6 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

adding new generate function to IRGenerator



Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 47eb86a1
......@@ -110,8 +110,12 @@ PYBIND11_MODULE(_pyxacc, m) {
.def("process", &xacc::AcceleratorBufferPostprocessor::process, "");
py::class_<xacc::IRGenerator, std::shared_ptr<xacc::IRGenerator>>(m, "IRGenerator", "")
.def("generate", (std::shared_ptr<xacc::Function> (xacc::IRGenerator::*)(
std::vector<xacc::InstructionParameter>)) &xacc::IRGenerator::generate, py::return_value_policy::reference, "");
.def("generate", (std::shared_ptr<xacc::Function> (xacc::IRGenerator::*)(
std::vector<xacc::InstructionParameter>)) &xacc::IRGenerator::generate,
py::return_value_policy::reference, "")
.def("generate", (std::shared_ptr<xacc::Function> (xacc::IRGenerator::*)(
std::map<std::string, xacc::InstructionParameter>)) &xacc::IRGenerator::generate,
py::return_value_policy::reference, "");
// Expose the Kernel
py::class_<xacc::Kernel<>, std::shared_ptr<xacc::Kernel<>>>(m, "Kernel", "The XACC Kernel is the "
......
......@@ -50,6 +50,13 @@ public:
std::vector<InstructionParameter> parameters = std::vector<
InstructionParameter> { }) {return generate(nullptr,parameters);}
virtual std::shared_ptr<Function> generate(std::map<std::string, InstructionParameter>
parameters = std::map<std::string, InstructionParameter>{}) {
std::vector<InstructionParameter> temp;
for (auto& kv : parameters) temp.push_back(kv.second);
return generate(nullptr,temp);
}
/**
* The destructor
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment