P4 to Git Change 1728676 by cpaquot@cpaquot-ocl-lc-lnx on 2019/01/10 14:29:52
SWDEV-145570 - [HIP] Add API tracing, enabled via LOG_LEVEL=3 Affected files ... ... //depot/stg/opencl/drivers/opencl/api/hip/hip_internal.hpp#19 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_memory.cpp#42 edit ... //depot/stg/opencl/drivers/opencl/api/hip/trace_helper.h#1 add
This commit is contained in:
@@ -63,7 +63,7 @@ hipError_t ihipMalloc(void** ptr, size_t sizeBytes, unsigned int flags)
|
||||
}
|
||||
|
||||
if (hip::getCurrentContext()->devices()[0]->info().maxMemAllocSize_ < sizeBytes) {
|
||||
return hipErrorOutOfMemory;
|
||||
return hipErrorMemoryAllocation;
|
||||
}
|
||||
|
||||
*ptr = amd::SvmBuffer::malloc(*hip::getCurrentContext(), flags, sizeBytes, hip::getCurrentContext()->devices()[0]->info().memBaseAddrAlign_);
|
||||
@@ -173,6 +173,9 @@ hipError_t hipHostMalloc(void** ptr, size_t sizeBytes, unsigned int flags) {
|
||||
}
|
||||
|
||||
hipError_t hipFree(void* ptr) {
|
||||
if (ptr == nullptr) {
|
||||
HIP_RETURN(hipSuccess);
|
||||
}
|
||||
if (amd::SvmBuffer::malloced(ptr)) {
|
||||
hip::syncStreams();
|
||||
hip::getNullStream()->finish();
|
||||
|
||||
Reference in New Issue
Block a user