Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Fix 0.6 deprecation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTodd13 committed Jul 13, 2017
1 parent d6f98d6 commit a28f755
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions test/cat.jl
Expand Up @@ -67,8 +67,8 @@ end

using Base.Test
println("Testing cat...")
@test_approx_eq CatTest.test1() [3.0; 1.0]
@test_approx_eq CatTest.test2() [2.0 2.5; 1.5 11.0]
@test_approx_eq CatTest.test3() [2.0 2.5 3.0; 1.5 11.0 16.0]
@test CatTest.test1() [3.0; 1.0]
@test CatTest.test2() [2.0 2.5; 1.5 11.0]
@test CatTest.test3() [2.0 2.5 3.0; 1.5 11.0 16.0]
println("Done testing cat.")

2 changes: 1 addition & 1 deletion test/const_promote.jl
Expand Up @@ -45,5 +45,5 @@ end
using Base.Test

println("Testing constant promotion for pointwise operations...")
@test_approx_eq ConstPromoteTest.test1() [9.0,6.76,0.04]
@test ConstPromoteTest.test1() [9.0,6.76,0.04]
println("Done testing constant promotion.")
4 changes: 2 additions & 2 deletions test/lib.jl
Expand Up @@ -39,7 +39,7 @@ using ParallelAccelerator

@acc minMax(A) = (indmin(A), indmax(A))

@acc vecLen(A) = sqrt(sumabs2(A))
@acc vecLen(A) = sqrt(sum(abs2, A))

@acc diagTest(A) = sum(diag(diagm(A)))

Expand All @@ -64,7 +64,7 @@ end
function test2()
A = rand(5)
abs(vecLen(A) - (@noacc vecLen(A))) < 1.0e-10 &&
abs(vecLen(A) - sqrt(Base.sumabs2(A))) < 1.0e-10
abs(vecLen(A) - sqrt(Base.sum(abs2, A))) < 1.0e-10
end

function test3()
Expand Down
2 changes: 1 addition & 1 deletion test/mapreduce.jl
Expand Up @@ -122,7 +122,7 @@ end

function test6()
A = Int[x for x = 1:10]
reduce_2(A) == sumabs2(A)
reduce_2(A) == sum(abs2, A)
end

function test7()
Expand Down
4 changes: 2 additions & 2 deletions test/misc.jl
Expand Up @@ -58,8 +58,8 @@ end
end

function test_At_mul_B(m::Int, k::Int, n::Int)
W = Array(Float64, m, k)
X = Array(Float64, m, n)
W = Array{Float64}(m, k)
X = Array{Float64}(m, n)
fill!(W, 3)
fill!(X, 5)
opt_At_mul_B!(X, W)
Expand Down
11 changes: 6 additions & 5 deletions test/parfor.jl
Expand Up @@ -26,22 +26,23 @@ THE POSSIBILITY OF SUCH DAMAGE.
module ParForTest

using ParallelAccelerator
#ParallelAccelerator.DomainIR.set_debug_level(3)
#ParallelAccelerator.ParallelIR.set_debug_level(3)
ParallelAccelerator.DomainIR.set_debug_level(3)
ParallelAccelerator.ParallelIR.set_debug_level(3)
ParallelAccelerator.set_debug_level(3)
#ParallelAccelerator.CGen.set_debug_level(3)
#using CompilerTools
#CompilerTools.OptFramework.set_debug_level(3)

@acc function parfor1(n)
A = Array(Int, n, n)
A = Array{Int}(n, n)
@par for i in 1:n, j in 1:n
A[i,j] = i * j
end
return sum(A)
end

@acc function parfor2(n)
A = Array(Int, n, n)
A = Array{Int}(n, n)
s::Int = 0
m::Int = 0
@par s(+) m(+) for i in 1:n, j = 1:n
Expand All @@ -53,7 +54,7 @@ end
end

@acc function parfor3(n)
A::Array{Int,2} = Array(Int, n, n)
A::Array{Int,2} = Array{Int}(n, n)
s::Array{Int,1} = zeros(Int, n)
m::Int = 0
@par s(.+) m(+) for i in 1:n
Expand Down
2 changes: 1 addition & 1 deletion test/seq.jl
Expand Up @@ -60,6 +60,6 @@ end
using Base.Test

println("Testing sequential code...")
@test_approx_eq SeqTest.test1() [9.0 12.0; 10.0 20.0]
@test SeqTest.test1() [9.0 12.0; 10.0 20.0]
println("Done testing sequential code.")

6 changes: 3 additions & 3 deletions test/test_at_mul_b.jl
Expand Up @@ -9,9 +9,9 @@ using ParallelAccelerator
end

function main(m::Int, k::Int, n::Int)
U = Array(Float64, n, k)
W = Array(Float64, m, k)
X = Array(Float64, m, n)
U = Array{Float64}(n, k)
W = Array{Float64}(m, k)
X = Array{Float64}(m, n)
fill!(W, 3)
fill!(X, 5)
opt_At_mul_B!(U, X, W)
Expand Down
4 changes: 2 additions & 2 deletions test/test_lda_evaluate.jl
Expand Up @@ -12,8 +12,8 @@ end
end

function main(m::Int, n::Int)
X = Array(Float64, m, n)
W = Array(Float64, m)
X = Array{Float64}(m, n)
W = Array{Float64}(m)
fill!(X, 5)
fill!(W, 3)
b = 1.0
Expand Down
2 changes: 1 addition & 1 deletion test/test_lr.jl
Expand Up @@ -49,7 +49,7 @@ end

using Base.Test
println("Testing logistic regression...")
@test_approx_eq TestLogisticRegression.logistic_regression(10) [0.9461770317849691 0.8827825771001324 1.2035527971160302]
@test TestLogisticRegression.logistic_regression(10) [0.9461770317849691 0.8827825771001324 1.2035527971160302]
println("Done testing logistic regression...")


4 changes: 2 additions & 2 deletions test/test_sum_maximum.jl
Expand Up @@ -9,8 +9,8 @@ using ParallelAccelerator
end

function main(m::Int, k::Int)
W = Array(Float64, m, k)
Wp = Array(Float64, m, k)
W = Array{Float64}(m, k)
Wp = Array{Float64}(m, k)
fill!(W, 3)
fill!(Wp, 5)
chg = find_chg(k,m,W,Wp)
Expand Down
7 changes: 3 additions & 4 deletions test/test_update_w.jl
Expand Up @@ -13,10 +13,9 @@ using ParallelAccelerator
end

function main(m::Int, k::Int)
Y = Array(Float64, m, k) # to store E{x g(w'x)} for components
E1 = Array(Float64, k) # store E{g'(w'x)} for components

W = Array(Float64, m, k) # to store E{x g(w'x)} for components
Y = Array{Float64}(m, k) # to store E{x g(w'x)} for components
E1 = Array{Float64}(k) # store E{g'(w'x)} for components
W = Array{Float64}(m, k) # to store E{x g(w'x)} for components

fill!(W, 3)
fill!(Y, 9)
Expand Down

0 comments on commit a28f755

Please sign in to comment.