Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
adding example to test accelerator loading
Browse files Browse the repository at this point in the history
  • Loading branch information
mseth10 committed Jul 12, 2019
1 parent f9a6e8b commit 448e950
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions example/accel_api/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
all:
g++ -shared -fPIC myacc.cpp -o libmyacc.so -I ../../include/mxnet

clean:
rm -rf libmyacc.so
6 changes: 6 additions & 0 deletions example/accel_api/myacc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <string>

std::string getAccName() {
return std::string("myacc");
}

6 changes: 6 additions & 0 deletions example/accel_api/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import mxnet as mx

ctx = mx.context.load_acc('libmyacc.so')
print(ctx)

mx.nd.empty(4,ctx=ctx)

0 comments on commit 448e950

Please sign in to comment.