P4 to Git Change 1559383 by gandryey@gera-w8 on 2018/05/24 18:38:36
SWDEV-79445 - OCL generic changes and code clean-up - Remove memory reallocation interfaces. It was used for AMDIL path with HW constant buffers support. It seems AMDIL with SI+ doesn't enable HW const buffers. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#303 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#589 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#166 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#324 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#129 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.cpp#132 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.hpp#52 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#90 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#29 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#51 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.hpp#16 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#21 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.hpp#8 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#29 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#105 edit
Αυτή η υποβολή περιλαμβάνεται σε:
@@ -1633,67 +1633,6 @@ bool Device::createSampler(const amd::Sampler& owner, device::Sampler** sampler)
|
||||
return true;
|
||||
}
|
||||
|
||||
//! \note reallocMemory() must be called only from outside of
|
||||
//! VirtualGPU submit commands methods.
|
||||
//! Otherwise a deadlock in lockVgpus() is possible
|
||||
|
||||
bool Device::reallocMemory(amd::Memory& owner) const {
|
||||
bool directAccess = false;
|
||||
|
||||
// For now we have to serialize reallocation code
|
||||
amd::ScopedLock lk(*lockAsyncOps_);
|
||||
|
||||
// Read device memory after the lock,
|
||||
// since realloc from another thread can replace the pointer
|
||||
gpu::Memory* gpuMemory = getGpuMemory(&owner);
|
||||
if (gpuMemory == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (gpuMemory->pinOffset() == 0) {
|
||||
return true;
|
||||
} else if (NULL != owner.parent()) {
|
||||
if (!reallocMemory(*owner.parent())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (owner.asBuffer()) {
|
||||
gpuMemory = createBuffer(owner, directAccess);
|
||||
} else if (owner.asImage()) {
|
||||
return true;
|
||||
} else {
|
||||
LogError("Unknown memory type!");
|
||||
}
|
||||
|
||||
if (gpuMemory != NULL) {
|
||||
gpu::Memory* newMemory = gpuMemory;
|
||||
gpu::Memory* oldMemory = getGpuMemory(&owner);
|
||||
|
||||
// Transfer the object
|
||||
if (oldMemory != NULL) {
|
||||
if (!oldMemory->moveTo(*newMemory)) {
|
||||
delete newMemory;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Attempt to pin system memory
|
||||
if ((newMemory->memoryType() != Resource::Pinned) &&
|
||||
((owner.getHostMem() != NULL) ||
|
||||
((NULL != owner.parent()) && (owner.getHostMem() != NULL)))) {
|
||||
bool ok = newMemory->pinSystemMemory(owner.getHostMem(), (owner.getHostMemRef()->size())
|
||||
? owner.getHostMemRef()->size()
|
||||
: owner.getSize());
|
||||
//! \note: Ignore the pinning result for now
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
device::Memory* Device::createView(amd::Memory& owner, const device::Memory& parent) const {
|
||||
size_t size = owner.getSize();
|
||||
assert((owner.asImage() != NULL) && "View supports images only");
|
||||
|
||||
Αναφορά σε νέο ζήτημα
Block a user