P4 to Git Change 1312587 by cpaquot@hog-ocl on 2016/09/08 19:46:03
SWDEV-96354 - Wrong usage of hsaImageData_ and deviceMemory_. Use hsaImageData_ as the original pointer before alignment and only for that purpose. The deviceMemory_ is where the data is located. No one ever needs to use hsaImageData_ really. This is only an issue with tiled images ReviewBoardURL = http://ocltc.amd.com/reviews/r/11331/diff/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#14 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#6 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#4 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.hpp#4 edit
Этот коммит содержится в:
@@ -1246,12 +1246,7 @@ Device::hostAlloc(size_t size, size_t alignment, bool atomics) const {
|
||||
void
|
||||
Device::hostFree(void* ptr, size_t size) const
|
||||
{
|
||||
hsa_status_t stat =
|
||||
hsa_amd_memory_pool_free(ptr);
|
||||
if (stat != HSA_STATUS_SUCCESS) {
|
||||
LogError("Fail freeing host memory");
|
||||
assert(stat == HSA_STATUS_SUCCESS);
|
||||
}
|
||||
memFree(ptr, size);
|
||||
}
|
||||
|
||||
void *
|
||||
@@ -1272,7 +1267,7 @@ Device::deviceLocalAlloc(size_t size) const
|
||||
stat = hsa_memory_assign_agent(ptr, _bkendDevice, HSA_ACCESS_PERMISSION_RW);
|
||||
if (stat != HSA_STATUS_SUCCESS) {
|
||||
LogError("Fail assigning local memory to agent");
|
||||
deviceLocalFree(ptr, size);
|
||||
memFree(ptr, size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1280,7 +1275,7 @@ Device::deviceLocalAlloc(size_t size) const
|
||||
}
|
||||
|
||||
void
|
||||
Device::deviceLocalFree(void *ptr, size_t size) const
|
||||
Device::memFree(void *ptr, size_t size) const
|
||||
{
|
||||
hsa_status_t stat =
|
||||
hsa_amd_memory_pool_free(ptr);
|
||||
|
||||
Ссылка в новой задаче
Block a user