show Caffe's version from MatCaffe
authorRonghang Hu <ronghang.hu@gmail.com>
Sat, 23 Jan 2016 09:22:04 +0000 (01:22 -0800)
committerRonghang Hu <ronghang.hu@gmail.com>
Sat, 23 Jan 2016 09:39:08 +0000 (01:39 -0800)
matlab/+caffe/private/caffe_.cpp
matlab/+caffe/version.m [new file with mode: 0644]

index 1641e14..1b1b2bf 100644 (file)
@@ -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 (file)
index 0000000..61cae4f
--- /dev/null
@@ -0,0 +1,7 @@
+function version_str = version()
+% version()
+%   show Caffe's version.
+
+version_str = caffe_('version');
+
+end