From e94065efd516668e5168ed82669063b69315595d Mon Sep 17 00:00:00 2001 From: Ronghang Hu Date: Sat, 23 Jan 2016 01:22:04 -0800 Subject: show Caffe's version from MatCaffe --- matlab/+caffe/private/caffe_.cpp | 8 ++++++++ matlab/+caffe/version.m | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 matlab/+caffe/version.m 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 -- cgit v1.2.3