P4 to Git Change 1970157 by gandryey@gera-win10 on 2019/07/18 18:06:12

SWDEV-189140 - Add P2P support in PAL path
	- Don't add host mem direct access flag for P2P buffers
	- Avoid sync cocherency logic for P2P buffers

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#27 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.hpp#13 edit
This commit is contained in:
foreman
2019-07-18 18:18:09 -04:00
parent 88227c7575
commit b7ab73b6db
2 changed files with 8 additions and 4 deletions
+3 -4
View File
@@ -123,7 +123,6 @@ bool Memory::create(Resource::MemoryType memType, Resource::CreateParams* params
switch (memoryType()) {
case Resource::Pinned:
case Resource::ExternalPhysical:
case Resource::P2PAccess:
// Marks memory object for direct GPU access to the host memory
flags_ |= HostMemoryDirectAccess;
break;
@@ -407,13 +406,13 @@ Memory::~Memory() {
void Memory::syncCacheFromHost(VirtualGPU& gpu, device::Memory::SyncFlags syncFlags) {
// If the last writer was another GPU, then make a writeback
if (!isHostMemDirectAccess() && (owner()->getLastWriter() != nullptr) &&
if (isChacheCoherencySync() && (owner()->getLastWriter() != nullptr) &&
(&dev() != owner()->getLastWriter())) {
mgpuCacheWriteBack();
}
// If host memory doesn't have direct access, then we have to synchronize
if (!isHostMemDirectAccess() && (nullptr != owner()->getHostMem())) {
if (isChacheCoherencySync() && (nullptr != owner()->getHostMem())) {
bool hasUpdates = true;
// Make sure the parent of subbuffer is up to date
@@ -526,7 +525,7 @@ void Memory::syncHostFromCache(device::Memory::SyncFlags syncFlags) {
assert(owner() != nullptr);
// If host memory doesn't have direct access, then we have to synchronize
if (!isHostMemDirectAccess()) {
if (isChacheCoherencySync()) {
bool hasUpdates = true;
// Make sure the parent of subbuffer is up to date
+5
View File
@@ -152,6 +152,11 @@ class Memory : public device::Memory, public Resource {
Resource::updateView(view, offset, size);
}
//! Check if memory object requires cache coherency sync
bool isChacheCoherencySync() const {
return (!isHostMemDirectAccess() && (memoryType() != P2PAccess));
}
protected:
//! Decrement map count
void decIndMapCount();