File: move-tensile-library-into-versioned-subdir.patch

package info (click to toggle)
rocblas 6.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,082,920 kB
  • sloc: cpp: 245,009; f90: 50,012; python: 50,003; sh: 24,623; asm: 8,917; makefile: 147; ansic: 107; xml: 36; awk: 14
file content (44 lines) | stat: -rw-r--r-- 1,758 bytes parent folder | download | duplicates (3)
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
From: Cordell Bloor <cgmb@slerp.xyz>
Date: Sun, 9 Apr 2023 16:35:21 -0600
Subject: move tensile library into versioned subdir

The Tensile library contains optimized kernels that are loaded at
runtime by rocblas, and thus must be a part of the library package.
To ensure that multiple versions of rocblas with different ABI
versions can be installed side-by-side, the library files must be
moved to a path containing the version number.

Forwarded: yes
Last-Update: 2025-07-04
---
 library/src/tensile_host.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/library/src/tensile_host.cpp b/library/src/tensile_host.cpp
index 1b1289f..d10670d 100644
--- a/library/src/tensile_host.cpp
+++ b/library/src/tensile_host.cpp
@@ -84,6 +84,12 @@ namespace fs = std::experimental::filesystem;
 #error no filesystem found
 #endif
 
+#define TO_STR2(x) #x
+#define TO_STR(x) TO_STR2(x)
+#define ROCBLAS_VERSION_STRING TO_STR(ROCBLAS_VERSION_MAJOR) "." \
+                               TO_STR(ROCBLAS_VERSION_MINOR) "." \
+                               TO_STR(ROCBLAS_VERSION_PATCH)
+
 namespace
 {
 #ifndef WIN32
@@ -762,7 +768,9 @@ namespace
 #endif
 
                     // Find the location of the Tensile libraries relative to shared library
-                    if(TestPath(base_path + "/../../Tensile/library"))
+                    if(TestPath(base_path + "/rocblas/" ROCBLAS_VERSION_STRING "/library"))
+                        base_path += "/rocblas/" ROCBLAS_VERSION_STRING "/library";
+		    else if(TestPath(base_path + "/../../Tensile/library"))
                         base_path += "/../../Tensile/library";
                     else if(TestPath(base_path + "/library"))
                         base_path += "/library";