Commit 36f39f16 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

fixing add_edge bug in DWGraph

parent fbdc2091
......@@ -134,8 +134,6 @@ std::shared_ptr<IR> DWQMICompiler::compile(const std::string& src,
}
}
std::cout << "NHARDWARE: " << nHardwareVerts << ", " << problemGraph->order() << "\n";
for (int i = 0; i < nHardwareVerts; i++) {
for (int j = 0; j < nHardwareVerts; j++) {
if (hardwareGraph->edgeExists(i,j) && i < j && i != j) {
......@@ -161,24 +159,17 @@ std::shared_ptr<IR> DWQMICompiler::compile(const std::string& src,
newWeight = std::get<0>(problemGraph->getVertexProperties(pi)) + newWeight - 1.0;
}
std::cout << "Adding a Edge Instruction.\n";
auto embeddedInst = std::make_shared<DWQMI>(i,
j, newWeight);
dwKernel->addInstruction(embeddedInst);
}
// else {
// std::cout << "SUBTREE DID NOT CONTAIN: " << i << " and " << j << "\n";
// }
}
}
} else {
std::cout << "Edge did not exist between " << i << ", " << j << "\n";
}
}
}
auto ir = std::make_shared<DWIR>();
ir->addKernel(dwKernel);
return ir;
......
......@@ -145,7 +145,7 @@ BOOST_AUTO_TEST_CASE(checkSimpleCompile) {
auto ir = compiler->compile(simpleQMI, acc);
std::cout << "STR:\n" << ir->getKernel("dw-kernel")->toString("") << "\n";
// std::cout << "STR:\n" << ir->getKernel("dw-kernel")->toString("") << "\n";
}
......
......@@ -37,11 +37,10 @@ public:
std::shared_ptr<AcceleratorGraph> getAcceleratorGraph() {
auto retGraph = std::make_shared<AcceleratorGraph>(order());
for (int i = 0; i < order(); i++) {
for (int j = 0; j < order(); j++) {
if (i < j) {
addEdge(i, j);
retGraph->addEdge(i, j);
}
}
}
......
......@@ -427,7 +427,7 @@ public:
*_graph.get());
for (; neighbors.first != neighbors.second; ++neighbors.first) {
std::cout << indexMap[*neighbors.first] << " ";
// std::cout << indexMap[*neighbors.first] << " ";
int neighborIdx = indexMap[*neighbors.first];
l.push_back(neighborIdx);
}
......
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