P4 to Git Change 1576209 by vsytchen@vsytchen-win10 on 2018/07/04 15:37:58
SWDEV-79445 - OCL generic changes and code clean-up
1. Purge redundant AllocMapTarget function
ReviewBoardURL = http://ocltc.amd.com/reviews/r/15346/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_memobj.cpp#84 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_svm.cpp#28 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#223 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#309 edit
[ROCm/clr commit: efc584a4b9]
This commit is contained in:
@@ -3067,8 +3067,15 @@ RUNTIME_ENTRY_RET(void*, clEnqueueMapBuffer,
|
||||
return (void*)0;
|
||||
}
|
||||
|
||||
// Make sure we have memory for the command execution
|
||||
device::Memory* mem = srcBuffer->getDeviceMemory(hostQueue.device());
|
||||
if (NULL == mem) {
|
||||
LogPrintfError("Can't allocate memory size - 0x%08X bytes!", srcBuffer->getSize());
|
||||
*not_null(errcode_ret) = CL_MEM_OBJECT_ALLOCATION_FAILURE;
|
||||
return NULL;
|
||||
}
|
||||
// Attempt to allocate the map target now (whether blocking or non-blocking)
|
||||
void* mapPtr = hostQueue.device().allocMapTarget(*srcBuffer, srcOffset, srcSize, map_flags);
|
||||
void* mapPtr = mem->allocMapTarget(srcOffset, srcSize, map_flags);
|
||||
if (NULL == mapPtr) {
|
||||
*not_null(errcode_ret) = CL_MAP_FAILURE;
|
||||
return NULL;
|
||||
@@ -3332,9 +3339,16 @@ RUNTIME_ENTRY_RET(void*, clEnqueueMapImage,
|
||||
return (void*)0;
|
||||
}
|
||||
|
||||
// Make sure we have memory for the command execution
|
||||
device::Memory* mem = srcImage->getDeviceMemory(hostQueue.device());
|
||||
if (NULL == mem) {
|
||||
LogPrintfError("Can't allocate memory size - 0x%08X bytes!", srcImage->getSize());
|
||||
*not_null(errcode_ret) = CL_MEM_OBJECT_ALLOCATION_FAILURE;
|
||||
return NULL;
|
||||
}
|
||||
// Attempt to allocate the map target now (whether blocking or non-blocking)
|
||||
void* mapPtr = hostQueue.device().allocMapTarget(*srcImage, srcOrigin, srcRegion, map_flags,
|
||||
image_row_pitch, image_slice_pitch);
|
||||
void* mapPtr = mem->allocMapTarget(srcOrigin, srcRegion, map_flags,
|
||||
image_row_pitch, image_slice_pitch);
|
||||
if (NULL == mapPtr) {
|
||||
*not_null(errcode_ret) = CL_MAP_FAILURE;
|
||||
return NULL;
|
||||
|
||||
@@ -720,10 +720,10 @@ RUNTIME_ENTRY(cl_int, clEnqueueSVMMap,
|
||||
device::Memory* mem = svmMem->getDeviceMemory(queue->device());
|
||||
if (NULL == mem) {
|
||||
LogPrintfError("Can't allocate memory size - 0x%08X bytes!", svmMem->getSize());
|
||||
return CL_OUT_OF_RESOURCES;
|
||||
return CL_MEM_OBJECT_ALLOCATION_FAILURE;
|
||||
}
|
||||
// Attempt to allocate the map target now (whether blocking or non-blocking)
|
||||
void* mapPtr = (queue->device()).allocMapTarget(*svmMem, srcOffset, srcSize, map_flags);
|
||||
void* mapPtr = mem->allocMapTarget(srcOffset, srcSize, map_flags);
|
||||
if (NULL == mapPtr || mapPtr != svm_ptr) {
|
||||
return CL_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user