Commit 9cb8998b authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

adding xacc::qalloc() to public api


Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 64bb5f77
Pipeline #62723 passed with stages
in 10 minutes and 43 seconds
......@@ -23,6 +23,7 @@ if (FROM_SETUP_PY AND NOT APPLE)
set (CMAKE_SHARED_LINKER_FLAGS "-static-libstdc++" CACHE INTERNAL "" FORCE)
endif()
set(CMAKE_DEBUG_POSTFIX "")
set(CMAKE_SKIP_INSTALL_RPATH OFF)
set(CMAKE_SKIP_RPATH OFF)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
......
......@@ -6,12 +6,6 @@
#define __qpu__ __attribute__((annotate("__qpu__")))
#define __observe__(OBS) __attribute__((annotate("observe_" #OBS)))
using qbit = std::shared_ptr<xacc::AcceleratorBuffer>;
namespace xacc {
qbit qalloc(const int n) {
return std::make_shared<xacc::AcceleratorBuffer>(n);
}
std::shared_ptr<Function> loadFromIR(const std::string &ir) {
auto function =
xacc::getService<xacc::IRProvider>("gate")->createFunction("f", {}, {});
......
......@@ -125,6 +125,11 @@ void error(const std::string &msg, MessagePredicate predicate) {
}
}
qbit qalloc(const int n) {
return std::make_shared<xacc::AcceleratorBuffer>(n);
}
void addCommandLineOption(const std::string &optionName,
const std::string &optionDescription) {
xaccCLParser->addStringOption(optionName, optionDescription);
......
......@@ -15,6 +15,7 @@
#include "Compiler.hpp"
#include "RemoteAccelerator.hpp"
// #include "AcceleratorBuffer.hpp"
namespace xacc {
......@@ -237,6 +238,10 @@ std::shared_ptr<Compiler> getCompiler(const std::string &name);
*/
std::shared_ptr<Compiler> getCompiler();
using qbit = std::shared_ptr<xacc::AcceleratorBuffer>;
qbit qalloc(const int n);
/**
* Return true if the framework has a Compiler
* with the given name.
......
......@@ -496,7 +496,7 @@ void AcceleratorBuffer::load(std::istream &stream) {
std::string json(std::istreambuf_iterator<char>(stream), {});
Document doc;
doc.Parse(json);
std::cout << "HELLO\n" << json << "\n";
resetBuffer();
if (!cacheFile) {
......
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