summaryrefslogtreecommitdiff
path: root/dev-util/Tensile/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
commit4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch)
tree356496503d52354aa6d9f2d36126302fed5f3a73 /dev-util/Tensile/files
parentfcc5224904648a8e6eb528d7603154160a20022f (diff)
gentoo resync : 20.03.2022
Diffstat (limited to 'dev-util/Tensile/files')
-rw-r--r--dev-util/Tensile/files/Tensile-4.3.0-hsaco-compile-specified-arch.patch96
-rw-r--r--dev-util/Tensile/files/Tensile-4.3.0-output-commands.patch23
2 files changed, 119 insertions, 0 deletions
diff --git a/dev-util/Tensile/files/Tensile-4.3.0-hsaco-compile-specified-arch.patch b/dev-util/Tensile/files/Tensile-4.3.0-hsaco-compile-specified-arch.patch
new file mode 100644
index 000000000000..8e6753781a2a
--- /dev/null
+++ b/dev-util/Tensile/files/Tensile-4.3.0-hsaco-compile-specified-arch.patch
@@ -0,0 +1,96 @@
+https://github.com/ROCmSoftwarePlatform/Tensile/issues/1395
+https://github.com/ROCmSoftwarePlatform/Tensile/pull/1398
+
+--- a/Tensile/TensileCreateLibrary.py
++++ b/Tensile/TensileCreateLibrary.py
+@@ -136,6 +136,35 @@ def which(p):
+ return candidate
+ return None
+
++def splitArchs():
++ # Helper for architecture
++ def isSupported(arch):
++ return globalParameters["AsmCaps"][arch]["SupportedISA"] and \
++ globalParameters["AsmCaps"][arch]["SupportedSource"]
++
++ if ";" in globalParameters["Architecture"]:
++ wantedArchs = globalParameters["Architecture"].split(";")
++ else:
++ wantedArchs = globalParameters["Architecture"].split("_")
++ archs = []
++ cmdlineArchs = []
++ if "all" in wantedArchs:
++ for arch in globalParameters['SupportedISA']:
++ if isSupported(arch):
++ if (arch == (9,0,6) or arch == (9,0,8) or arch == (9,0,10)):
++ if (arch == (9,0,10)):
++ archs += [gfxName(arch) + '-xnack+']
++ cmdlineArchs += [gfxName(arch) + ':xnack+']
++ archs += [gfxName(arch) + '-xnack-']
++ cmdlineArchs += [gfxName(arch) + ':xnack-']
++ else:
++ archs += [gfxName(arch)]
++ cmdlineArchs += [gfxName(arch)]
++ else:
++ for arch in wantedArchs:
++ archs += [re.sub(":", "-", arch)]
++ cmdlineArchs += [arch]
++ return archs, cmdlineArchs
+
+ def buildSourceCodeObjectFile(CxxCompiler, outputPath, kernelFile):
+ buildPath = ensurePath(os.path.join(globalParameters['WorkingPath'], 'code_object_tmp'))
+@@ -149,24 +178,8 @@ def buildSourceCodeObjectFile(CxxCompiler, outputPath, kernelFile):
+ objectFilename = base + '.o'
+ soFilename = base + '.so'
+
+- def isSupported(arch):
+- return globalParameters["AsmCaps"][arch]["SupportedISA"] and \
+- globalParameters["AsmCaps"][arch]["SupportedSource"]
+-
+ if (CxxCompiler == "hipcc"):
+- archs = []
+- cmdlineArchs = []
+- for arch in globalParameters['SupportedISA']:
+- if isSupported(arch):
+- if (arch == (9,0,6) or arch == (9,0,8) or arch == (9,0,10)):
+- if (arch == (9,0,10)):
+- archs += [gfxName(arch) + '-xnack+']
+- cmdlineArchs += [gfxName(arch) + ':xnack+']
+- archs += [gfxName(arch) + '-xnack-']
+- cmdlineArchs += [gfxName(arch) + ':xnack-']
+- else:
+- archs += [gfxName(arch)]
+- cmdlineArchs += [gfxName(arch)]
++ archs, cmdlineArchs = splitArchs()
+
+ archFlags = ['--offload-arch=' + arch for arch in cmdlineArchs]
+
+@@ -1063,11 +1076,6 @@ def buildObjectFileNames(solutionWriter, kernelWriterSource, kernelWriterAssembl
+ sourceKernels = list([k for k in kernels if k['KernelLanguage'] == 'Source'])
+ asmKernels = list([k for k in kernels if k['KernelLanguage'] == 'Assembly'])
+
+- # Helper for architecture
+- def isSupported(arch):
+- return globalParameters["AsmCaps"][arch]["SupportedISA"] and \
+- globalParameters["AsmCaps"][arch]["SupportedSource"]
+-
+ # Build a list of kernel object names.
+ for kernel in sourceKernels:
+ sourceKernelNames += [kernelWriterSource.getKernelFileBase(kernel)]
+@@ -1081,15 +1089,7 @@ def buildObjectFileNames(solutionWriter, kernelWriterSource, kernelWriterAssembl
+
+ # Source based kernels are built for all supported architectures
+ if (cxxCompiler == 'hipcc'):
+- sourceArchs = []
+- for arch in globalParameters['SupportedISA']:
+- if isSupported(arch):
+- if (arch == (9,0,6) or arch == (9,0,8) or arch == (9,0,10)):
+- if (arch == (9,0,10)):
+- sourceArchs += [gfxName(arch) + '-xnack+']
+- sourceArchs += [gfxName(arch) + '-xnack-']
+- else:
+- sourceArchs += [gfxName(arch)]
++ sourceArchs, _ = splitArchs()
+ else:
+ raise RuntimeError("Unknown compiler %s" % cxxCompiler)
+
diff --git a/dev-util/Tensile/files/Tensile-4.3.0-output-commands.patch b/dev-util/Tensile/files/Tensile-4.3.0-output-commands.patch
new file mode 100644
index 000000000000..be5a4db21429
--- /dev/null
+++ b/dev-util/Tensile/files/Tensile-4.3.0-output-commands.patch
@@ -0,0 +1,23 @@
+diff --color -uprN orig/Tensile/cmake/TensileConfig.cmake Tensile-rocm-4.3.0/Tensile/cmake/TensileConfig.cmake
+--- orig/Tensile/cmake/TensileConfig.cmake 2021-08-18 17:48:00.115478470 +0800
++++ Tensile-rocm-4.3.0/Tensile/cmake/TensileConfig.cmake 2021-08-18 17:48:49.963478801 +0800
+@@ -234,6 +234,7 @@ function(TensileCreateLibraryFiles
+ COMMENT "Generating Tensile Libraries"
+ OUTPUT ${Tensile_EMBED_LIBRARY_SOURCE};${Tensile_MANIFEST_CONTENTS}
+ COMMAND ${CommandLine}
++ USES_TERMINAL
+ )
+
+ set("${Tensile_VAR_PREFIX}_ALL_FILES" ${Tensile_MANIFEST_CONTENTS} PARENT_SCOPE)
+diff --color -uprN orig/Tensile/Common.py Tensile-rocm-4.3.0/Tensile/Common.py
+--- orig/Tensile/Common.py 2021-08-18 17:48:00.075478470 +0800
++++ Tensile-rocm-4.3.0/Tensile/Common.py 2021-08-18 17:48:23.287478624 +0800
+@@ -179,7 +179,7 @@ globalParameters["PrintTensorD"] = 0
+ globalParameters["PrintTensorRef"] = 0 # Print reference tensor. 0x1=after init; 0x2=after copy-back; 0x3=both
+ globalParameters["PrintIndexAssignments"] = 0 # Print the tensor index assignment info
+ globalParameters["PrintWinnersOnly"] = False # Only print the solutions which become the fastest
+-globalParameters["PrintCodeCommands"] = False # print the commands used to generate the code objects (asm,link,hip-clang, etc)
++globalParameters["PrintCodeCommands"] = True # print the commands used to generate the code objects (asm,link,hip-clang, etc)
+ globalParameters["DumpTensors"] = False # If True, dump tensors to binary files instead of printing them.
+
+ # TODO - remove this when NewClient is mainstream