public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/113376] New: Confusing notes when using C++17 parallel algorithms
@ 2024-01-13 13:04 pilarlatiesa at gmail dot com
  2024-01-13 14:26 ` [Bug libstdc++/113376] " redi at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: pilarlatiesa at gmail dot com @ 2024-01-13 13:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113376

            Bug ID: 113376
           Summary: Confusing notes when using C++17 parallel algorithms
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pilarlatiesa at gmail dot com
  Target Milestone: ---

With GCC 14, the following code:

#include <algorithm>
#include <execution>
#include <vector>

void f(std::vector<int> &v)
{
std::for_each(std::execution::par, v.begin(), v.end(),
              [](int &i) { i *= 2; });
}

when compiled emits a lot of notes like:

/home/pililatiesa/gcc-14/include/c++/14.0.0/pstl/algorithm_impl.h: In function
'_RandomAccessIterator
__pstl::__internal::__brick_unique(_RandomAccessIterator,
_RandomAccessIterator, _BinaryPredicate, std::true_type)':
/home/pililatiesa/gcc-14/include/c++/14.0.0/pstl/algorithm_impl.h:1219:5: note:
'#pragma message:  [Parallel STL message]: "Vectorized algorithm unimplemented,
redirected to serial"'
 1219 |     _PSTL_PRAGMA_MESSAGE("Vectorized algorithm unimplemented,
redirected to serial");
      |     ^~~~~~~~~~~~~~~~~~~~

I don't understand why all these functions are even instantiated as they appear
to be related to the vectorization of other algorithms.

Furthermore, in pstl_config.h we have:

// Check the user-defined macro for warnings
#if defined(PSTL_USAGE_WARNINGS)
#    undef _PSTL_USAGE_WARNINGS
#    define _PSTL_USAGE_WARNINGS PSTL_USAGE_WARNINGS
// Check the internal macro for warnings
#elif !defined(_PSTL_USAGE_WARNINGS)
#    define _PSTL_USAGE_WARNINGS 0
#endif

and later in this file:


#if defined(_PSTL_USAGE_WARNINGS)
#    define _PSTL_PRAGMA_MESSAGE(x) _PSTL_PRAGMA_MESSAGE_IMPL(x)
#    define _PSTL_PRAGMA_MESSAGE_POLICIES(x) _PSTL_PRAGMA_MESSAGE_IMPL(x)
#else
#    define _PSTL_PRAGMA_MESSAGE(x)
#    define _PSTL_PRAGMA_MESSAGE_POLICIES(x)
#endif

i.e. is checking defined(_PSTL_USAGE_WARNINGS) instead of just
_PSTL_USAGE_WARNINGS. This logic doesn't seem right.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-13 13:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-13 13:04 [Bug libstdc++/113376] New: Confusing notes when using C++17 parallel algorithms pilarlatiesa at gmail dot com
2024-01-13 14:26 ` [Bug libstdc++/113376] " redi at gcc dot gnu.org
2024-01-15  8:50 ` pilarlatiesa at gmail dot com
2024-01-15 10:17 ` redi at gcc dot gnu.org
2024-01-15 15:13 ` pilarlatiesa at gmail dot com
2024-01-15 16:05 ` redi at gcc dot gnu.org
2024-06-12 10:48 ` redi at gcc dot gnu.org
2024-06-12 10:56 ` redi at gcc dot gnu.org
2024-06-12 11:22 ` [Bug libstdc++/113376] [14/15 Regression] " redi at gcc dot gnu.org
2024-06-12 20:40 ` redi at gcc dot gnu.org
2024-06-13 13:10 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).