Commit 3978b357 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

Updating IRTransformation interface, adding complex to InstructionParameter variant

parent e395f315
......@@ -37,7 +37,7 @@ namespace xacc {
class IRTransformation {
public:
virtual void transform(IR& ir) = 0;
virtual std::shared_ptr<IR> transform(std::shared_ptr<IR> ir) = 0;
virtual ~IRTransformation() {}
};
......
......@@ -34,6 +34,7 @@
#include <vector>
#include <string>
#include <memory>
#include <complex>
#include <boost/variant.hpp>
#include "Utils.hpp"
#include "InstructionVisitor.hpp"
......@@ -41,9 +42,9 @@
namespace xacc {
/**
* InstructionParameters can be ints, doubles, floats, or strings (for variables)
* InstructionParameters can be ints, doubles, floats, strings (for variables), or complex
*/
using InstructionParameter = boost::variant<int, double, float, std::string>;
using InstructionParameter = boost::variant<int, double, float, std::string, std::complex<double>>;
/**
* The Instruction interface is the base of all
......
......@@ -143,18 +143,6 @@ protected:
XACCError("Bad source string or something.\n");
}
// Execute IR Translations
auto acceleratorType = accelerator->getType();
auto defaultTransforms = getAcceleratorIndependentTransformations(
acceleratorType);
auto accDepTransforms = accelerator->getIRTransformations();
for (IRTransformation& t : defaultTransforms) {
t.transform(*xaccIR.get());
}
for (IRTransformation& t : accDepTransforms) {
t.transform(*xaccIR.get());
}
// Write the IR to file if the user requests it
if (runtimeOptions->exists("persist-ir")) {
auto fileStr = (*runtimeOptions)["persist-ir"];
......
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