diff --git a/tests/kfdtest/src/BaseDebug.cpp b/tests/kfdtest/src/BaseDebug.cpp index 50f243cc39..912150ee51 100644 --- a/tests/kfdtest/src/BaseDebug.cpp +++ b/tests/kfdtest/src/BaseDebug.cpp @@ -96,3 +96,18 @@ void BaseDebug::Detach(void) { m_Fd.fd = 0; m_Fd.events = 0; } + +HSAKMT_STATUS BaseDebug::SendRuntimeEvent(uint64_t exceptions, int gpuId, int queueId) +{ + struct kfd_ioctl_dbg_trap_args args = {0}; + + memset(&args, 0x00, sizeof(args)); + + args.pid = m_Pid; + args.op = KFD_IOC_DBG_TRAP_SEND_RUNTIME_EVENT; + args.send_runtime_event.exception_mask = exceptions; + args.send_runtime_event.gpu_id = gpuId; + args.send_runtime_event.queue_id = queueId; + + return hsaKmtDebugTrapIoctl(&args, NULL); +} diff --git a/tests/kfdtest/src/BaseDebug.hpp b/tests/kfdtest/src/BaseDebug.hpp index ac53c6c696..3b8d2098d1 100644 --- a/tests/kfdtest/src/BaseDebug.hpp +++ b/tests/kfdtest/src/BaseDebug.hpp @@ -40,6 +40,7 @@ class BaseDebug { uint64_t exceptionEnable); void Detach(void); + HSAKMT_STATUS SendRuntimeEvent(uint64_t exceptions, int gpuId, int queueId); private: unsigned int m_Pid;