From c3f3ef430ff97db5f0c1e6acee9791929217db55 Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 27 Jun 2019 18:24:28 -0400
Subject: [PATCH] P4 to Git Change 1914428 by gandryey@gera-win10 on 2019/06/27
18:22:17
SWDEV-79445 - OCL generic changes and code clean-up
- Remove all compilaiton flags for LC. LC should be selected dynamically only.
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/OPTIONS.def#141 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#146 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#86 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#130 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#45 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#312 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/macros.hpp#12 edit
---
rocclr/compiler/lib/utils/OPTIONS.def | 4 ++--
rocclr/runtime/device/pal/paldevice.cpp | 3 +--
rocclr/runtime/device/pal/palsettings.cpp | 4 ++--
rocclr/runtime/device/rocm/rocdevice.cpp | 3 +--
rocclr/runtime/device/rocm/rocsettings.cpp | 2 +-
rocclr/runtime/utils/flags.hpp | 4 ++--
rocclr/runtime/utils/macros.hpp | 13 -------------
7 files changed, 9 insertions(+), 24 deletions(-)
diff --git a/rocclr/compiler/lib/utils/OPTIONS.def b/rocclr/compiler/lib/utils/OPTIONS.def
index 3df97a2cc5..af586672f8 100644
--- a/rocclr/compiler/lib/utils/OPTIONS.def
+++ b/rocclr/compiler/lib/utils/OPTIONS.def
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 Advanced Micro Devices, Inc. All rights reserved.
+// Copyright (c) 2010 Advanced Micro Devices, Inc. All rights reserved.
//
/*
@@ -499,7 +499,7 @@ OPTION(OT_BOOL, \
OA_RUNTIME|OVIS_INTERNAL|OVA_DISALLOWED|OFA_PREFIX_F, \
"bin-gpu64", NULL, \
EnableGpuElf64, \
- IS_LIGHTNING ? true : false, 0, 0, NULL, \
+ false, 0, 0, NULL, \
"Generate 64-bit ELF binary for GPU (default: 32-bit)")
// -fdebug-linker -fno-debug-linker
diff --git a/rocclr/runtime/device/pal/paldevice.cpp b/rocclr/runtime/device/pal/paldevice.cpp
index 90eff0f8e9..c8b8417db2 100644
--- a/rocclr/runtime/device/pal/paldevice.cpp
+++ b/rocclr/runtime/device/pal/paldevice.cpp
@@ -114,8 +114,7 @@ bool NullDevice::init() {
for (uint id = 0; id < sizeof(Gfx9PlusSubDeviceInfo) / sizeof(AMDDeviceInfo); ++id) {
bool foundActive = false;
bool foundDuplicate = false;
- uint gfxipVersion = IS_LIGHTNING ? pal::Gfx9PlusSubDeviceInfo[id].gfxipVersionLC_
- : pal::Gfx9PlusSubDeviceInfo[id].gfxipVersion_;
+ uint gfxipVersion = pal::Gfx9PlusSubDeviceInfo[id].gfxipVersion_;
if (pal::Gfx9PlusSubDeviceInfo[id].machineTarget_[0] == '\0') {
continue;
diff --git a/rocclr/runtime/device/pal/palsettings.cpp b/rocclr/runtime/device/pal/palsettings.cpp
index 8730e6dc30..a976199d09 100644
--- a/rocclr/runtime/device/pal/palsettings.cpp
+++ b/rocclr/runtime/device/pal/palsettings.cpp
@@ -138,7 +138,7 @@ Settings::Settings() {
std::min(static_cast(GPU_MAX_SUBALLOC_SIZE) * Ki, subAllocationChunkSize_);
maxCmdBuffers_ = 12;
- useLightning_ = amd::IS_HIP ? true : GPU_ENABLE_LC;
+ useLightning_ = amd::IS_HIP ? true : ((!flagIsDefault(GPU_ENABLE_LC)) ? GPU_ENABLE_LC : false);
enableWgpMode_ = false;
enableWave32Mode_ = false;
hsailExplicitXnack_ = false;
@@ -196,7 +196,7 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
case Pal::AsicRevision::Navi10_A0:
case Pal::AsicRevision::Navi10Lite:
gfx10Plus_ = true;
- useLightning_ = (!flagIsDefault(GPU_ENABLE_LC)) ? GPU_ENABLE_LC : true;
+ useLightning_ = GPU_ENABLE_LC;
hsailExplicitXnack_ =
static_cast(palProp.gpuMemoryProperties.flags.pageMigrationEnabled ||
palProp.gpuMemoryProperties.flags.iommuv2Support);
diff --git a/rocclr/runtime/device/rocm/rocdevice.cpp b/rocclr/runtime/device/rocm/rocdevice.cpp
index 1072905077..28800111c8 100644
--- a/rocclr/runtime/device/rocm/rocdevice.cpp
+++ b/rocclr/runtime/device/rocm/rocdevice.cpp
@@ -215,8 +215,7 @@ bool NullDevice::initCompiler(bool isOffline) {
acl_error error;
if (!compilerHandle_) {
aclCompilerOptions opts = {
- sizeof(aclCompilerOptions_0_8),
- IF(IS_LIGHTNING, "libamdoclcl64.so", NULL),
+ sizeof(aclCompilerOptions_0_8), "libamdoclcl64.so",
NULL, NULL, NULL, NULL, NULL, NULL
};
compilerHandle_ = aclCompilerInit(&opts, &error);
diff --git a/rocclr/runtime/device/rocm/rocsettings.cpp b/rocclr/runtime/device/rocm/rocsettings.cpp
index 0bf90d044c..277cf3c0cd 100644
--- a/rocclr/runtime/device/rocm/rocsettings.cpp
+++ b/rocclr/runtime/device/rocm/rocsettings.cpp
@@ -67,7 +67,7 @@ Settings::Settings() {
numDeviceEvents_ = 1024;
numWaitEvents_ = 8;
- useLightning_ = GPU_ENABLE_LC;
+ useLightning_ = (!flagIsDefault(GPU_ENABLE_LC)) ? GPU_ENABLE_LC : true;
lcWavefrontSize64_ = true;
}
diff --git a/rocclr/runtime/utils/flags.hpp b/rocclr/runtime/utils/flags.hpp
index 7e91958515..fcb1e10314 100644
--- a/rocclr/runtime/utils/flags.hpp
+++ b/rocclr/runtime/utils/flags.hpp
@@ -123,7 +123,7 @@ release(bool, GPU_IFH_MODE, false, \
"1 = Enable GPU IFH (infinitely fast hardware) mode. Any other value keeps setting disabled.") \
release(bool, GPU_MIPMAP, true, \
"Enables GPU mipmap extension") \
-release(uint, GPU_ENABLE_PAL, IF(IS_LIGHTNING,1,2), \
+release(uint, GPU_ENABLE_PAL, 2, \
"Enables PAL backend. 0 - GSL(default), 1 - PAL, 2 - GSL and PAL") \
release(bool, DISABLE_DEFERRED_ALLOC, false, \
"Disables deferred memory allocation on device") \
@@ -169,7 +169,7 @@ release(uint, PAL_RGP_DISP_COUNT, 50, \
"The number of dispatches for RGP capture with SQTT") \
release(bool, GPU_ENABLE_WAVE32_MODE, true, \
"Enables Wave32 compilation in HW if available") \
-release(bool, GPU_ENABLE_LC, IS_LIGHTNING, \
+release(bool, GPU_ENABLE_LC, true, \
"Enables LC path") \
release(bool, GPU_ENABLE_HW_P2P, false, \
"Enables HW P2P path") \
diff --git a/rocclr/runtime/utils/macros.hpp b/rocclr/runtime/utils/macros.hpp
index 576e44c78d..67aa6b9665 100644
--- a/rocclr/runtime/utils/macros.hpp
+++ b/rocclr/runtime/utils/macros.hpp
@@ -98,15 +98,6 @@
#define NOT_WIN64(x) x
#endif /*!_WIN64*/
-#ifdef WITH_LIGHTNING_COMPILER
-#define LIGHTNING_ONLY(x) x
-#define NOT_LIGHTNING(x)
-#define IS_LIGHTNING true
-#else /* !WITH_LIGHTNING_COMPILER */
-#define LIGHTNING_ONLY(x)
-#define NOT_LIGHTNING(x) x
-#endif /* !WITH_LIGHTNING_COMPILER */
-
#ifndef IS_LINUX
#define IS_LINUX false
#endif
@@ -116,9 +107,6 @@
#ifndef IS_WINDOWS
#define IS_WINDOWS false
#endif
-#ifndef IS_LIGHTNING
-#define IS_LIGHTNING false
-#endif
#define IF_LEFT_true(x) x
#define IF_LEFT_false(x)
@@ -129,7 +117,6 @@
#define IF_RIGHT(cond, x) IF_RIGHT_##cond(x)
#define IF(cond, x, y) IF_LEFT(cond, x) IF_RIGHT(cond, y)
-#define LIGHTNING_SWITCH(x, other) LIGHTNING_ONLY(x) NOT_LIGHTNING(other)
#define LINUX_SWITCH(x, other) LINUX_ONLY(x) NOT_LINUX(other)
#define MACOS_SWITCH(x, other) MACOS_ONLY(x) NOT_MACOS(other)
#define WINDOWS_SWITCH(x, other) WINDOWS_ONLY(x) NOT_WINDOWS(other)