public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Check TBB version in tbb-backed effective target check
@ 2019-04-24 19:24 Thomas Rodgers
  2019-04-24 20:37 ` Jonathan Wakely
  2019-05-21  1:09 ` Thomas Rodgers
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Rodgers @ 2019-04-24 19:24 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 124 bytes --]


	* testsuite/lib/libstdc++.exp (check_effective_target_tbb-backend):
	Add check for Thread Building Blocks 2018 or later.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Check-TBB-version-in-tbb-backed-effective-target-che.patch --]
[-- Type: text/x-patch, Size: 2078 bytes --]

From bd3de7b67f184ed1387b63dc3bda1d12f7ebee04 Mon Sep 17 00:00:00 2001
From: Thomas Rodgers <trodgers@redhat.com>
Date: Wed, 24 Apr 2019 11:34:14 -0700
Subject: [PATCH] Check TBB version in tbb-backed effective target check

	* testsuite/lib/libstdc++.exp (check_effective_target_tbb-backend):
	Add check for Thread Building Blocks 2018 or later.
---
 libstdc++-v3/testsuite/lib/libstdc++.exp | 42 +++++++++++++-----------
 1 file changed, 23 insertions(+), 19 deletions(-)

diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index d0efc90a1ba..c48b4d78bbb 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -1607,25 +1607,29 @@ proc check_effective_target_random_device { } {
 
 # Return 1 if tbb parallel backend is available
 proc check_effective_target_tbb-backend { } {
-		global cxxflags
-
-		# Set up and preprocess a C++ test program that depends
-		# on tbb
-		set src tbb_backend[pid].cc
-
-		set f [open $src "w"]
-		puts $f "#include <tbb/tbb.h>"
-		close $f
-		set lines [v3_target_compile $src /dev/null preprocess ""]
-		file delete $src
-
-		if [string match "" $lines] {
-				# No error message, preprocessing succeeded.
-				verbose "check_v3_tbb-backend: `1'" 2
-				return 1
-		}
-		verbose "check_v3_tbb-backend: `0'" 2
-		return 0
+    global cxxflags
+
+    # Set up and preprocess a C++ test program that depends
+    # on tbb
+    set src tbb_backend[pid].cc
+
+    set f [open $src "w"]
+    puts $f "#include <tbb/tbb.h>"
+    puts $f "#if TBB_INTERFACE_VERSION < 10000"
+    puts $f "#  error Intel(R) Threading Building Blocks 2018 is required; older versions are not supported."
+    puts $f "#endif"
+    close $f
+    
+    set lines [v3_target_compile $src /dev/null preprocess ""]
+    file delete $src
+
+    if [string match "" $lines] {
+	# No error message, preprocessing succeeded.
+	verbose "check_v3_tbb-backend: `1'" 2
+	return 1
+    }
+    verbose "check_v3_tbb-backend: `0'" 2
+    return 0
 }
 
 set additional_prunes ""
-- 
2.20.1


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

end of thread, other threads:[~2019-05-21  1:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24 19:24 [PATCH] Check TBB version in tbb-backed effective target check Thomas Rodgers
2019-04-24 20:37 ` Jonathan Wakely
2019-05-21  1:09 ` Thomas Rodgers

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