Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas White
pinkindexer
Commits
82dba48d
Commit
82dba48d
authored
Mar 25, 2019
by
Yaroslav Gevorkov
Browse files
adding parallelity to init phase
parent
be66f4ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
82dba48d
...
...
@@ -51,6 +51,7 @@ endif(PINKINDEXER_BUILD_EXECUTABLE)
if
(
OpenMP_CXX_FOUND
)
target_link_libraries
(
pinkIndexer PUBLIC OpenMP::OpenMP_CXX
)
add_definitions
(
-DOPENMP_AVAILABLE
)
add_definitions
(
-D_GLIBCXX_PARALLEL
)
endif
(
OpenMP_CXX_FOUND
)
if
(
EIGEN3_FOUND
)
...
...
src/ReflectionsInRangeFinder.cpp
View file @
82dba48d
...
...
@@ -2,7 +2,8 @@
#include <algorithm>
#include <numeric>
//#include <execution>
using
namespace
std
;
using
namespace
Eigen
;
...
...
@@ -34,9 +35,13 @@ namespace pinkIndexer
sortIndices
.
resize
(
reflections
.
cols
());
iota
(
sortIndices
.
begin
(),
sortIndices
.
end
(),
0
);
sort
(
sortIndices
.
begin
(),
sortIndices
.
end
(),
[
&
norms
](
uint32_t
i
,
uint32_t
j
)
{
return
norms
[
i
]
<
norms
[
j
];
});
//only with c++17 support:
//sort(execution::par_unseq, sortIndices.begin(), sortIndices.end(), [&norms](uint32_t i, uint32_t j) { return norms[i] < norms[j]; });
reflectionsDirections_sorted
.
resize
(
3
,
reflections
.
cols
()
-
1
);
// leave out reflection (0,0,0)
norms_sorted
.
resize
(
reflections
.
cols
());
#pragma omp parallel for
for
(
int
i
=
1
;
i
<
reflections
.
cols
();
++
i
)
{
uint32_t
sortIndex
=
sortIndices
[
i
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment