Skip to content

Commit 981bacb

Browse files
authored
Merge pull request #213 from JuliaGPU/tb/more_typevars
Support array types with more typevars.
2 parents 764e568 + 0295c59 commit 981bacb

File tree

3 files changed

+61
-28
lines changed

3 files changed

+61
-28
lines changed

.gitlab-ci.yml

Lines changed: 56 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,64 @@
1-
variables:
2-
CI_IMAGE_TAG: 'plain'
3-
41
include:
5-
- 'https://raw.githubusercontent.com/JuliaGPU/gitlab-ci/master/templates/v4/common.yml'
6-
- 'https://raw.githubusercontent.com/JuliaGPU/gitlab-ci/master/templates/v4/test_v1.0.yml'
7-
- 'https://raw.githubusercontent.com/JuliaGPU/gitlab-ci/master/templates/v4/test_v1.1.yml'
8-
- 'https://raw.githubusercontent.com/JuliaGPU/gitlab-ci/master/templates/v4/test_v1.2.yml'
9-
- 'https://raw.githubusercontent.com/JuliaGPU/gitlab-ci/master/templates/v4/test_v1.3.yml'
10-
- 'https://raw.githubusercontent.com/JuliaGPU/gitlab-ci/master/templates/v4/test_dev.yml'
11-
- 'https://raw.githubusercontent.com/JuliaGPU/gitlab-ci/master/templates/v4/coverage_v1.2.yml'
12-
13-
test:dev:
14-
allow_failure: true
2+
- 'https://raw.githubusercontent.com/JuliaGPU/gitlab-ci/master/templates/v6.yml'
153

16-
coverage:
4+
5+
# Julia versions
6+
7+
julia:1.0:
8+
extends:
9+
- .julia:1.0
10+
- .test
11+
12+
julia:1.1:
13+
extends:
14+
- .julia:1.1
15+
- .test
16+
17+
julia:1.2:
18+
extends:
19+
- .julia:1.2
20+
- .test
21+
22+
julia:1.3:
23+
extends:
24+
- .julia:1.3
25+
- .test
26+
27+
julia:nightly:
28+
extends:
29+
- .julia:nightly
30+
- .test
1731
allow_failure: true
18-
only:
19-
- master
32+
33+
34+
# reverse tests
35+
36+
# NOTE: reverse testing is tricky because of Manifests. we instantiate both, give priority
37+
# to this package's Manifest, and manually run tests outside of the test environment.
38+
# that means we have to manually install CuArrays' test dependencies though.
2039

2140
cuarrays:
22-
stage: test
23-
image: "juliagpu/julia:v1.2-cuda"
41+
extends: .julia:1.2
42+
tags:
43+
- nvidia
44+
- sm_75
45+
image: juliagpu/cuda:10.1-cudnn7-cutensor-devel-ubuntu18.04
2446
script:
25-
- mkdir $JULIA_DEPOT_PATH # Pkg3.jl#325
47+
- export CUARRAYS="$HOME/.julia/dev/CuArrays"
2648
- julia -e 'using Pkg;
27-
Pkg.develop(PackageSpec(path=pwd()));
28-
Pkg.build();
29-
Pkg.add(PackageSpec(name="CuArrays", rev="master"));
30-
Pkg.test("CuArrays");'
49+
Pkg.develop("CuArrays");'
50+
- julia --project -e 'using Pkg;
51+
Pkg.instantiate()'
52+
- julia --project=$CUARRAYS -e 'using Pkg;
53+
Pkg.instantiate();
54+
Pkg.add(["FFTW", "ForwardDiff"])'
55+
- JULIA_LOAD_PATH=".:$CUARRAYS::" julia $CUARRAYS/test/runtests.jl
3156
allow_failure: true
57+
58+
59+
# other tasks
60+
61+
coverage:
62+
extends:
63+
- .julia:1.2
64+
- .coverage

src/testsuite/io.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function test_io(AT)
88

99
show(io, MIME("text/plain"), A)
1010
seekstart(io)
11-
@test String(take!(io)) == "1-element $AT{Int64,1}:\n 1"
11+
@test occursin(Regex("^1-element $AT{Int64,1.*}:\n 1\$"), String(take!(io)))
1212

1313
show(io, A)
1414
seekstart(io)
@@ -19,7 +19,7 @@ function test_io(AT)
1919

2020
show(io, MIME("text/plain"), B)
2121
seekstart(io)
22-
@test String(take!(io)) == "2×2 $AT{Int64,2}:\n 1 2\n 3 4"
22+
@test occursin(Regex("^2×2 $AT{Int64,2.*}:\n 1 2\n 3 4\$"), String(take!(io)))
2323

2424
show(io, B)
2525
seekstart(io)
@@ -29,8 +29,8 @@ function test_io(AT)
2929
show(io, MIME("text/plain"), A')
3030
seekstart(io)
3131
msg = String(take!(io)) # the printing of Adjoint depends on global state
32-
@test msg == "1×1 Adjoint{Int64,$AT{Int64,1}}:\n 1" ||
33-
msg == "1×1 LinearAlgebra.Adjoint{Int64,$AT{Int64,1}}:\n 1"
32+
@test occursin(Regex("^1×1 Adjoint{Int64,$AT{Int64,1.*}}:\n 1\$"), msg) ||
33+
occursin(Regex("^1×1 LinearAlgebra.Adjoint{Int64,$AT{Int64,1.*}}:\n 1\$"), msg)
3434
end
3535
end
3636
end

src/testsuite/mapreduce.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function test_mapreduce(AT)
4545
@testset "any all ==" begin
4646
for Ac in ([false, false], [false, true], [true, true])
4747
A = AT(Ac)
48-
@test typeof(A) == AT{Bool,1}
48+
@test A isa AT{Bool,1}
4949
@test any(A) == any(Ac)
5050
@test all(A) == all(Ac)
5151
@test A == copy(A)

0 commit comments

Comments
 (0)