Skip to content
Snippets Groups Projects
Commit 19493c05 authored by cmaffeo2's avatar cmaffeo2
Browse files

Macro USE_BOOST for boost::unordered_map rather than std::map for configuring productPotential

parent 4c59c134
No related branches found
No related tags found
No related merge requests found
......@@ -28,20 +28,28 @@
#include "GPUManager.h"
// #include <map>
#include <boost/unordered_map.hpp>
#include <cstdio>
// #include <cuda_runtime.h>
#include <thrust/transform_reduce.h> // thrust::reduce
#include <thrust/functional.h> // thrust::plus
#ifdef USE_BOOST
#include <boost/unordered_map.hpp>
typedef boost::unordered_map<String,unsigned int> XpotMap;
inline std::size_t hash_value(String const& s) {
if (s.length() == 0) return 0;
// return hash_value(s.val());
return boost::hash_range(s.val(), s.val()+s.length());
}
#else
#include <map>
typedef std::map<String,unsigned int> XpotMap;
inline std::size_t hash_value(String const& s) {
if (s.length() == 0) return 0;
return hash_value(s.val());
}
#endif
typedef boost::unordered_map<String,unsigned int> XpotMap;
// typedef std::map<String,unsigned int> XpotMap;
const unsigned int NUM_THREADS = 256;
......
......@@ -272,7 +272,6 @@ public:
int numProductPotentials;
bool readProductPotentialsFromFile;
ProductPotentialConf* productPotentials;
// boost::unordered_map<String, unsigned int> simple_potential_ids;
XpotMap simple_potential_ids;
std::vector<SimplePotential> simple_potentials;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment