wsl/hsakmt: add get_gpu_mem()
Signed-off-by: Flora Cui <flora.cui@amd.com> Reviewed-by: Tianci Yin <tianci.yin@amd.com> Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/28>
This commit is contained in:
zatwierdzone przez
Frank Min
rodzic
f7d2df7486
commit
5db21f53da
@@ -355,6 +355,16 @@ bool queue_release_buffer(void *MemoryAddress) {
|
||||
return true;
|
||||
}
|
||||
|
||||
wsl::thunk::GpuMemory *get_gpu_mem(void *MemoryAddress) {
|
||||
std::lock_guard<std::mutex> gard(*allocation_map_lock_);
|
||||
auto it = allocation_map_.find(MemoryAddress);
|
||||
if (it == allocation_map_.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return wsl::thunk::GpuMemory::Convert(it->second.handle);
|
||||
}
|
||||
|
||||
HSAKMT_STATUS HSAKMTAPI hsaKmtAvailableMemory(HSAuint32 Node,
|
||||
HSAuint64 *AvailableBytes) {
|
||||
CHECK_DXG_OPEN();
|
||||
|
||||
Reference in New Issue
Block a user