P4 to Git Change 1501660 by gandryey@gera-w8 on 2018/01/09 14:04:56
SWDEV-79445 - OCL generic changes and code clean-up - Code style clean-up. No functional changes. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpublit.cpp#127 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#164 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#321 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#236 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#412 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.hpp#142 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.cpp#15 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcompiler.cpp#20 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#70 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#22 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevicegl.cpp#9 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#42 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#18 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprintf.cpp#7 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#53 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#45 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#69 edit
This commit is contained in:
@@ -197,7 +197,6 @@ bool DmaBlitManager::readBufferRect(device::Memory& srcMemory, void* dstHost,
|
||||
Memory& xferBuf = dev().xferRead().acquire();
|
||||
|
||||
amd::Coord3D dst(0, 0, 0);
|
||||
size_t tmpSize = 0;
|
||||
size_t bufOffset;
|
||||
size_t hostOffset;
|
||||
size_t srcSize;
|
||||
@@ -210,7 +209,7 @@ bool DmaBlitManager::readBufferRect(device::Memory& srcMemory, void* dstHost,
|
||||
|
||||
while (srcSize != 0) {
|
||||
// Find the partial transfer size
|
||||
tmpSize = std::min(dev().xferRead().bufSize(), srcSize);
|
||||
size_t tmpSize = std::min(dev().xferRead().bufSize(), srcSize);
|
||||
|
||||
amd::Coord3D src(bufOffset, 0, 0);
|
||||
amd::Coord3D copySize(tmpSize, 0, 0);
|
||||
@@ -258,7 +257,6 @@ bool DmaBlitManager::writeMemoryStaged(const void* srcHost, Memory& dstMemory, M
|
||||
size_t origin, size_t& offset, size_t& totalSize,
|
||||
size_t xferSize) const {
|
||||
amd::Coord3D src(0, 0, 0);
|
||||
size_t tmpSize;
|
||||
size_t chunkSize;
|
||||
static const bool CopyRect = false;
|
||||
// Flush DMA for ASYNC copy
|
||||
@@ -275,7 +273,7 @@ bool DmaBlitManager::writeMemoryStaged(const void* srcHost, Memory& dstMemory, M
|
||||
|
||||
while (xferSize != 0) {
|
||||
// Find the partial transfer size
|
||||
tmpSize = std::min(chunkSize, xferSize);
|
||||
size_t tmpSize = std::min(chunkSize, xferSize);
|
||||
amd::Coord3D dst(origin + offset, 0, 0);
|
||||
amd::Coord3D copySize(tmpSize, 0, 0);
|
||||
|
||||
@@ -1711,11 +1709,10 @@ bool KernelBlitManager::copyBufferRect(device::Memory& srcMemory, device::Memory
|
||||
|
||||
const static uint CopyRectAlignment[3] = {16, 4, 1};
|
||||
|
||||
bool aligned;
|
||||
uint i;
|
||||
for (i = 0; i < sizeof(CopyRectAlignment) / sizeof(uint); i++) {
|
||||
// Check source alignments
|
||||
aligned = ((srcRectIn.rowPitch_ % CopyRectAlignment[i]) == 0);
|
||||
bool aligned = ((srcRectIn.rowPitch_ % CopyRectAlignment[i]) == 0);
|
||||
aligned &= ((srcRectIn.slicePitch_ % CopyRectAlignment[i]) == 0);
|
||||
aligned &= ((srcRectIn.start_ % CopyRectAlignment[i]) == 0);
|
||||
|
||||
@@ -2064,11 +2061,10 @@ bool KernelBlitManager::copyBuffer(device::Memory& srcMemory, device::Memory& ds
|
||||
const static uint CopyBuffAlignment[3] = {16, 4, 1};
|
||||
amd::Coord3D size(sizeIn[0], sizeIn[1], sizeIn[2]);
|
||||
|
||||
bool aligned;
|
||||
uint i;
|
||||
for (i = 0; i < sizeof(CopyBuffAlignment) / sizeof(uint); i++) {
|
||||
// Check source alignments
|
||||
aligned = ((srcOrigin[0] % CopyBuffAlignment[i]) == 0);
|
||||
bool aligned = ((srcOrigin[0] % CopyBuffAlignment[i]) == 0);
|
||||
// Check destination alignments
|
||||
aligned &= ((dstOrigin[0] % CopyBuffAlignment[i]) == 0);
|
||||
// Check copy size alignment in the first dimension
|
||||
@@ -2283,9 +2279,7 @@ bool KernelBlitManager::fillImage(device::Memory& memory, const void* pattern,
|
||||
bool KernelBlitManager::runScheduler(device::Memory& vqueue, device::Memory& params, uint paramIdx,
|
||||
uint threads) const {
|
||||
amd::ScopedLock k(lockXferOps_);
|
||||
bool result = false;
|
||||
|
||||
size_t dim = 1;
|
||||
size_t globalWorkOffset[1] = {0};
|
||||
size_t globalWorkSize[1] = {threads};
|
||||
size_t localWorkSize[1] = {1};
|
||||
@@ -2302,7 +2296,7 @@ bool KernelBlitManager::runScheduler(device::Memory& vqueue, device::Memory& par
|
||||
|
||||
// Execute the blit
|
||||
address parameters = kernels_[Scheduler]->parameters().values();
|
||||
result = gpu().submitKernelInternal(ndrange, *kernels_[Scheduler], parameters);
|
||||
bool result = gpu().submitKernelInternal(ndrange, *kernels_[Scheduler], parameters);
|
||||
|
||||
synchronize();
|
||||
|
||||
@@ -2366,14 +2360,11 @@ amd::Memory* DmaBlitManager::pinHostMemory(const void* hostMem, size_t pinSize,
|
||||
|
||||
Memory* KernelBlitManager::createView(const Memory& parent, const cl_image_format format) const {
|
||||
assert(!parent.desc().buffer_ && "View supports images only");
|
||||
Memory* gpuImage = NULL;
|
||||
|
||||
gpuImage = new Image(dev(), parent.size(), parent.desc().width_, parent.desc().height_,
|
||||
parent.desc().depth_, format, parent.desc().topology_, 1);
|
||||
Memory* gpuImage = new Image(dev(), parent.size(), parent.desc().width_, parent.desc().height_,
|
||||
parent.desc().depth_, format, parent.desc().topology_, 1);
|
||||
|
||||
// Create resource
|
||||
if (NULL != gpuImage) {
|
||||
bool result = false;
|
||||
Resource::ImageViewParams params;
|
||||
const Memory& gpuMem = static_cast<const Memory&>(parent);
|
||||
|
||||
@@ -2385,7 +2376,7 @@ Memory* KernelBlitManager::createView(const Memory& parent, const cl_image_forma
|
||||
params.gpu_ = &gpu();
|
||||
|
||||
// Create memory object
|
||||
result = gpuImage->create(Resource::ImageView, ¶ms);
|
||||
bool result = gpuImage->create(Resource::ImageView, ¶ms);
|
||||
if (!result) {
|
||||
delete gpuImage;
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user