P4 to Git Change 1191682 by gandryey@gera-dev-w7 on 2015/09/17 11:14:23

ECR #304775 - Remove EG/NI support
	- Remove the heap emulation (non-vm)

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_memobj.cpp#77 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_svm.cpp#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpusettings.cpp#31 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#186 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#253 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpublit.cpp#118 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#523 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#148 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuheap.cpp#28 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuheap.hpp#16 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#297 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#116 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.cpp#122 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.hpp#48 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#227 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.hpp#83 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#329 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.hpp#94 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#379 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#143 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.h#57 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa/hsasettings.cpp#38 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsasettings.cpp#9 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#242 edit


[ROCm/clr commit: bc5a50bf7b]
This commit is contained in:
foreman
2015-09-17 11:24:31 -04:00
parent cb307953b8
commit cf1acdb126
21 changed files with 264 additions and 1577 deletions
@@ -30,39 +30,24 @@ namespace gpu {
Memory::Memory(
const Device& gpuDev,
amd::Memory& owner,
HeapBlock* hb,
size_t size)
: device::Memory(owner)
, Resource(gpuDev, ((hb) ? hb->size_ : size) / Heap::ElementSize, Heap::ElementType)
, hb_(hb)
, Resource(gpuDev, size / Device::Heap::ElementSize, Device::Heap::ElementType)
{
init();
if (NULL != hb_) hb_->setMemory(this);
if (owner.parent() != NULL) {
flags_ |= SubMemoryObject;
}
}
Memory::Memory(
const Device& gpuDev,
HeapBlock& hb)
: device::Memory(hb.size_)
, Resource(gpuDev, hb.size_ / Heap::ElementSize, Heap::ElementType)
, hb_(&hb)
{
init();
hb.setMemory(this);
}
Memory::Memory(
const Device& gpuDev,
size_t size)
: device::Memory(size)
, Resource(gpuDev,
amd::alignUp(size, Heap::ElementSize) / Heap::ElementSize, Heap::ElementType)
, hb_(NULL)
amd::alignUp(size, Device::Heap::ElementSize) /
Device::Heap::ElementSize, Device::Heap::ElementType)
{
init();
}
@@ -75,7 +60,6 @@ Memory::Memory(
)
: device::Memory(owner)
, Resource(gpuDev, width, format)
, hb_(NULL)
{
init();
@@ -92,7 +76,6 @@ Memory::Memory(
)
: device::Memory(size)
, Resource(gpuDev, width, format)
, hb_(NULL)
{
init();
}
@@ -110,7 +93,6 @@ Memory::Memory(
)
: device::Memory(owner)
, Resource(gpuDev, width, height, depth, format, chOrder, imageType, mipLevels)
, hb_(NULL)
{
init();
@@ -132,7 +114,6 @@ Memory::Memory(
)
: device::Memory(size)
, Resource(gpuDev, width, height, depth, format, chOrder, imageType, mipLevels)
, hb_(NULL)
{
init();
}
@@ -197,14 +178,9 @@ Memory::create(
break;
case Resource::Remote:
case Resource::RemoteUSWC:
// @todo Enable unconditional optimization for remote memory
if ((owner() != NULL &&
owner()->getMemFlags() & CL_MEM_ALLOC_HOST_PTR) ||
(hb() == NULL)) {
if (!cal()->tiled_) {
// Marks memory object for direct GPU access to the host memory
flags_ |= HostMemoryDirectAccess;
}
if (!cal()->tiled_) {
// Marks memory object for direct GPU access to the host memory
flags_ |= HostMemoryDirectAccess;
}
break;
case Resource::View: {
@@ -481,8 +457,8 @@ Memory::createInterop(InteropType type)
else {
// Allocate Resource object for interop as buffer
interopMemory_ = new Memory(dev(), size(),
amd::alignUp(size(), Heap::ElementSize) / Heap::ElementSize,
Heap::ElementType);
amd::alignUp(size(), Device::Heap::ElementSize) / Device::Heap::ElementSize,
Device::Heap::ElementType);
// Create the interop object in CAL
if (NULL == interopMemory_ || !interopMemory_->create(memType, createParams)) {
@@ -502,14 +478,6 @@ Memory::~Memory()
// Clean VA cache
dev().removeVACache(this);
// Release associated heap block, if any
if (hb_) {
// Protect heap block from simultaneous release with realloc
amd::ScopedLock k(dev().lockAsyncOps());
hb_->setMemory(NULL);
hb_->free();
}
delete interopMemory_;
// Release associated map target, if any
@@ -531,35 +499,6 @@ Memory::~Memory()
}
}
bool
Memory::reallocate(HeapBlock* hb, const Resource* parent)
{
Resource::ViewParams params;
params.size_ = hb->size_;
params.resource_ = parent;
params.memory_ = NULL;
// Check if it's a view reallocation
if (NULL != hb->parent_) {
// The offset inside the view is unchanged
params.offset_ = Resource::offset();
// Create a new view
if (Resource::create(Resource::View, &params)) {
hb_ = hb;
return true;
}
}
else {
params.offset_ = hb->offset_;
if (Resource::reallocate(&params)) {
hb_ = hb;
return true;
}
}
return false;
}
void
Memory::syncCacheFromHost(VirtualGPU& gpu, device::Memory::SyncFlags syncFlags)
{
@@ -814,33 +753,13 @@ Memory::createBufferView(amd::Memory& subBufferOwner)
{
gpu::Memory* viewMemory;
Resource::ViewParams params;
HeapBlock* hb = NULL;
size_t offset = subBufferOwner.getOrigin();
size_t size = subBufferOwner.getSize();
if (!dev().heap()->isVirtual()) {
if (NULL == hb_) {
LogError("HeapBlock must be initialized!");
return NULL;
}
hb = new HeapBlock(NULL, size, offset + hb_->offset());
if (hb == NULL) {
LogError("We don't have enough video memory!");
return NULL;
}
amd::ScopedLock lock(owner()->lockMemoryOps());
hb_->addView(hb);
}
// Create a memory object
viewMemory = new gpu::Memory(dev(), subBufferOwner, hb, size);
viewMemory = new gpu::Memory(dev(), subBufferOwner, size);
if (NULL == viewMemory) {
if (hb != NULL) {
hb->setMemory(NULL);
hb->free();
}
return NULL;
}