summaryrefslogtreecommitdiff
path: root/matlab
diff options
context:
space:
mode:
authorRonghang Hu <ronghang.hu@gmail.com>2016-01-23 01:22:04 -0800
committerRonghang Hu <ronghang.hu@gmail.com>2016-01-23 01:39:08 -0800
commite94065efd516668e5168ed82669063b69315595d (patch)
tree37497686e84a29e8c8de3bd9660bc329fc0fac51 /matlab
parent19ee69d3d2df1aa5af5a0e81b5678c9ebfb2dbfb (diff)
downloadcaffeonacl-e94065efd516668e5168ed82669063b69315595d.tar.gz
caffeonacl-e94065efd516668e5168ed82669063b69315595d.tar.bz2
caffeonacl-e94065efd516668e5168ed82669063b69315595d.zip
show Caffe's version from MatCaffe
Diffstat (limited to 'matlab')
-rw-r--r--matlab/+caffe/private/caffe_.cpp8
-rw-r--r--matlab/+caffe/version.m7
2 files changed, 15 insertions, 0 deletions
diff --git a/matlab/+caffe/private/caffe_.cpp b/matlab/+caffe/private/caffe_.cpp
index 1641e14b..1b1b2bff 100644
--- a/matlab/+caffe/private/caffe_.cpp
+++ b/matlab/+caffe/private/caffe_.cpp
@@ -504,6 +504,13 @@ static void write_mean(MEX_ARGS) {
mxFree(mean_proto_file);
}
+// Usage: caffe_('version')
+static void version(MEX_ARGS) {
+ mxCHECK(nrhs == 0, "Usage: caffe_('version')");
+ // Return version string
+ plhs[0] = mxCreateString(AS_STRING(CAFFE_VERSION));
+}
+
/** -----------------------------------------------------------------
** Available commands.
**/
@@ -542,6 +549,7 @@ static handler_registry handlers[] = {
{ "reset", reset },
{ "read_mean", read_mean },
{ "write_mean", write_mean },
+ { "version", version },
// The end.
{ "END", NULL },
};
diff --git a/matlab/+caffe/version.m b/matlab/+caffe/version.m
new file mode 100644
index 00000000..61cae4f7
--- /dev/null
+++ b/matlab/+caffe/version.m
@@ -0,0 +1,7 @@
+function version_str = version()
+% version()
+% show Caffe's version.
+
+version_str = caffe_('version');
+
+end