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

minor updates to get qcs running


Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 1732d3c4
Pipeline #59196 failed with stages
in 24 seconds
......@@ -50,7 +50,7 @@ std::shared_ptr<IR> MapToPhysical::transform(std::shared_ptr<IR> ir) {
physical2Logical[edge.second]);
}
hardwareGraph->write(std::cout);
//hardwareGraph->write(std::cout);
for (auto &function : ir->getKernels()) {
auto logicalGraph = function->toGraph();
InstructionIterator it(function);
......@@ -64,7 +64,6 @@ std::shared_ptr<IR> MapToPhysical::transform(std::shared_ptr<IR> ir) {
probEdges.push_back({nextInst->bits()[0], nextInst->bits()[1]});
nUniqueProbBits.insert(nextInst->bits()[0]);
nUniqueProbBits.insert(nextInst->bits()[1]);
}
}
......@@ -80,8 +79,8 @@ std::shared_ptr<IR> MapToPhysical::transform(std::shared_ptr<IR> ir) {
problemGraph->addEdge(inst.first, inst.second, 1.0);
}
std::cout << "\n";
problemGraph->write(std::cout);
// std::cout << "\n";
// problemGraph->write(std::cout);
// Compute the minor graph embedding
auto embedding = embeddingAlgorithm->embed(problemGraph, hardwareGraph);
......
......@@ -36,6 +36,7 @@
#include "CLIParser.hpp"
#include "RemoteAccelerator.hpp"
#include <dlfcn.h>
#define RAPIDJSON_HAS_STDSTRING 1
#include "rapidjson/prettywriter.h"
......@@ -93,6 +94,7 @@ public:
const std::vector<std::shared_ptr<Function>> functions) override;
virtual void initialize() {
void*const libpython_handle = dlopen("libpython3.6m.so", RTLD_LAZY | RTLD_GLOBAL);
if (xacc::optionExists("qcs-backend")) {
auto backend = xacc::getOption("qcs-backend");
......@@ -109,7 +111,6 @@ public:
}
for (auto itr = twoq.MemberBegin(); itr != twoq.MemberEnd(); ++itr) {
auto connStr = itr->name.GetString();
std::cout << "CONN : " << connStr << "\n";
auto split = xacc::split(connStr, '-');
latticeEdges.push_back({std::stoi(split[0]), std::stoi(split[1])});
}
......
......@@ -177,7 +177,14 @@ std::shared_ptr<Accelerator> getAccelerator() {
"requires that you set --accelerator at the command line.");
}
auto acc = xacc::getService<Accelerator>(getOption("accelerator"));
auto name = getOption("accelerator");
auto name_backend = split(name, ':');
if (name_backend.size() > 1) {
setOption(name_backend[0]+"-backend",name_backend[1]);
}
auto acc = xacc::getService<Accelerator>(name_backend[0]);
if (acc) {
acc->initialize();
} else {
......
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