From 69fff3fc294a1696cced9fb65aaa4b7b0aea96c3 Mon Sep 17 00:00:00 2001 From: Oded Gabbay Date: Tue, 28 Oct 2014 16:49:56 +0200 Subject: [PATCH] Implement hsaKmtGetVersion Reviewed-by: Alexey Skidanov Signed-off-by: Oded Gabbay [ROCm/ROCR-Runtime commit: f081249d172bb4eb7d1d73e60c33b051b2a44ab0] --- projects/rocr-runtime/src/version.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/rocr-runtime/src/version.c b/projects/rocr-runtime/src/version.c index 434b625717..7d927c2dc3 100644 --- a/projects/rocr-runtime/src/version.c +++ b/projects/rocr-runtime/src/version.c @@ -24,6 +24,9 @@ */ #include "libhsakmt.h" +#include +#include +#include "linux/kfd_ioctl.h" HSAKMT_STATUS HSAKMTAPI @@ -33,8 +36,14 @@ hsaKmtGetVersion( { CHECK_KFD_OPEN(); - VersionInfo->KernelInterfaceMajorVersion = HSAKMT_VERSION_MAJOR; - VersionInfo->KernelInterfaceMinorVersion = HSAKMT_VERSION_MINOR; + struct kfd_ioctl_get_version_args args; + memset(&args, 0, sizeof(args)); + + if (kfd_ioctl(KFD_IOC_GET_VERSION, &args) == -1) + return HSAKMT_STATUS_ERROR; + + VersionInfo->KernelInterfaceMajorVersion = args.major_version; + VersionInfo->KernelInterfaceMinorVersion = args.minor_version; return HSAKMT_STATUS_SUCCESS; }