From 379bd13fb63dd107693db44af53ad09ea17eaa9b Mon Sep 17 00:00:00 2001 From: Andreas Noack Date: Thu, 1 Dec 2016 15:03:18 -0500 Subject: [PATCH 1/2] Update to 0.6 --- src/VML.jl | 14 ++++++++------ test/common.jl | 6 +++--- test/runtests.jl | 3 +-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/VML.jl b/src/VML.jl index e3a27d4..b710531 100644 --- a/src/VML.jl +++ b/src/VML.jl @@ -1,5 +1,7 @@ module VML +import Base: .^, ./ + # TODO detect CPU architecture const lib = :libmkl_vml_avx Libdl.dlopen(:libmkl_rt) @@ -49,7 +51,7 @@ function vml_prefix(t::DataType) end function def_unary_op(tin, tout, jlname, jlname!, mklname) - mklfn = Base.Meta.quot(symbol("$(vml_prefix(tin))$mklname")) + mklfn = Base.Meta.quot(Symbol("$(vml_prefix(tin))$mklname")) exports = Symbol[] isa(jlname, Expr) || push!(exports, jlname) isa(jlname!, Expr) || push!(exports, jlname!) @@ -80,7 +82,7 @@ function def_unary_op(tin, tout, jlname, jlname!, mklname) end function def_binary_op(tin, tout, jlname, jlname!, mklname, broadcast) - mklfn = Base.Meta.quot(symbol("$(vml_prefix(tin))$mklname")) + mklfn = Base.Meta.quot(Symbol("$(vml_prefix(tin))$mklname")) exports = Symbol[] isa(jlname, Expr) || push!(exports, jlname) isa(jlname!, Expr) || push!(exports, jlname!) @@ -113,8 +115,8 @@ for t in (Float32, Float64, Complex64, Complex128) def_unary_op(t, t, :(Base.log), :log!, :Ln) # Binary, real or complex - def_binary_op(t, t, :(Base.(:.^)), :pow!, :Pow, true) - def_binary_op(t, t, :(Base.(:./)), :divide!, :Div, true) + def_binary_op(t, t, :(.^), :pow!, :Pow, true) + def_binary_op(t, t, :(./), :divide!, :Div, true) end for t in (Float32, Float64) @@ -153,7 +155,7 @@ for t in (Float32, Float64) def_unary_op(t, t, :(Base.log10), :log10!, :Log10) # .^ to scalar power - mklfn = Base.Meta.quot(symbol("$(vml_prefix(t))Powx")) + mklfn = Base.Meta.quot(Symbol("$(vml_prefix(t))Powx")) @eval begin export pow! function pow!{N}(out::Array{$t,N}, A::Array{$t,N}, b::$t) @@ -162,7 +164,7 @@ for t in (Float32, Float64) vml_check_error() out end - function Base.(:(.^)){N}(A::Array{$t,N}, b::$t) + function (.^){N}(A::Array{$t,N}, b::$t) out = similar(A) ccall(($mklfn, lib), Void, (Int, Ptr{$t}, $t, Ptr{$t}), length(A), A, b, out) vml_check_error() diff --git a/test/common.jl b/test/common.jl index bc1b9c7..d737da5 100644 --- a/test/common.jl +++ b/test/common.jl @@ -35,8 +35,8 @@ const base_unary_real = ( const base_binary_real = ( (Base.atan2, (-1, 1), (-1, 1)), (Base.hypot, (-1000, 1000), (-1000, 1000)), - (Base.(:./), (-1000, 1000), (-1000, 1000)), - (Base.(:.^), (0, 100), (-5, 20)) + (getfield(Base, :./), (-1000, 1000), (-1000, 1000)), + (getfield(Base, :.^), (0, 100), (-5, 20)) ) const base_unary_complex = ( @@ -62,7 +62,7 @@ const base_unary_complex = ( ) const base_binary_complex = ( - (Base.(:./), (-1000, 1000), (-1000, 1000)), + (getfield(Base, :./), (-1000, 1000), (-1000, 1000)), # (Base.(:.^), (0, 100), (-2, 10)) ) diff --git a/test/runtests.jl b/test/runtests.jl index e6bfd2b..688b71a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,2 +1 @@ -run(`$(joinpath(JULIA_HOME, "julia")) $(joinpath(dirname(@__FILE__), "real.jl"))`) -run(`$(joinpath(JULIA_HOME, "julia")) $(joinpath(dirname(@__FILE__), "complex.jl"))`) \ No newline at end of file +include("common.jl") \ No newline at end of file From c5231c00816d2adbf474080582e593eac3e4fed1 Mon Sep 17 00:00:00 2001 From: Andreas Noack Date: Thu, 1 Dec 2016 15:04:38 -0500 Subject: [PATCH 2/2] Enable Travis --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..3114ff3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: julia +os: + - linux + - osx +julia: + - 0.5 + - nightly +notifications: + email: false +sudo: false +after_success: + - julia -e 'cd(Pkg.dir("VML")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder())'