From eedf013384faade2d092174029a871442ef9c36a Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 24 May 2018 10:45:00 -0400
Subject: [PATCH] P4 to Git Change 1559096 by gandryey@gera-w8 on 2018/05/24
10:34:47
SWDEV-79445 - OCL generic changes and code clean-up
- Remove obsolete logic for aliased kernels, since it was a pre-SI optimization
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#418 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#98 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#52 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/kernel.cpp#27 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/kernel.hpp#21 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#93 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.hpp#44 edit
[ROCm/clr commit: bcea58f07f6bfd6003c06d6607138b39e685dab3]
---
.../clr/rocclr/runtime/device/gpu/gpuvirtual.cpp | 8 +++-----
.../clr/rocclr/runtime/device/pal/palvirtual.cpp | 3 +--
.../clr/rocclr/runtime/device/rocm/rocvirtual.cpp | 3 +--
projects/clr/rocclr/runtime/platform/kernel.cpp | 4 ++--
projects/clr/rocclr/runtime/platform/kernel.hpp | 3 +--
projects/clr/rocclr/runtime/platform/program.cpp | 13 ++++---------
projects/clr/rocclr/runtime/platform/program.hpp | 7 ++-----
7 files changed, 14 insertions(+), 27 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp b/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp
index d435481061..9382b55e49 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp
@@ -1879,9 +1879,8 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const
GpuEvent gpuEvent;
groupOffset = 0;
- // Get the GPU kernel object with optimization enabled
- bool noAlias = true;
- device::Kernel* devKernel = const_cast(kernel.getDeviceKernel(dev(), noAlias));
+ // Get the GPU kernel object
+ device::Kernel* devKernel = const_cast(kernel.getDeviceKernel(dev()));
Kernel& gpuKernelOpt = static_cast(*devKernel);
if (gpuKernelOpt.hsa()) {
@@ -2922,9 +2921,8 @@ void VirtualGPU::profileEvent(EngineType engine, bool type) const {
bool VirtualGPU::processMemObjectsHSA(const amd::Kernel& kernel, const_address params,
bool nativeMem, std::vector* memList) {
- static const bool NoAlias = true;
const HSAILKernel& hsaKernel =
- static_cast(*(kernel.getDeviceKernel(dev(), NoAlias)));
+ static_cast(*(kernel.getDeviceKernel(dev())));
const amd::KernelSignature& signature = kernel.signature();
const amd::KernelParameters& kernelParams = kernel.parameters();
diff --git a/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp b/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp
index a83e969a97..7b7b8dced9 100644
--- a/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp
@@ -2905,9 +2905,8 @@ void VirtualGPU::profileEvent(EngineType engine, bool type) const {
bool VirtualGPU::processMemObjectsHSA(const amd::Kernel& kernel, const_address params,
bool nativeMem) {
- static const bool NoAlias = true;
const HSAILKernel& hsaKernel =
- static_cast(*(kernel.getDeviceKernel(dev(), NoAlias)));
+ static_cast(*(kernel.getDeviceKernel(dev())));
const amd::KernelSignature& signature = kernel.signature();
const amd::KernelParameters& kernelParams = kernel.parameters();
std::vector memList;
diff --git a/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp b/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp
index 501357a5e7..33169dea09 100644
--- a/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp
+++ b/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp
@@ -171,8 +171,7 @@ void VirtualGPU::MemoryDependency::clear(bool all) {
}
bool VirtualGPU::processMemObjects(const amd::Kernel& kernel, const_address params) {
- static const bool NoAlias = true;
- const Kernel& hsaKernel = static_cast(*(kernel.getDeviceKernel(dev(), NoAlias)));
+ const Kernel& hsaKernel = static_cast(*(kernel.getDeviceKernel(dev())));
const amd::KernelSignature& signature = kernel.signature();
const amd::KernelParameters& kernelParams = kernel.parameters();
diff --git a/projects/clr/rocclr/runtime/platform/kernel.cpp b/projects/clr/rocclr/runtime/platform/kernel.cpp
index 47b4a724a0..8d0005a727 100644
--- a/projects/clr/rocclr/runtime/platform/kernel.cpp
+++ b/projects/clr/rocclr/runtime/platform/kernel.cpp
@@ -29,8 +29,8 @@ Kernel::~Kernel() {
delete parameters_;
}
-const device::Kernel* Kernel::getDeviceKernel(const Device& device, bool noAlias) const {
- return symbol_.getDeviceKernel(device, noAlias);
+const device::Kernel* Kernel::getDeviceKernel(const Device& device) const {
+ return symbol_.getDeviceKernel(device);
}
const KernelSignature& Kernel::signature() const { return symbol_.signature(); }
diff --git a/projects/clr/rocclr/runtime/platform/kernel.hpp b/projects/clr/rocclr/runtime/platform/kernel.hpp
index 45403bb335..d18187784d 100644
--- a/projects/clr/rocclr/runtime/platform/kernel.hpp
+++ b/projects/clr/rocclr/runtime/platform/kernel.hpp
@@ -273,8 +273,7 @@ class Kernel : public RuntimeObject {
const KernelSignature& signature() const;
//! Return the kernel entry point for the given device.
- const device::Kernel* getDeviceKernel(const Device& device, //!< Device object
- bool noAlias = true //!< Controls alias optimization
+ const device::Kernel* getDeviceKernel(const Device& device //!< Device object
) const;
//! Return the parameters.
diff --git a/projects/clr/rocclr/runtime/platform/program.cpp b/projects/clr/rocclr/runtime/platform/program.cpp
index 6338f444ad..8515cf3ada 100644
--- a/projects/clr/rocclr/runtime/platform/program.cpp
+++ b/projects/clr/rocclr/runtime/platform/program.cpp
@@ -603,22 +603,17 @@ bool Program::ParseAllOptions(const std::string& options, option::Options& parse
return amd::option::parseAllOptions(allOpts, parsedOptions, linkOptsOnly);
}
-bool Symbol::setDeviceKernel(const Device& device, const device::Kernel* func, bool noAlias) {
+bool Symbol::setDeviceKernel(const Device& device, const device::Kernel* func) {
// FIXME_lmoriche: check that the signatures are compatible
if (deviceKernels_.size() == 0) {
signature_ = func->signature();
}
-
- if (noAlias) {
- deviceKernels_[&device] = func;
- } else {
- devKernelsNoOpt_[&device] = func;
- }
+ deviceKernels_[&device] = func;
return true;
}
-const device::Kernel* Symbol::getDeviceKernel(const Device& device, bool noAlias) const {
- const devicekernels_t* devKernels = (noAlias) ? &deviceKernels_ : &devKernelsNoOpt_;
+const device::Kernel* Symbol::getDeviceKernel(const Device& device) const {
+ const devicekernels_t* devKernels = &deviceKernels_;
const auto itEnd = devKernels->cend();
auto it = devKernels->find(&device);
if (it != itEnd) {
diff --git a/projects/clr/rocclr/runtime/platform/program.hpp b/projects/clr/rocclr/runtime/platform/program.hpp
index 597a03231c..b5b99aa181 100644
--- a/projects/clr/rocclr/runtime/platform/program.hpp
+++ b/projects/clr/rocclr/runtime/platform/program.hpp
@@ -39,7 +39,6 @@ class Symbol : public HeapObject {
private:
devicekernels_t deviceKernels_; //! All device kernels objects.
- devicekernels_t devKernelsNoOpt_; //! Kernel objects without optimization
KernelSignature signature_; //! Kernel signature.
public:
@@ -48,13 +47,11 @@ class Symbol : public HeapObject {
//! Set the entry point and check or set the signature.
bool setDeviceKernel(const Device& device, //!< Device object.
- const device::Kernel* func, //!< Device kernel object.
- bool noAlias = true //!< No-alias optimization
+ const device::Kernel* func //!< Device kernel object.
);
//! Return the device kernel.
- const device::Kernel* getDeviceKernel(const Device& device, //!< Device object.
- bool noAlias = true //!< No-alias optimization
+ const device::Kernel* getDeviceKernel(const Device& device //!< Device object.
) const;
//! Return this Symbol's signature.