Date: Monday, December 19, 2022 @ 15:17:42
  Author: tpkessler
Revision: 1361574

hsakmt-roct-5.4.1: Add test case

Added:
  hsakmt-roct/trunk/test.cpp
  hsakmt-roct/trunk/test.sh

----------+
 test.cpp |   27 +++++++++++++++++++++++++++
 test.sh  |    7 +++++++
 2 files changed, 34 insertions(+)

Added: test.cpp
===================================================================
--- test.cpp                            (rev 0)
+++ test.cpp    2022-12-19 15:17:42 UTC (rev 1361574)
@@ -0,0 +1,27 @@
+#include <hsakmt/hsakmt.h>
+#include <iostream>
+
+int main()
+{
+    HsaVersionInfo info;
+    HsaSystemProperties prop;
+
+    hsaKmtOpenKFD();
+
+    hsaKmtGetVersion(&info);
+
+    std::cout << "HSA version " << info.KernelInterfaceMajorVersion
+        << "." << info.KernelInterfaceMinorVersion << "\n";
+
+    hsaKmtAcquireSystemProperties(&prop);
+
+    std::cout << "Topology information:\n"
+        << "Number of memory nodes: " << prop.NumNodes << "\n"
+        << "Platform OEM: " << prop.PlatformOem << "\n"
+        << "Platform ID: " << prop.PlatformId << "\n"
+        << "Platform Revision: " << prop.PlatformRev << "\n";
+
+    hsaKmtReleaseSystemProperties();
+
+    hsaKmtCloseKFD();
+}

Added: test.sh
===================================================================
--- test.sh                             (rev 0)
+++ test.sh     2022-12-19 15:17:42 UTC (rev 1361574)
@@ -0,0 +1,7 @@
+#!/usr/bin/env sh
+
+OUT=$(mktemp -d)
+CXX=/usr/bin/g++
+
+$CXX -I/opt/rocm/include -o "$OUT/test" test.cpp -L/opt/rocm/lib -lhsakmt
+"$OUT"/test


Property changes on: hsakmt-roct/trunk/test.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Reply via email to