Skip to content

Commit

Permalink
Merge pull request #289 from iblis17/mx-get-ver
Browse files Browse the repository at this point in the history
base: support MXGetVersion
  • Loading branch information
vchuravy committed Oct 10, 2017
2 parents 0a53778 + ac7bbd0 commit 19082ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ function __init__()
_get_libmx_op_names()
_populate_iter_creator_cache!()

global const LIB_VERSION = _get_lib_version()

atexit() do
# notify libmxnet we are shutting down
ccall( ("MXNotifyShutdown", MXNET_LIB), Cint, () )
Expand Down Expand Up @@ -74,6 +76,15 @@ macro mxcall(fv, argtypes, args...)
end
end

"""
Get libmxnet version
"""
function _get_lib_version()
ver = Ref{Cint}(0)
@mxcall :MXGetVersion (Ref{Cint},) ver
ver[]
end

################################################################################
# Handle types
################################################################################
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ function test_dir(dir)
end
end

info("libmxnet version => $(mx.LIB_VERSION)")

include(joinpath(dirname(@__FILE__), "common.jl"))
@testset "MXNet Test" begin
test_dir(joinpath(dirname(@__FILE__), "unittest"))
Expand Down

0 comments on commit 19082ef

Please sign in to comment.