File: make-openmp-optional.patch

package info (click to toggle)
rocblas 6.4.3%2Bdfsg-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,062,992 kB
  • sloc: cpp: 244,982; f90: 50,012; python: 49,959; sh: 24,623; asm: 2,878; makefile: 149; ansic: 107; xml: 36; awk: 14
file content (59 lines) | stat: -rw-r--r-- 1,908 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From: Cordell Bloor <cgmb@slerp.xyz>
Date: Sun, 9 Apr 2023 02:33:46 -0600
Subject: make openmp optional

Applied-Upstream: https://github.com/ROCmSoftwarePlatform/rocBLAS/commit/45bef63fc4988d11f25c9cc84b12513c7b8abc81
---
 tensile/HostLibraryTests/CachingLibrary_test.cpp       | 2 ++
 tensile/HostLibraryTests/testlib/include/TestUtils.hpp | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/tensile/HostLibraryTests/CachingLibrary_test.cpp b/tensile/HostLibraryTests/CachingLibrary_test.cpp
index 0d31271..ea44a06 100644
--- a/tensile/HostLibraryTests/CachingLibrary_test.cpp
+++ b/tensile/HostLibraryTests/CachingLibrary_test.cpp
@@ -66,7 +66,9 @@ TEST(Cache, Threaded)
     using namespace Tensile;
     CacheMap<int, int> cache(-1);
 
+#ifdef _OPENMP
 #pragma omp parallel num_threads(32)
+#endif
     {
         int seed = 0;
 #ifdef _OPENMP
diff --git a/tensile/HostLibraryTests/testlib/include/TestUtils.hpp b/tensile/HostLibraryTests/testlib/include/TestUtils.hpp
index f146c58..10475ed 100644
--- a/tensile/HostLibraryTests/testlib/include/TestUtils.hpp
+++ b/tensile/HostLibraryTests/testlib/include/TestUtils.hpp
@@ -27,7 +27,9 @@
 #pragma once
 
 #include <cstddef>
+#ifdef _OPENMP
 #include <omp.h>
+#endif
 #include <random>
 
 #include <Tensile/ContractionProblem.hpp>
@@ -99,8 +101,9 @@ namespace Tensile
             throw std::runtime_error("Fix this function to work with dimensions != 3");
 
         auto seed_base = rng();
-
+#ifdef _OPENMP
 #pragma omp parallel num_threads(32)
+#endif
         {
             RNG  myrng = rng;
             auto seed  = seed_base;
@@ -111,7 +114,9 @@ namespace Tensile
 
             std::vector<size_t> index3{0, 0, 0};
 
+#ifdef _OPENMP
 #pragma omp for schedule(static) collapse(2)
+#endif
             for(size_t i = 0; i < desc.sizes()[2]; i++)
             {
                 for(size_t j = 0; j < desc.sizes()[1]; j++)