changeset ceece50bbf08 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=ceece50bbf08
description:
tests: Add example of using KVM acceleration with an app
Add #ifdef's to gpu-hello.cpp demonstrating how to annotate an
application
for KVM acceleration.
diffstat:
tests/test-progs/gpu-hello/src/gpu-hello.cpp | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diffs (27 lines):
diff -r 29606f000389 -r ceece50bbf08
tests/test-progs/gpu-hello/src/gpu-hello.cpp
--- a/tests/test-progs/gpu-hello/src/gpu-hello.cpp Mon Aug 22 11:41:05
2016 -0400
+++ b/tests/test-progs/gpu-hello/src/gpu-hello.cpp Mon Aug 22 11:41:37
2016 -0400
@@ -41,6 +41,12 @@
#include <fstream>
#include <string>
+#ifdef KVM_SWITCH
+#include "m5op.h"
+
+void *m5_mem = (void*)0xffffc90000000000;
+#endif
+
#define SUCCESS 0
#define FAILURE 1
@@ -247,6 +253,10 @@
return FAILURE;
}
+#ifdef KVM_SWITCH
+ m5_switchcpu();
+#endif
+
// 2. Launch kernel
status = clEnqueueNDRangeKernel(commandQueue, kernel, 1, NULL,
globalThreads, localThreads, 0, NULL,
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev