Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
IP
elsa
Commits
f55b9832
Commit
f55b9832
authored
Sep 18, 2019
by
Tobias Lasser
Browse files
enable OpenMP for operators and projectors
parent
c126101f
Pipeline
#155900
failed with stages
in 17 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
elsa/operators/CMakeLists.txt
View file @
f55b9832
...
...
@@ -25,6 +25,13 @@ add_library(elsa::${ELSA_MODULE_NAME} ALIAS ${ELSA_MODULE_TARGET_NAME})
target_link_libraries
(
${
ELSA_MODULE_TARGET_NAME
}
elsa_core elsa_logging
)
# use OpenMP is available
find_package
(
OpenMP
)
if
(
OpenMP_CXX_FOUND
)
target_link_libraries
(
${
ELSA_MODULE_TARGET_NAME
}
PRIVATE OpenMP::OpenMP_CXX
)
endif
()
target_include_directories
(
${
ELSA_MODULE_TARGET_NAME
}
PUBLIC
$<INSTALL_INTERFACE:include/
${
ELSA_MODULE_NAME
}
>
...
...
elsa/operators/FiniteDifferences.cpp
View file @
f55b9832
...
...
@@ -102,6 +102,7 @@ namespace elsa
IndexVector_t
decrementedCoefficients
=
numberOfCoefficients
-
IndexVector_t
::
Ones
(
this
->
getRangeDescriptor
().
getNumberOfDimensions
());
#pragma omp parallel
for
(
int
currDim
=
0
;
currDim
<
numDim
;
++
currDim
)
{
if
(
!
_activeDims
[
currDim
])
continue
;
...
...
@@ -109,6 +110,7 @@ namespace elsa
index_t
modulus
=
numberOfCoefficients
.
head
(
currDim
+
1
).
prod
();
index_t
divisor
=
numberOfCoefficients
.
head
(
currDim
).
prod
();
#pragma omp for nowait
for
(
index_t
id
=
0
;
id
<
sizeOfDomain
;
++
id
)
{
index_t
icCount
=
(
id
%
modulus
)
/
divisor
;
//_domainDescriptor.index(id, ic);
index_t
ir
=
id
+
_dimCounter
[
currDim
]
*
_coordDelta
[
currDim
];
...
...
@@ -147,6 +149,7 @@ namespace elsa
IndexVector_t
numberOfCoefficients
=
this
->
getDomainDescriptor
().
getNumberOfCoefficientsPerDimension
();
IndexVector_t
decrementedCoefficients
=
numberOfCoefficients
-
IndexVector_t
::
Ones
(
numDim
);
#pragma omp parallel
for
(
index_t
currDim
=
0
;
currDim
<
numDim
;
++
currDim
)
{
if
(
!
_activeDims
[
currDim
])
continue
;
...
...
@@ -154,6 +157,7 @@ namespace elsa
index_t
modulus
=
numberOfCoefficients
.
head
(
currDim
+
1
).
prod
();
index_t
divisor
=
numberOfCoefficients
.
head
(
currDim
).
prod
();
#pragma omp for nowait
for
(
index_t
id
=
0
;
id
<
sizeOfDomain
;
++
id
)
{
index_t
icCount
=
(
id
%
modulus
)
/
divisor
;
index_t
ir
=
id
+
_dimCounter
[
currDim
]
*
_coordDelta
[
currDim
];
...
...
elsa/projectors/CMakeLists.txt
View file @
f55b9832
...
...
@@ -35,6 +35,14 @@ add_library(elsa::${ELSA_MODULE_NAME} ALIAS ${ELSA_MODULE_TARGET_NAME})
target_link_libraries
(
${
ELSA_MODULE_TARGET_NAME
}
elsa_core elsa_logging
)
# use OpenMP is available
find_package
(
OpenMP
)
if
(
OpenMP_CXX_FOUND
)
target_link_libraries
(
${
ELSA_MODULE_TARGET_NAME
}
PRIVATE OpenMP::OpenMP_CXX
)
endif
()
target_include_directories
(
${
ELSA_MODULE_TARGET_NAME
}
PUBLIC
$<INSTALL_INTERFACE:include/
${
ELSA_MODULE_NAME
}
>
...
...
Write
Preview
Supports
Markdown
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