P4 to Git Change 1193161 by xcui@merged_opencl_jxcwin on 2015/09/22 16:16:10
SWDEV-59579 - temporary Back out changelist 1193093
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_svm.cpp#14 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#257 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#526 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#151 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#381 edit
[ROCm/clr commit: 48e9d66576]
Cette révision appartient à :
@@ -746,46 +746,41 @@ RUNTIME_ENTRY(cl_int, clEnqueueSVMMap, (
|
||||
}
|
||||
amd::HostQueue& hostQueue = *queue;
|
||||
size_t offset = 0;
|
||||
amd::Memory * svmMem = NULL;
|
||||
if ((queue->device()).isFineGrainedSystem()) {
|
||||
//leave blank on purpose for FGS no op
|
||||
}
|
||||
else {
|
||||
svmMem = amd::SvmManager::FindSvmBuffer(svm_ptr);
|
||||
if (NULL != svmMem) {
|
||||
//make sure the context is the same as the context of creation of svm space
|
||||
if (hostQueue.context() != svmMem->getContext()) {
|
||||
LogWarning("different contexts");
|
||||
return CL_INVALID_CONTEXT;
|
||||
}
|
||||
|
||||
offset = static_cast<address>(svm_ptr) - static_cast<address>(svmMem->getSvmPtr());
|
||||
if (offset < 0 || offset + size > svmMem->getSize()) {
|
||||
LogWarning("wrong svm address ");
|
||||
//make sure the context is the same as the context of creation of svm space
|
||||
amd::Memory * svmMem = amd::SvmManager::FindSvmBuffer(svm_ptr);
|
||||
if (NULL != svmMem) {
|
||||
if (hostQueue.context() != svmMem->getContext()) {
|
||||
LogWarning("different contexts");
|
||||
return CL_INVALID_CONTEXT;
|
||||
}
|
||||
|
||||
offset = static_cast<address>(svm_ptr) - static_cast<address>(svmMem->getSvmPtr());
|
||||
if (offset < 0 || offset + size > svmMem->getSize()) {
|
||||
LogWarning("wrong svm address ");
|
||||
return CL_INVALID_VALUE;
|
||||
}
|
||||
amd::Buffer* srcBuffer = svmMem->asBuffer();
|
||||
|
||||
amd::Coord3D srcSize(size);
|
||||
amd::Coord3D srcOffset(offset);
|
||||
if (NULL != srcBuffer) {
|
||||
if (!srcBuffer->validateRegion(srcOffset, srcSize)) {
|
||||
return CL_INVALID_VALUE;
|
||||
}
|
||||
amd::Buffer* srcBuffer = svmMem->asBuffer();
|
||||
}
|
||||
|
||||
amd::Coord3D srcSize(size);
|
||||
amd::Coord3D srcOffset(offset);
|
||||
if (NULL != srcBuffer) {
|
||||
if (!srcBuffer->validateRegion(srcOffset, srcSize)) {
|
||||
return CL_INVALID_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we have memory for the command execution
|
||||
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;
|
||||
}
|
||||
// Attempt to allocate the map target now (whether blocking or non-blocking)
|
||||
void* mapPtr = (queue->device()).allocMapTarget(*svmMem, srcOffset, srcSize, map_flags);
|
||||
if (NULL == mapPtr || mapPtr != svm_ptr) {
|
||||
return CL_OUT_OF_RESOURCES;
|
||||
}
|
||||
// Make sure we have memory for the command execution
|
||||
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;
|
||||
}
|
||||
// Attempt to allocate the map target now (whether blocking or non-blocking)
|
||||
void* mapPtr = (queue->device()).allocMapTarget(*svmMem, srcOffset, srcSize, map_flags);
|
||||
if (NULL == mapPtr || mapPtr != svm_ptr) {
|
||||
return CL_OUT_OF_RESOURCES;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -886,19 +881,17 @@ RUNTIME_ENTRY(cl_int, clEnqueueSVMUnmap, (
|
||||
return CL_INVALID_COMMAND_QUEUE;
|
||||
}
|
||||
amd::HostQueue& hostQueue = *queue;
|
||||
amd::Memory * svmMem = NULL;
|
||||
if (!(queue->device()).isFineGrainedSystem()) {
|
||||
//check if the ptr is in the svm space
|
||||
svmMem = amd::SvmManager::FindSvmBuffer(svm_ptr);
|
||||
|
||||
//check if the ptr is in the svm space
|
||||
amd::Memory * svmMem = amd::SvmManager::FindSvmBuffer(svm_ptr);
|
||||
// Make sure we have memory for the command execution
|
||||
if (NULL != svmMem) {
|
||||
// Make sure we have memory for the command execution
|
||||
if (NULL != svmMem) {
|
||||
// Make sure we have memory for the command execution
|
||||
device::Memory* mem = svmMem->getDeviceMemory(queue->device());
|
||||
if (NULL == mem) {
|
||||
LogPrintfError("Can't allocate memory size - 0x%08X bytes!",
|
||||
svmMem->getSize());
|
||||
return CL_INVALID_VALUE;
|
||||
}
|
||||
device::Memory* mem = svmMem->getDeviceMemory(queue->device());
|
||||
if (NULL == mem) {
|
||||
LogPrintfError("Can't allocate memory size - 0x%08X bytes!",
|
||||
svmMem->getSize());
|
||||
return CL_INVALID_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur