Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tbgl
tools
arbd
Commits
19493c05
Commit
19493c05
authored
4 years ago
by
cmaffeo2
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ComputeForce.h
+12
-4
12 additions, 4 deletions
src/ComputeForce.h
src/Configuration.h
+0
-1
0 additions, 1 deletion
src/Configuration.h
with
12 additions
and
5 deletions
src/ComputeForce.h
+
12
−
4
View file @
19493c05
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/Configuration.h
+
0
−
1
View file @
19493c05
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment