SWDEV-381402 - Remove unused getNullStream() from device. Make stream destructor private.

Change-Id: Idde30a8bfe97a525bd9f9fb50698a5cb14b798fc
This commit is contained in:
Ioannis Assiouras
2023-02-22 00:05:49 +00:00
parent ea5838320e
commit 06927fd3c1
4 changed files with 9 additions and 19 deletions
+3 -3
View File
@@ -70,7 +70,7 @@ hipError_t hipMallocAsync(void** dev_ptr, size_t size, hipStream_t stream) {
if ((dev_ptr == nullptr) || (size == 0) || (!hip::isValid(stream))) {
HIP_RETURN(hipErrorInvalidValue);
}
auto hip_stream = (stream == nullptr) ? hip::getCurrentDevice()->GetNullStream() :
auto hip_stream = (stream == nullptr) ? hip::getCurrentDevice()->NullStream() :
reinterpret_cast<hip::Stream*>(stream);
auto device = hip_stream->GetDevice();
auto mem_pool = device->GetCurrentMemoryPool();
@@ -92,7 +92,7 @@ hipError_t hipFreeAsync(void* dev_ptr, hipStream_t stream) {
auto memory = getMemoryObject(dev_ptr, offset);
if (memory != nullptr) {
auto id = memory->getUserData().deviceId;
auto hip_stream = (stream == nullptr) ? hip::getCurrentDevice()->GetNullStream() :
auto hip_stream = (stream == nullptr) ? hip::getCurrentDevice()->NullStream() :
reinterpret_cast<hip::Stream*>(stream);
if (!g_devices[id]->FreeMemory(memory, hip_stream)) {
//! @todo It's not the most optimal logic. The current implementation has unconditional waits
@@ -241,7 +241,7 @@ hipError_t hipMallocFromPoolAsync(
STREAM_CAPTURE(hipMallocAsync, stream, mem_pool, size, dev_ptr);
auto mpool = reinterpret_cast<hip::MemoryPool*>(mem_pool);
auto hip_stream = (stream == nullptr) ? hip::getCurrentDevice()->GetNullStream() :
auto hip_stream = (stream == nullptr) ? hip::getCurrentDevice()->NullStream() :
reinterpret_cast<hip::Stream*>(stream);
*dev_ptr = mpool->AllocateMemory(size, hip_stream);
HIP_RETURN(hipSuccess);