SWDEV-292714 - Add unique id for each allocation to support HIP_POINTER_ATTRIBUTE_BUFFER_ID

Change-Id: Ibb3fcb2d0bbbef03525fc884d5b3e9b5f6c11423
This commit is contained in:
Satyanvesh Dittakavi
2021-09-27 19:12:50 +00:00
والد 0ab4ad1310
کامیت c56317b2e0
2فایلهای تغییر یافته به همراه8 افزوده شده و 2 حذف شده
@@ -28,6 +28,9 @@
#include <atomic>
// Stores the no. of memory allocations
std::atomic<uint32_t> numAllocs = 0;
namespace amd {
bool BufferRect::create(const size_t* bufferOrigin, const size_t* region, size_t bufferRowPitch,
@@ -309,6 +312,8 @@ bool Memory::create(void* initFrom, bool sysMemAlloc, bool skipAlloc, bool force
}
}
// Store the unique id for each memory allocation
uniqueId_ = ++numAllocs;
return true;
}