P4 to Git Change 1352835 by cpaquot@hog-ocl on 2016/12/13 19:59:07
SWDEV-108384 - Force map memory offset to 0
Copy what we do in ORCA and PAL backend: When mapping an image, default the offset to 0 instead of the map offset for the staging buffer.
ReviewBoardURL = http://ocltc.amd.com/reviews/r/12010/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#25 edit
[ROCm/clr commit: 320d5de3a1]
This commit is contained in:
@@ -710,6 +710,12 @@ Image::allocMapTarget(
|
||||
|
||||
void* pHostMem = owner()->getHostMem();
|
||||
|
||||
amd::Image* image = owner()->asImage();
|
||||
|
||||
size_t elementSize = image->getImageFormat().getElementSize();
|
||||
|
||||
size_t offset = origin[0] * elementSize;
|
||||
|
||||
if (pHostMem == NULL) {
|
||||
if (indirectMapCount_ == 1) {
|
||||
if (!allocateMapMemory(owner()->getSize())) {
|
||||
@@ -726,14 +732,24 @@ Image::allocMapTarget(
|
||||
}
|
||||
|
||||
pHostMem = mapMemory_->getHostMem();
|
||||
|
||||
*rowPitch = region[0] * elementSize;
|
||||
|
||||
size_t slicePitchTmp = 0;
|
||||
|
||||
if (imageDescriptor_.geometry == HSA_EXT_IMAGE_GEOMETRY_1DA) {
|
||||
slicePitchTmp = *rowPitch;
|
||||
}
|
||||
else {
|
||||
slicePitchTmp = *rowPitch * region[1];
|
||||
}
|
||||
if (slicePitch != NULL) {
|
||||
*slicePitch = slicePitchTmp;
|
||||
}
|
||||
|
||||
return pHostMem;
|
||||
}
|
||||
|
||||
amd::Image* image = owner()->asImage();
|
||||
|
||||
size_t elementSize = image->getImageFormat().getElementSize();
|
||||
|
||||
size_t offset = origin[0] * elementSize;
|
||||
|
||||
// Adjust offset with Y dimension
|
||||
offset += image->getRowPitch() * origin[1];
|
||||
|
||||
|
||||
مرجع در شماره جدید
Block a user