Commit 029affec authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

fixing bug in lambda visitor test, moved algorithm and optimizer to xacc

parent c17b8200
Loading
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -16,21 +16,10 @@ QCORASTConsumer::QCORASTConsumer(CompilerInstance &c, Rewriter &rw)
      rewriter(rw) {}

bool QCORASTConsumer::HandleTopLevelDecl(DeclGroupRef DR) {

  using namespace std::chrono;
  auto start = std::chrono::high_resolution_clock::now();
  LambdaVisitor visitor(ci, rewriter);
  for (DeclGroupRef::iterator b = DR.begin(), e = DR.end(); b != e; ++b) {
    // if (std::string((*b)->getDeclKindName()) == "Function") {
    //   std::cout << (*b)->getDeclKindName() << "\n";
    //   (*b)->dumpColor();
      visitor.TraverseDecl(*b);
    // }
  }
  auto stop = std::chrono::high_resolution_clock::now();
  auto duration = std::chrono::duration_cast<microseconds>(stop - start);

//   std::cout << "Visitor time: " << duration.count() << ", " << std::endl;
  return true;
}
} // namespace compiler
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ protected:
    for (auto& p : pragmaHandlers) {
        CI.getSema().getPreprocessor().RemovePragmaHandler(p.get());
    }

    CI.getDiagnosticClient().EndSourceFile();

    std::string outName(fileName);
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ protected:
    CompilerInstance &CI = getCompilerInstance();
    CI.createSema(getTranslationUnitKind(), nullptr);
    compiler::FuzzyParsingExternalSemaSource fuzzyParser;
    fuzzyParser.initialize();
    fuzzyParser.setASTContext(&CI.getASTContext());
    CI.getSema().addExternalSource(&fuzzyParser);

+3 −3
Original line number Diff line number Diff line
@@ -31,9 +31,9 @@ else()
   set_target_properties(${LIBRARY_NAME} PROPERTIES LINK_FLAGS "-shared")
endif()

file(GLOB HEADERS *.hpp)
file(GLOB HEADERS qcor.hpp qpu_handler.hpp)
install(FILES ${HEADERS} DESTINATION include/qcor)
install(TARGETS ${LIBRARY_NAME} DESTINATION lib)

add_subdirectory(algorithms)
add_subdirectory(nlopt-optimizers)
 No newline at end of file
#add_subdirectory(algorithms)
#add_subdirectory(nlopt-optimizers)
 No newline at end of file
+3 −3
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ submit(HandlerLambda &&totalJob, std::shared_ptr<AcceleratorBuffer> buffer) {


std::shared_ptr<Optimizer> getOptimizer(const std::string &name) {
  return xacc::getService<qcor::Optimizer>(name);
  return xacc::getService<xacc::Optimizer>(name);
}
std::shared_ptr<Optimizer>
getOptimizer(const std::string &name,
@@ -241,8 +241,8 @@ getObservable(const std::string &type,
  observable->fromOptions(options);
  return observable;
}
std::shared_ptr<algorithm::Algorithm> getAlgorithm(const std::string name) {
  return xacc::getService<qcor::algorithm::Algorithm>(name);
std::shared_ptr<xacc::Algorithm> getAlgorithm(const std::string name) {
  return xacc::getService<xacc::Algorithm>(name);
}

} // namespace qcor
Loading