From f3f7e18f5f8b70e905daf15e3ca4a2404bc130d4 Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 12 Dec 2018 15:53:41 -0500
Subject: [PATCH] P4 to Git Change 1719466 by wchau@wchau_OCL_boltzmann on
2018/12/12 15:42:59
SWDEV-169078 - Also copy private_segment_size/group_segment_size to runtime handle for COMgr support
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#75 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#46 edit
[ROCm/clr commit: f9b6ad644950c53ca9b137ed8f50bbd05bec017d]
---
projects/clr/rocclr/runtime/device/pal/palkernel.cpp | 8 +++++++-
projects/clr/rocclr/runtime/device/rocm/rockernel.cpp | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/pal/palkernel.cpp b/projects/clr/rocclr/runtime/device/pal/palkernel.cpp
index d0749c55f3..bb4ed8d682 100644
--- a/projects/clr/rocclr/runtime/device/pal/palkernel.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/palkernel.cpp
@@ -421,7 +421,13 @@ bool LightningKernel::init(amd::hsa::loader::Symbol* symbol) {
uint64_t kernel_object = gpuAqlCode();
VirtualGPU* gpu = codeSegGpu.dev().xferQueue();
- codeSegGpu.writeRawData(*gpu, offset, 8, &kernel_object, true);
+ const struct RuntimeHandle runtime_handle = {
+ gpuAqlCode(),
+ spillSegSize(),
+ ldsSize()
+ };
+
+ codeSegGpu.writeRawData(*gpu, offset, sizeof(runtime_handle), &runtime_handle, true);
}
// Copy wavefront size
diff --git a/projects/clr/rocclr/runtime/device/rocm/rockernel.cpp b/projects/clr/rocclr/runtime/device/rocm/rockernel.cpp
index 514ec20913..7c843fce2c 100644
--- a/projects/clr/rocclr/runtime/device/rocm/rockernel.cpp
+++ b/projects/clr/rocclr/runtime/device/rocm/rockernel.cpp
@@ -85,9 +85,15 @@ bool LightningKernel::init() {
HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ADDRESS,
&variable_address);
}
+
if (hsaStatus == HSA_STATUS_SUCCESS) {
+ const struct RuntimeHandle runtime_handle = {
+ kernelCodeHandle_,
+ workitemPrivateSegmentByteSize(),
+ WorkgroupGroupSegmentByteSize()
+ };
hsaStatus = hsa_memory_copy(reinterpret_cast(variable_address),
- &kernelCodeHandle_, variable_size);
+ &runtime_handle, variable_size);
}
if (hsaStatus != HSA_STATUS_SUCCESS) {