diff --git a/src/ComputeForce.h b/src/ComputeForce.h index d774e6a89f3f676e68ee0c5cd9f6ca7b3f7347ba..b5954ace3a87ccdbcbee09f8026e3b0d5df07ac1 100644 --- a/src/ComputeForce.h +++ b/src/ComputeForce.h @@ -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; diff --git a/src/Configuration.h b/src/Configuration.h index f956b9213d1f5d13bc4953349e94b84ae95dcc92..7fb589df2b6cca944941d864921b44c4433257b7 100644 --- a/src/Configuration.h +++ b/src/Configuration.h @@ -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;