summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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