Bobby R. Bruce has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/48059 )

Change subject: docker-util,gpu-compute: Move ROCclr.patch to the repo
......................................................................

docker-util,gpu-compute: Move ROCclr.patch to the repo

This was previously pulled from our Cloud Bucket. This doesn't seem
necessary for such a small patch. Keep this in the repo will make it
easier to change, if needed, in future revisions.

Change-Id: I9b7dbafcd3e750222972850b98fa317aed9d5881
---
M util/dockerfiles/gcn-gpu/Dockerfile
A util/dockerfiles/gcn-gpu/ROCclr.patch
2 files changed, 52 insertions(+), 1 deletion(-)



diff --git a/util/dockerfiles/gcn-gpu/Dockerfile b/util/dockerfiles/gcn-gpu/Dockerfile
index 360ab1f..807f7da 100644
--- a/util/dockerfiles/gcn-gpu/Dockerfile
+++ b/util/dockerfiles/gcn-gpu/Dockerfile
@@ -25,6 +25,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 FROM ubuntu:20.04
 ENV DEBIAN_FRONTEND=noninteractive
+
 RUN apt -y update
 RUN apt -y upgrade
 RUN apt -y install build-essential git m4 scons zlib1g zlib1g-dev \
@@ -70,7 +71,8 @@

 WORKDIR /ROCclr
 # The patch allows us to avoid building blit kernels on-the-fly in gem5
-RUN wget -q -O - dist.gem5.org/dist/develop/rocm_patches/ROCclr.patch | git apply -v
+COPY ROCclr.patch /ROCclr/ROCclr.patch
+RUN git apply -v ROCclr.patch

 WORKDIR /ROCclr/build
 RUN cmake -DOPENCL_DIR="/ROCm-OpenCL-Runtime" \
diff --git a/util/dockerfiles/gcn-gpu/ROCclr.patch b/util/dockerfiles/gcn-gpu/ROCclr.patch
new file mode 100644
index 0000000..0606298
--- /dev/null
+++ b/util/dockerfiles/gcn-gpu/ROCclr.patch
@@ -0,0 +1,49 @@
+diff --git a/device/rocm/rocblit.cpp b/device/rocm/rocblit.cpp
+index 716790c8..67b37913 100644
+--- a/device/rocm/rocblit.cpp
++++ b/device/rocm/rocblit.cpp
+@@ -794,29 +794,7 @@ bool KernelBlitManager::createProgram(Device& device) {
+   // Save context and program for this device
+   context_ = device.blitProgram()->context_;
+   context_->retain();
+-  program_ = device.blitProgram()->program_;
+-  program_->retain();
+-
+-  bool result = false;
+-  do {
+-    // Create kernel objects for all blits
+-    for (uint i = 0; i < BlitTotal; ++i) {
+-      const amd::Symbol* symbol = program_->findSymbol(BlitName[i]);
+-      if (symbol == nullptr) {
+-        break;
+-      }
+-      kernels_[i] = new amd::Kernel(*program_, *symbol, BlitName[i]);
+-      if (kernels_[i] == nullptr) {
+-        break;
+-      }
+-      // Validate blit kernels for the scratch memory usage (pre SI)
+-      if (!device.validateKernel(*kernels_[i], &gpu())) {
+-        break;
+-      }
+-    }
+-
+-    result = true;
+-  } while (!result);
++  bool result = true;
+
+   // Create an internal constant buffer
+ constantBuffer_ = new (*context_) amd::Buffer(*context_, CL_MEM_ALLOC_HOST_PTR, 4 * Ki);
+diff --git a/device/rocm/rocdevice.cpp b/device/rocm/rocdevice.cpp
+index 32cc259c..97950ed7 100755
+--- a/device/rocm/rocdevice.cpp
++++ b/device/rocm/rocdevice.cpp
+@@ -794,6 +794,9 @@ bool Device::createBlitProgram() {
+ #endif  // USE_COMGR_LIBRARY
+
+   blitProgram_ = new BlitProgram(context_);
++  if (blitProgram_ != nullptr) {
++    return true;
++  }
+   // Create blit programs
+   if (blitProgram_ == nullptr || !blitProgram_->create(this, scheduler)) {
+     delete blitProgram_;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/48059
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: release-staging-v21-1
Gerrit-Change-Id: I9b7dbafcd3e750222972850b98fa317aed9d5881
Gerrit-Change-Number: 48059
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to