Commit 6521bc2f authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

making the new preprocessors options providers and identifiable


Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 425d2806
......@@ -66,6 +66,44 @@ public:
virtual std::vector<std::shared_ptr<AcceleratorBuffer>> process(
std::vector<std::shared_ptr<AcceleratorBuffer>> buffers);
/**
* Return the name of this instance.
*
* @return name The string name
*/
virtual const std::string name() const {
return "readout-error-postprocessor";
}
/**
* Return the description of this instance
* @return description The description of this object.
*/
virtual const std::string description() const {
return "";
}
/**
* Return a Boost options_description instance that
* describes the options available for this
* derived subclass.
*/
virtual std::shared_ptr<options_description> getOptions() {
return std::make_shared<options_description>();
}
/**
* Given user-input command line options, perform
* some operation. Returns true if runtime should exit,
* false otherwise.
*
* @param map The mapping of options to values
* @return exit True if exit, false otherwise
*/
virtual bool handleOptions(variables_map& map) {
return false;
}
};
}
}
......
......@@ -24,6 +24,47 @@ public:
virtual std::shared_ptr<AcceleratorBufferPostprocessor> process(IR& ir) {}
/**
* Return the name of this instance.
*
* @return name The string name
*/
virtual const std::string name() const {
return "qubit-map-preprocessor";
}
/**
* Return the description of this instance
* @return description The description of this object.
*/
virtual const std::string description() const {
}
/**
* Return a Boost options_description instance that
* describes the options available for this
* derived subclass.
*/
virtual std::shared_ptr<options_description> getOptions() {
return std::make_shared<options_description>();
}
/**
* Given user-input command line options, perform
* some operation. Returns true if runtime should exit,
* false otherwise.
*
* @param map The mapping of options to values
* @return exit True if exit, false otherwise
*/
virtual bool handleOptions(variables_map& map) {
return false;
}
virtual ~QubitMapIRPreprocessor() {}
};
}
......
......@@ -21,6 +21,46 @@ namespace quantum {
class ReadoutErrorIRPreprocessor : public IRPreprocessor {
public:
virtual std::shared_ptr<AcceleratorBufferPostprocessor> process(IR& ir);
/**
* Return the name of this instance.
*
* @return name The string name
*/
virtual const std::string name() const {
return "readout-error-preprocessor";
}
/**
* Return the description of this instance
* @return description The description of this object.
*/
virtual const std::string description() const {
return "";
}
/**
* Return a Boost options_description instance that
* describes the options available for this
* derived subclass.
*/
virtual std::shared_ptr<options_description> getOptions() {
return std::make_shared<options_description>();
}
/**
* Given user-input command line options, perform
* some operation. Returns true if runtime should exit,
* false otherwise.
*
* @param map The mapping of options to values
* @return exit True if exit, false otherwise
*/
virtual bool handleOptions(variables_map& map) {
return false;
}
};
}
......
......@@ -14,9 +14,10 @@
#define XACC_ACCELERATOR_ACCELERATORBUFFERPOSTPROCESSOR_HPP_
#include "AcceleratorBuffer.hpp"
#include "OptionsProvider.hpp"
namespace xacc {
class AcceleratorBufferPostprocessor {
class AcceleratorBufferPostprocessor : public Identifiable, public OptionsProvider {
public:
virtual std::vector<std::shared_ptr<AcceleratorBuffer>> process(std::vector<std::shared_ptr<AcceleratorBuffer>> buffers) = 0;
virtual ~AcceleratorBufferPostprocessor(){}
......
......@@ -15,10 +15,11 @@
#include "IR.hpp"
#include "AcceleratorBufferPostprocessor.hpp"
#include "OptionsProvider.hpp"
namespace xacc {
class IRPreprocessor {
class IRPreprocessor : public Identifiable, public OptionsProvider {
public:
virtual std::shared_ptr<AcceleratorBufferPostprocessor> process(IR& ir) = 0;
virtual ~IRPreprocessor() {}
......
Markdown is supported
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