From 3610972765accc26e76ea590698a9a7e239c85d3 Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 6 Jun 2019 11:45:30 -0400
Subject: [PATCH] P4 to Git Change 1792742 by gandryey@gera-win10 on 2019/06/06
11:13:45
SWDEV-79445 - OCL generic changes and code clean-up
- Update COMGR loader to avoid the build with device layers
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/comgrctx.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#244 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.cpp#23 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.hpp#16 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#45 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.hpp#25 edit
---
rocclr/runtime/device/comgrctx.cpp | 4 +++-
rocclr/runtime/device/device.cpp | 2 +-
rocclr/runtime/device/devkernel.cpp | 14 ++++++++++++++
rocclr/runtime/device/devkernel.hpp | 15 +++------------
rocclr/runtime/device/devprogram.cpp | 1 +
rocclr/runtime/device/devprogram.hpp | 3 ++-
6 files changed, 24 insertions(+), 15 deletions(-)
diff --git a/rocclr/runtime/device/comgrctx.cpp b/rocclr/runtime/device/comgrctx.cpp
index 5e71bf91a3..30b2acab1b 100644
--- a/rocclr/runtime/device/comgrctx.cpp
+++ b/rocclr/runtime/device/comgrctx.cpp
@@ -3,6 +3,7 @@
//
#if defined(USE_COMGR_LIBRARY)
#include "os/os.hpp"
+#include "utils/flags.hpp"
#include "comgrctx.hpp"
namespace amd {
@@ -12,6 +13,7 @@ bool Comgr::is_ready_ = false;
bool Comgr::LoadLib() {
#if defined(COMGR_DYN_DLL)
+ LogInfo("Loading COMGR library.");
static const char* ComgrLibName =
LP64_SWITCH(WINDOWS_SWITCH("amdcomgr.dll", "libamdcomgr32.so"),
WINDOWS_SWITCH("amdcomgr64.dll", "libamdcomgr64.so"));
@@ -69,4 +71,4 @@ bool Comgr::LoadLib() {
}
}
-#endif
\ No newline at end of file
+#endif
diff --git a/rocclr/runtime/device/device.cpp b/rocclr/runtime/device/device.cpp
index be3a95727f..951d944605 100644
--- a/rocclr/runtime/device/device.cpp
+++ b/rocclr/runtime/device/device.cpp
@@ -6,6 +6,7 @@
#include "thread/atomic.hpp"
#include "thread/monitor.hpp"
#include "utils/options.hpp"
+#include "comgrctx.hpp"
#if defined(WITH_HSA_DEVICE)
#include "device/rocm/rocdevice.hpp"
@@ -232,7 +233,6 @@ bool Device::ValidateComgr() {
#if defined(USE_COMGR_LIBRARY)
// Check if Lightning compiler was requested
if (settings_->useLightning_) {
- LogInfo("Loading COMGR library.");
std::call_once(amd::Comgr::initialized, amd::Comgr::LoadLib);
// Use Lightning only if it's available
settings_->useLightning_ = amd::Comgr::IsReady();
diff --git a/rocclr/runtime/device/devkernel.cpp b/rocclr/runtime/device/devkernel.cpp
index e10bcf2301..b7f5d5a83b 100644
--- a/rocclr/runtime/device/devkernel.cpp
+++ b/rocclr/runtime/device/devkernel.cpp
@@ -9,6 +9,7 @@
#include "utils/options.hpp"
#include "utils/bif_section_labels.hpp"
#include "utils/libUtils.h"
+#include "comgrctx.hpp"
#include