Skip to content

Commit efdc8fe

Browse files
authored
Try #861:
2 parents b60df53 + cf593a5 commit efdc8fe

File tree

3 files changed

+36
-19
lines changed

3 files changed

+36
-19
lines changed

.gitlab-ci.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,47 @@ variables:
55
CI_IMAGE_TAG: 'cuda'
66

77
include:
8-
- 'https://raw.githubusercontent.com/JuliaGPU/gitlab-ci/master/templates/v3/common.yml'
8+
- 'https://raw.githubusercontent.com/JuliaGPU/gitlab-ci/master/templates/v4/common.yml'
99

1010
.flux:
1111
extends: .test
1212
script:
1313
- julia -e 'using InteractiveUtils;
1414
versioninfo()'
1515
- mkdir $JULIA_DEPOT_PATH # Pkg3.jl#325
16-
- julia -e 'using Pkg;
17-
Pkg.add("CuArrays");'
1816
- julia --project -e 'using Pkg;
1917
Pkg.instantiate();
2018
Pkg.build();
2119
Pkg.test(; coverage=true);'
2220

2321
test:v1.0:
24-
extends: .flux
25-
variables:
26-
CI_VERSION_TAG: 'v1.0'
27-
only:
28-
- staging
29-
- trying
22+
extends: .flux
23+
variables:
24+
CI_VERSION_TAG: 'v1.0'
3025

3126
test:v1.1:
27+
extends: .flux
28+
variables:
29+
CI_VERSION_TAG: 'v1.1'
30+
31+
test:v1.2:
32+
extends: .flux
33+
variables:
34+
CI_VERSION_TAG: 'v1.2'
35+
36+
test:v1.3:
37+
extends: .flux
38+
variables:
39+
CI_VERSION_TAG: 'v1.3'
40+
41+
test:v1.0:
42+
extends: .flux
43+
variables:
44+
CI_VERSION_TAG: 'v1.0'
45+
46+
test:dev:
3247
extends: .flux
3348
variables:
34-
CI_VERSION_TAG: 'v1.1'
35-
only:
36-
- staging
37-
- trying
49+
CI_VERSION_TAG: 'dev'
50+
51+
allow_failure: true

src/cuda/curnn.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,14 @@ function rnnWorkspaceSize(r::RNNDesc, seqlen, xdesc)
8383
return Int(size[])
8484
end
8585

86-
const workspace = [CuVector{UInt8}(undef, 1)]
86+
const workspace = Ref{Union{Nothing,CuVector{UInt8}}}(nothing)
8787

88-
getworkspace(bytes) =
89-
length(workspace[]) bytes ?
90-
workspace[] :
91-
(workspace[] = CuVector{UInt8}(undef, bytes))
88+
function getworkspace(bytes)
89+
if workspace[] === nothing || length(workspace[]) < bytes
90+
workspace[] = CuVector{UInt8}(undef, bytes)
91+
end
92+
workspace[]
93+
end
9294

9395
getworkspace(r::RNNDesc, seqlen, xdesc) =
9496
getworkspace(rnnWorkspaceSize(r, seqlen, xdesc))

test/cuda/cuda.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Flux, CuArrays, Test
1+
using Flux, Test
2+
using Flux.CuArrays
23
using Flux: gpu
34

45
@info "Testing GPU Support"

0 commit comments

Comments
 (0)