public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libstdc++: Enable OpenMP 5.0 pragmas in PSTL headers
@ 2023-06-30 20:15 Jonathan Wakely
  2023-07-03 23:07 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wakely @ 2023-06-30 20:15 UTC (permalink / raw)
  To: libstdc++, gcc-patches; +Cc: Jakub Jelinek, Thomas Rodgers

Jakub made a similar change a few yeas ago, but I think it got lost
in the recent PSTL rebase.

Tested x86_64-linux.

Does this look OK for trunk?

-- >8 --

This reapplies r10-1314-g32bab8b6ad0a90 which was lost in the recent
PSTL rebase from upstream.

	* include/pstl/pstl_config.h (_PSTL_PRAGMA_SIMD_SCAN,
	_PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN, _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN):
	Define to OpenMP 5.0 pragmas even for GCC 10.0+.
	(_PSTL_UDS_PRESENT): Define to 1 for GCC 10.0+.
---
 libstdc++-v3/include/pstl/pstl_config.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/pstl/pstl_config.h b/libstdc++-v3/include/pstl/pstl_config.h
index 74d2139c736..ccb9dd32838 100644
--- a/libstdc++-v3/include/pstl/pstl_config.h
+++ b/libstdc++-v3/include/pstl/pstl_config.h
@@ -82,7 +82,8 @@
 #    define _PSTL_PRAGMA_FORCEINLINE
 #endif
 
-#if defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900
+#if (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900) || \
+    (!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 100000)
 #    define _PSTL_PRAGMA_SIMD_SCAN(PRM) _PSTL_PRAGMA(omp simd reduction(inscan, PRM))
 #    define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan inclusive(PRM))
 #    define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan exclusive(PRM))
@@ -126,7 +127,8 @@
 #    define _PSTL_UDR_PRESENT
 #endif
 
-#if defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900 && __INTEL_COMPILER_BUILD_DATE >= 20180626
+#if (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900 && __INTEL_COMPILER_BUILD_DATE >= 20180626) || \
+    (!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 100000)
 #   define _PSTL_UDS_PRESENT
 #endif
 
-- 
2.41.0


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

* Re: [PATCH] libstdc++: Enable OpenMP 5.0 pragmas in PSTL headers
  2023-06-30 20:15 [PATCH] libstdc++: Enable OpenMP 5.0 pragmas in PSTL headers Jonathan Wakely
@ 2023-07-03 23:07 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2023-07-03 23:07 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, gcc-patches, Jakub Jelinek, Thomas Rodgers

Pushed to trunk now.

On Fri, 30 Jun 2023 at 21:17, Jonathan Wakely via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> Jakub made a similar change a few yeas ago, but I think it got lost
> in the recent PSTL rebase.
>
> Tested x86_64-linux.
>
> Does this look OK for trunk?
>
> -- >8 --
>
> This reapplies r10-1314-g32bab8b6ad0a90 which was lost in the recent
> PSTL rebase from upstream.
>
>         * include/pstl/pstl_config.h (_PSTL_PRAGMA_SIMD_SCAN,
>         _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN, _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN):
>         Define to OpenMP 5.0 pragmas even for GCC 10.0+.
>         (_PSTL_UDS_PRESENT): Define to 1 for GCC 10.0+.
> ---
>  libstdc++-v3/include/pstl/pstl_config.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/libstdc++-v3/include/pstl/pstl_config.h b/libstdc++-v3/include/pstl/pstl_config.h
> index 74d2139c736..ccb9dd32838 100644
> --- a/libstdc++-v3/include/pstl/pstl_config.h
> +++ b/libstdc++-v3/include/pstl/pstl_config.h
> @@ -82,7 +82,8 @@
>  #    define _PSTL_PRAGMA_FORCEINLINE
>  #endif
>
> -#if defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900
> +#if (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900) || \
> +    (!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 100000)
>  #    define _PSTL_PRAGMA_SIMD_SCAN(PRM) _PSTL_PRAGMA(omp simd reduction(inscan, PRM))
>  #    define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan inclusive(PRM))
>  #    define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan exclusive(PRM))
> @@ -126,7 +127,8 @@
>  #    define _PSTL_UDR_PRESENT
>  #endif
>
> -#if defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900 && __INTEL_COMPILER_BUILD_DATE >= 20180626
> +#if (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900 && __INTEL_COMPILER_BUILD_DATE >= 20180626) || \
> +    (!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 100000)
>  #   define _PSTL_UDS_PRESENT
>  #endif
>
> --
> 2.41.0
>


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

end of thread, other threads:[~2023-07-03 23:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-30 20:15 [PATCH] libstdc++: Enable OpenMP 5.0 pragmas in PSTL headers Jonathan Wakely
2023-07-03 23:07 ` Jonathan Wakely

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).