Skip to content

Commit

Permalink
Fixed deprecation warning of sub
Browse files Browse the repository at this point in the history
Removed deprecated function sub and replaced with new function view. Also added an aliasing of sub to view if version is less than 5.0
  • Loading branch information
Skylion007 authored Oct 23, 2016
1 parent 15b60f8 commit eb5198f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/chunks/matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import Base: serialize, deserialize, getindex, setindex!, size, append!, flush,

export DenseMatBlobs, SparseMatBlobs, size, getindex, setindex!, serialize, deserialize, save, load, flush, *

if isless(Base.VERSION, v"0.5.0-")
view = sub
end

const BYTES_128MB = 128 * 1024 * 1024

def_cache() = max(BYTES_128MB, floor(Int, Base.Sys.free_memory()/2/nworkers()))
Expand Down Expand Up @@ -268,7 +272,7 @@ function *{T1,T2}(A::Matrix{T1}, B::DenseMatBlobs{T2})
for idx in 1:length(B.splits)
p = B.splits[idx]
part, r = load(B, first(p.first))
Base.A_mul_B!(sub(res, 1:Rm, r), A, part)
Base.A_mul_B!(view(res, 1:Rm, r), A, part)
end
res
end
Expand Down

0 comments on commit eb5198f

Please sign in to comment.