diff --git a/example/accel_api/Makefile b/example/accel_api/Makefile new file mode 100644 index 000000000000..1a265f482f92 --- /dev/null +++ b/example/accel_api/Makefile @@ -0,0 +1,5 @@ +all: + g++ -shared -fPIC myacc.cpp -o libmyacc.so -I ../../include/mxnet + +clean: + rm -rf libmyacc.so diff --git a/example/accel_api/myacc.cpp b/example/accel_api/myacc.cpp new file mode 100644 index 000000000000..ef373dfa348e --- /dev/null +++ b/example/accel_api/myacc.cpp @@ -0,0 +1,6 @@ +#include + +std::string getAccName() { + return std::string("myacc"); +} + diff --git a/example/accel_api/test.py b/example/accel_api/test.py new file mode 100644 index 000000000000..155ee26dee53 --- /dev/null +++ b/example/accel_api/test.py @@ -0,0 +1,6 @@ +import mxnet as mx + +ctx = mx.context.load_acc('libmyacc.so') +print(ctx) + +mx.nd.empty(4,ctx=ctx)