try to compile with clang and on osx in travis

This commit is contained in:
Patrick Brosi 2018-07-23 02:46:31 +02:00
parent 1a9482a445
commit df2ab2df77
10 changed files with 485 additions and 269 deletions

View file

@ -2,7 +2,13 @@
// Chair of Algorithms and Data Structures.
// Authors: Patrick Brosi <brosi@informatik.uni-freiburg.de>
#ifdef _OPENMP
#include <omp.h>
#else
#define omp_get_thread_num() 0
#define omp_get_num_procs() 1
#endif
#include <algorithm>
#include <fstream>
#include <limits>
@ -193,8 +199,7 @@ double CombCostFunc::operator()(const router::Edge* from, const router::Node* n,
}
// _____________________________________________________________________________
Router::Router(const trgraph::Graph& g, size_t numThreads)
: _g(g), _cache(numThreads) {
Router::Router(size_t numThreads) : _cache(numThreads) {
for (size_t i = 0; i < numThreads; i++) {
_cache[i] = new Cache();
}

View file

@ -135,7 +135,7 @@ struct CombCostFunc
class Router {
public:
// Init this router with caches for numThreads threads
Router(const trgraph::Graph& g, size_t numThreads);
explicit Router(size_t numThreads);
~Router();
// Find the most likely path through the graph for a node candidate route.
@ -160,8 +160,6 @@ class Router {
size_t getCacheNumber() const;
private:
const trgraph::Graph& _g;
mutable std::vector<Cache*> _cache;
HopBand getHopBand(const NodeCandGroup& a, const NodeCandGroup& b,
const RoutingAttrs& rAttrs, const RoutingOpts& rOpts,

View file

@ -2,7 +2,13 @@
// Chair of Algorithms and Data Structures.
// Authors: Patrick Brosi <brosi@informatik.uni-freiburg.de>
#ifdef _OPENMP
#include <omp.h>
#else
#define omp_get_thread_num() 0
#define omp_get_num_procs() 1
#endif
#include <map>
#include <mutex>
#include <unordered_map>
@ -49,7 +55,7 @@ ShapeBuilder::ShapeBuilder(Feed* feed, MOTs mots,
_motCfg(motCfg),
_ecoll(ecoll),
_cfg(cfg),
_crouter(_g, omp_get_num_procs()),
_crouter(omp_get_num_procs()),
_curShpCnt(0) {
_numThreads = _crouter.getCacheNumber();
writeMotStops();