From 5cf3d1eb339efe06aed1b4a824c92c4d57b140cf Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 6 Nov 2019 18:22:20 -0500
Subject: [PATCH] P4 to Git Change 2026159 by gandryey@gera-win10 on 2019/11/06
18:14:30
SWDEV-79445 - OCL generic changes and code clean-up
- Fix the detection of all devices for P2P. The previous logic worked only if GPU_ENABLE_PAL was forced to 1.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#174 edit
[ROCm/clr commit: f6ce2e78eaa904b5266ba6831a8986c188f551a8]
---
projects/clr/rocclr/runtime/device/pal/paldevice.cpp | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp
index f9032327b0..21ce72d743 100644
--- a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp
@@ -1161,7 +1161,7 @@ void PAL_STDCALL Device::PalDeveloperCallback(void* pPrivateData, const Pal::uin
default:
break;
}
-#endif // PAL_GPUOPEN_OCL
+#endif // PAL_GPUOPEN_OCL
}
bool Device::initializeHeapResources() {
@@ -1388,7 +1388,7 @@ bool Device::init() {
Device::tearDown();
} else {
// Loop through all available devices
- uint32_t all_devices = amd::Device::numDevices(CL_DEVICE_TYPE_GPU, false);
+ uint32_t all_devices = devices().size();
for (uint32_t device0 = gStartDevice; device0 < all_devices; ++device0) {
// Find all device that can have access to the current device
for (uint32_t device1 = gStartDevice; device1 < all_devices; ++device1) {
@@ -1678,8 +1678,7 @@ pal::Memory* Device::createImage(amd::Memory& owner, bool directAccess) const {
// Create resource
if (nullptr != gpuImage) {
const bool imageBuffer =
- ((owner.parent() != nullptr) &&
- (owner.parent()->asBuffer() != nullptr));
+ ((owner.parent() != nullptr) && (owner.parent()->asBuffer() != nullptr));
bool result = false;
// Check if owner is interop memory