P4 to Git Change 1104627 by gandryey@gera-dev-w7 on 2014/12/11 12:01:30
EPR #411058 - [CQE OCL][Lnx][QR][CZ]MultiDevice_Context fails in 2.0 conformance wimpyfull due to CL# 1101352 - The detection of different map types is overcomplicated with possibility of multiple maps and multithreading environment. Thus keep USWC indirect map optimization based on the allocation flags. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.cpp#114 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.hpp#46 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#342 edit
Этот коммит содержится в:
@@ -922,8 +922,7 @@ Memory::allocMapTarget(
|
||||
incIndMapCount();
|
||||
|
||||
// If host memory exists, use it
|
||||
if ((owner()->getHostMem() != NULL) &&
|
||||
isDirectMap(mapFlags)) {
|
||||
if ((owner()->getHostMem() != NULL) && isDirectMap()) {
|
||||
mapAddress = reinterpret_cast<address>(owner()->getHostMem());
|
||||
}
|
||||
// If resource is a persistent allocation, we can use it directly
|
||||
@@ -1248,8 +1247,7 @@ Image::allocMapTarget(
|
||||
incIndMapCount();
|
||||
|
||||
// If host memory exists, use it
|
||||
if ((owner()->getHostMem() != NULL) &&
|
||||
isDirectMap(mapFlags)) {
|
||||
if ((owner()->getHostMem() != NULL) && isDirectMap()) {
|
||||
useRemoteResource = false;
|
||||
mapAddress = reinterpret_cast<address>(owner()->getHostMem());
|
||||
amd::Image* amdImage = owner()->asImage();
|
||||
|
||||
@@ -200,20 +200,14 @@ public:
|
||||
//! Returns the interop resource for this memory object
|
||||
const Memory* parent() const { return parent_; }
|
||||
|
||||
//! Returns TRUE if direct map is acceaptable
|
||||
//! The method detects forced USWC memory on APU and
|
||||
//! will cause a switch to indirect map for MAP_READ operations
|
||||
bool isDirectMap(uint mapFlags)
|
||||
//! Returns TRUE if direct map is acceaptable. The method detects
|
||||
//! forced USWC memory on APU and will cause a switch to
|
||||
//! indirect map for allocations with a possibility of host read
|
||||
bool isDirectMap()
|
||||
{
|
||||
return (((isCacheable() || (owner()->getMemFlags() & CL_MEM_ALLOC_HOST_PTR) ||
|
||||
!isHostMemDirectAccess() || !(mapFlags & CL_MAP_READ)) &&
|
||||
// If map(indirect) memory isn't NULL,
|
||||
// then it's a double map from the app with different map flags.
|
||||
// If runtime will provide different regions,
|
||||
// then it won't be able to guarantee coherency
|
||||
(mapMemory_ == NULL)) ||
|
||||
// Keep direct map always if the first map was direct already
|
||||
((indirectMapCount_ > 1) && (mapMemory_ == NULL)));
|
||||
return (isCacheable() || !isHostMemDirectAccess() ||
|
||||
(owner()->getMemFlags() &
|
||||
(CL_MEM_ALLOC_HOST_PTR | CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY)));
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -1090,8 +1090,7 @@ VirtualGPU::submitMapMemory(amd::MapMemoryCommand& vcmd)
|
||||
vcmd.mapFlags(), vcmd.isEntireMemory());
|
||||
|
||||
// If we have host memory, use it
|
||||
if ((memory->owner()->getHostMem() != NULL) &&
|
||||
memory->isDirectMap(vcmd.mapFlags())) {
|
||||
if ((memory->owner()->getHostMem() != NULL) && memory->isDirectMap()) {
|
||||
if (!memory->isHostMemDirectAccess()) {
|
||||
// Make sure GPU finished operation before
|
||||
// synchronization with the backing store
|
||||
@@ -1176,8 +1175,7 @@ VirtualGPU::submitUnmapMemory(amd::UnmapMemoryCommand& vcmd)
|
||||
amd::Memory* owner = memory->owner();
|
||||
|
||||
// We used host memory
|
||||
if ((owner->getHostMem() != NULL) &&
|
||||
memory->isDirectMap(memory->isUnmapRead() ? CL_MAP_READ : 0)) {
|
||||
if ((owner->getHostMem() != NULL) && memory->isDirectMap()) {
|
||||
if (memory->isUnmapWrite()) {
|
||||
// Target is the backing store, so sync
|
||||
owner->signalWrite(NULL);
|
||||
|
||||
Ссылка в новой задаче
Block a user