Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to work around an Intel compiler issue. #15390

Merged
merged 2 commits into from
Jun 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 26 additions & 6 deletions source/dofs/dof_handler_policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3431,11 +3431,21 @@ namespace internal
0,
DoFAccessorImplementation::Implementation::
MGDoFIndexProcessor<dim, spacedim>(cell->level()),
[&complete](auto &stored_index, auto received_index) {
if (*received_index != numbers::invalid_dof_index)

// Intel ICC 18 and earlier for some reason believe that
// numbers::invalid_dof_index is not a valid object
// inside the lambda function. Fix this by creating a
// local variable initialized by the global one.
//
// Intel ICC 19 and earlier have trouble with our Assert
// macros inside the lambda function. We disable the macro
// for these compilers.
[&complete, invalid_dof_index = numbers::invalid_dof_index](
auto &stored_index, auto received_index) {
if (*received_index != invalid_dof_index)
{
# if !defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1900
Assert((stored_index == (numbers::invalid_dof_index)) ||
Assert((stored_index == invalid_dof_index) ||
(stored_index == *received_index),
ExcInternalError());
# endif
Expand Down Expand Up @@ -3529,11 +3539,21 @@ namespace internal
cell->active_fe_index(),
DoFAccessorImplementation::Implementation::
DoFIndexProcessor<dim, spacedim>(),
[&complete](auto &stored_index, auto received_index) {
if (*received_index != numbers::invalid_dof_index)

// Intel ICC 18 and earlier for some reason believe that
// numbers::invalid_dof_index is not a valid object
// inside the lambda function. Fix this by creating a
// local variable initialized by the global one.
//
// Intel ICC 19 and earlier have trouble with our Assert
// macros inside the lambda function. We disable the macro
// for these compilers.
[&complete, invalid_dof_index = numbers::invalid_dof_index](
auto &stored_index, const auto received_index) {
if (*received_index != invalid_dof_index)
{
# if !defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1900
Assert((stored_index == (numbers::invalid_dof_index)) ||
Assert((stored_index == invalid_dof_index) ||
(stored_index == *received_index),
ExcInternalError());
# endif
Expand Down