diff --git a/projects/rocr-runtime/libhsakmt/src/memory.c b/projects/rocr-runtime/libhsakmt/src/memory.c index 9178b56dc2..2ee2e9e3dc 100644 --- a/projects/rocr-runtime/libhsakmt/src/memory.c +++ b/projects/rocr-runtime/libhsakmt/src/memory.c @@ -501,6 +501,8 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtMapMemoryToGPUNodes(void *MemoryAddress, uint32_t *gpu_id_array; HSAKMT_STATUS ret; + CHECK_KFD_OPEN(); + pr_debug("[%s] address %p number of nodes %lu\n", __func__, MemoryAddress, NumberOfNodes); @@ -565,6 +567,8 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtUnmapGraphicHandle(HSAuint32 NodeId, HSAuint64 FlatMemoryAddress, HSAuint64 SizeInBytes) { + CHECK_KFD_OPEN(); + return hsaKmtUnmapMemoryToGPU(PORT_UINT64_TO_VPTR(FlatMemoryAddress)); } @@ -574,6 +578,8 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtGetTileConfig(HSAuint32 NodeId, HsaGpuTileConfig * uint32_t gpu_id; HSAKMT_STATUS result; + CHECK_KFD_OPEN(); + pr_debug("[%s] node %d\n", __func__, NodeId); result = validate_nodeid(NodeId, &gpu_id); @@ -609,6 +615,8 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtGetTileConfig(HSAuint32 NodeId, HsaGpuTileConfig * HSAKMT_STATUS HSAKMTAPI hsaKmtQueryPointerInfo(const void *Pointer, HsaPointerInfo *PointerInfo) { + CHECK_KFD_OPEN(); + pr_debug("[%s] pointer %p\n", __func__, Pointer); if (!PointerInfo) @@ -619,6 +627,8 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtQueryPointerInfo(const void *Pointer, HSAKMT_STATUS HSAKMTAPI hsaKmtSetMemoryUserData(const void *Pointer, void *UserData) { + CHECK_KFD_OPEN(); + pr_debug("[%s] pointer %p\n", __func__, Pointer); return fmm_set_mem_user_data(Pointer, UserData);