summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/hip/files')
-rw-r--r--dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch35
-rw-r--r--dev-util/hip/files/hip-5.1.3-clang-include-path.patch12
-rw-r--r--dev-util/hip/files/hip-5.1.3-fix-hip_prof_gen.patch38
-rw-r--r--dev-util/hip/files/hip-5.1.3-rocm-path.patch13
-rw-r--r--dev-util/hip/files/hipvars-5.1.3.pm21
5 files changed, 119 insertions, 0 deletions
diff --git a/dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch b/dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch
new file mode 100644
index 000000000000..14af91f9055b
--- /dev/null
+++ b/dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch
@@ -0,0 +1,35 @@
+From 4168c6ded4e54602f6fad8b0a483b20ab7f83cd5 Mon Sep 17 00:00:00 2001
+From: haoyuan2 <Hao.Yuan@amd.com>
+Date: Mon, 21 Feb 2022 10:10:04 -0800
+Subject: [PATCH] SWDEV-316128 - HIP surface API support
+
+remove redundant code in host API
+
+Change-Id: I8fbf894e858642da4198cc7afd2d2e2f1971e738
+Signed-off-by: YiyangWu <xgreenlandforwyy@gmail.com>
+---
+ src/hip_surface.cpp | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/src/hip_surface.cpp b/src/hip_surface.cpp
+index 831df321..a8e7f71d 100644
+--- a/src/hip_surface.cpp
++++ b/src/hip_surface.cpp
+@@ -1,4 +1,4 @@
+-/* Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc.
++/* Copyright (c) 2015 - 2022 Advanced Micro Devices, Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+@@ -81,8 +81,6 @@ hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject,
+ }
+
+ hipError_t ihipDestroySurfaceObject(hipSurfaceObject_t surfaceObject) {
+- HIP_INIT_API(hipDestroySurfaceObject, surfaceObject);
+-
+ if (surfaceObject == nullptr) {
+ return hipSuccess;
+ }
+--
+2.34.1
+
diff --git a/dev-util/hip/files/hip-5.1.3-clang-include-path.patch b/dev-util/hip/files/hip-5.1.3-clang-include-path.patch
new file mode 100644
index 000000000000..bf1f2dd32ce5
--- /dev/null
+++ b/dev-util/hip/files/hip-5.1.3-clang-include-path.patch
@@ -0,0 +1,12 @@
+pass HIP_CLANG_INCLUDE_PATH which is determined by clang -print-resource-dir
+===================================================================
+--- HIP-rocm-5.1.3.orig/bin/hipcc.pl
++++ HIP-rocm-5.1.3/bin/hipcc.pl
+@@ -105,6 +105,7 @@ $ROCM_PATH = $hipvars::ROCM_PATH;
+ $HIP_VERSION = $hipvars::HIP_VERSION;
+ $HSA_PATH = $hipvars::HSA_PATH;
+ $HIP_ROCCLR_HOME = $hipvars::HIP_ROCCLR_HOME;
++$HIP_CLANG_INCLUDE_PATH = $hipvars::HIP_CLANG_INCLUDE_PATH;
+
+ if ($HIP_PLATFORM eq "amd") {
+ # If using ROCclr runtime, need to find HIP_ROCCLR_HOME
diff --git a/dev-util/hip/files/hip-5.1.3-fix-hip_prof_gen.patch b/dev-util/hip/files/hip-5.1.3-fix-hip_prof_gen.patch
new file mode 100644
index 000000000000..05b25e7178fa
--- /dev/null
+++ b/dev-util/hip/files/hip-5.1.3-fix-hip_prof_gen.patch
@@ -0,0 +1,38 @@
+Backported fb5a64025bb0e10173a1ee4f3475db322b74b594
+fix an issue in hip_prof_gen.py with GLenum.
+diff --git a/src/hip_prof_gen.py b/src/hip_prof_gen.py
+index bd32d5bf..a3071a75 100755
+--- a/src/hip_prof_gen.py
++++ b/src/hip_prof_gen.py
+@@ -81,7 +81,7 @@ def filtr_api_args(args_str):
+ args_str = re.sub(r'\s*,\s*', r',', args_str);
+ args_str = re.sub(r'\s+', r' ', args_str);
+ args_str = re.sub(r'\s*(\*+)\s*', r'\1 ', args_str);
+- args_str = re.sub(r'(enum|struct) ', '', args_str);
++ args_str = re.sub(r'(\benum|struct) ', '', args_str);
+ return args_str
+
+ # Normalizing types
+@@ -129,7 +129,9 @@ def pointer_ck(arg_type):
+ m = re.match(r'(.*)\*$', arg_type)
+ if m:
+ ptr_type = m.group(1)
+- ptr_type = re.sub(r'const ', '', ptr_type)
++ n = re.match(r'(.*)\*\*$', arg_type)
++ if not n:
++ ptr_type = re.sub(r'const ', '', ptr_type)
+ if ptr_type == 'void': ptr_type = ''
+ return ptr_type
+ #############################################################
+@@ -613,7 +615,7 @@ if (len(sys.argv) < 4):
+ " -p - HIP_INIT_API macro patching mode\n" +
+ "\n" +
+ " Example:\n" +
+- " $ " + sys.argv[0] + " -v -p -t --priv ./include/hip/amd_detail/hip_runtime_api.h" +
++ " $ " + sys.argv[0] + " -v -p -t --priv ../hip/include/hip/hip_runtime_api.h" +
+ " ./src ./include/hip/amd_detail/hip_prof_str.h ./include/hip/amd_detail/hip_prof_str.h.new");
+
+ # API header file given as an argument
+--
+2.34.1
+
diff --git a/dev-util/hip/files/hip-5.1.3-rocm-path.patch b/dev-util/hip/files/hip-5.1.3-rocm-path.patch
new file mode 100644
index 000000000000..2ce68b733577
--- /dev/null
+++ b/dev-util/hip/files/hip-5.1.3-rocm-path.patch
@@ -0,0 +1,13 @@
+explicitly specify `--rocm-path=/usr` because clang does not list
+it among the default paths
+===================================================================
+--- HIP-rocm-5.1.3.orig/bin/hipcc.pl
++++ HIP-rocm-5.1.3/bin/hipcc.pl
+@@ -696,6 +696,7 @@ if ($HIP_PLATFORM eq "amd") {
+
+ if ($hasHIP) {
+ if ($DEVICE_LIB_PATH ne "$ROCM_PATH/amdgcn/bitcode") {
++ $HIPCXXFLAGS .= " --rocm-path=\"$ROCM_PATH\"";
+ $HIPCXXFLAGS .= " --hip-device-lib-path=\"$DEVICE_LIB_PATH\"";
+ }
+ $HIPCXXFLAGS .= " -fhip-new-launch-api";
diff --git a/dev-util/hip/files/hipvars-5.1.3.pm b/dev-util/hip/files/hipvars-5.1.3.pm
new file mode 100644
index 000000000000..7de38b7f3c78
--- /dev/null
+++ b/dev-util/hip/files/hipvars-5.1.3.pm
@@ -0,0 +1,21 @@
+#!/usr/bin/perl -w
+package hipvars;
+
+$HIP_BASE_VERSION_MAJOR = "@HIP_BASE_VERSION_MAJOR@";
+$HIP_BASE_VERSION_MINOR = "@HIP_BASE_VERSION_MINOR@";
+
+$isWindows = 0;
+$HIP_PATH='/usr';
+$ROCM_PATH='/usr';
+$CUDA_PATH='/opt/cuda';
+$HSA_PATH='/usr';
+$HIP_CLANG_PATH='@CLANG_PATH@';
+$HIP_CLANG_INCLUDE_PATH='@CLANG_INCLUDE_PATH@';
+$HIP_ROCCLR_HOME=$HIP_PATH;
+$HIP_PLATFORM='amd';
+$HIP_COMPILER = "clang";
+$HIP_RUNTIME = "rocclr";
+$HIP_VERSION_MAJOR = $HIP_BASE_VERSION_MAJOR;
+$HIP_VERSION_MINOR = $HIP_BASE_VERSION_MINOR;
+$HIP_VERSION_PATCH = "@HIP_VERSION_PATCH@";
+$HIP_VERSION="$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";