Skip to content

Commit 993f09d

Browse files
authored
Merge pull request #310 from FourierFlows/ncc/use-latest-cuda
Compat entry to avoid bug in CUDA v3.7.0
2 parents edcc500 + 2578533 commit 993f09d

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = ["Gregory L. Wagner <wagner.greg@gmail.com>", "Navid C. Constantinou <
66
description = "Tools for building fast, hackable, pseudospectral partial differential equation solvers on periodic domains."
77
documentation = "https://fourierflows.github.io/FourierFlowsDocumentation/stable/"
88
repository = "https://github.com/FourierFlows/FourierFlows.jl"
9-
version = "0.8.1"
9+
version = "0.9.0"
1010

1111
[deps]
1212
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
@@ -20,7 +20,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
2020
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
2121

2222
[compat]
23-
CUDA = "^1, ^2.4.2, 3.0.0 - 3.3.6"
23+
CUDA = "^1, ^2.4.2, 3.0.0 - 3.6.4, ^3.7.1"
2424
DocStringExtensions = "^0.8"
2525
FFTW = "^1"
2626
Interpolations = "^0.12, ^0.13"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ and [Navid C. Constantinou][] (@navidcy).
102102

103103
The code is citable via [zenodo](https://zenodo.org). Please cite as:
104104

105-
> Navid C. Constantinou & Gregory L. Wagner. (2021). FourierFlows/FourierFlows.jl: FourierFlows v0.8.0 (Version v0.8.0). Zenodo. [http://doi.org/10.5281/zenodo.1161724](http://doi.org/10.5281/zenodo.1161724)
105+
> Navid C. Constantinou & Gregory L. Wagner and co-contributors. (2021). FourierFlows/FourierFlows.jl: FourierFlows v0.9.0 (Version v0.9.0). Zenodo. [http://doi.org/10.5281/zenodo.1161724](http://doi.org/10.5281/zenodo.1161724)
106106
107107

108108
## Contributing

src/FourierFlows.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export
6161
step_until!
6262

6363
using
64+
CUDA,
6465
FFTW,
6566
JLD2,
6667
Statistics,
@@ -69,7 +70,6 @@ using
6970
DocStringExtensions
7071

7172
@reexport using FFTW: fft, ifft, rfft, irfft
72-
@reexport using CUDA
7373

7474
import Base: resize!, getindex, setindex!, push!, append!, show, summary
7575

@@ -112,7 +112,7 @@ include("timesteppers.jl")
112112
include("diffusion.jl")
113113

114114
# CUDA functionality
115-
if CUDA.has_cuda()
115+
if CUDA.functional()
116116
@info "GPU functionality for FourierFlows is loaded"
117117
include("CuFourierFlows.jl")
118118
end

test/runtests.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using
2+
CUDA,
23
FFTW,
34
LinearAlgebra,
45
Printf,
@@ -15,7 +16,7 @@ using FourierFlows: parsevalsum2
1516
using LinearAlgebra: mul!, ldiv!, norm
1617

1718
# the devices on which tests will run
18-
devices = CUDA.has_cuda() ? (CPU(), GPU()) : (CPU(),)
19+
devices = CUDA.functional() ? (CPU(), GPU()) : (CPU(),)
1920

2021
const rtol_fft = 1e-12
2122
const rtol_output = 1e-12
@@ -365,10 +366,11 @@ for dev in devices
365366
@test repr(diag) == "Diagnostic\n ├─── calc: get_sol\n ├─── prob: FourierFlows.Problem{DataType, Vector{ComplexF64}, Float64, Vector{Int64}}\n ├─── data: 101-element Vector{Vector{ComplexF64}}\n ├────── t: 101-element Vector{Float64}\n ├── steps: 101-element Vector{Int64}\n ├─── freq: 1\n └────── i: 1"
366367
@test repr(out) == "Output\n ├──── prob: FourierFlows.Problem{DataType, Vector{ComplexF64}, Float64, Vector{Int64}}\n ├──── path: output.jld2\n └── fields: Dict{Symbol, Function}()"
367368
else
368-
@test repr(prob.vars) == "Variables\n ├───── variable: c -> 128-element " * string(ArrayType(dev)) * "{Float64, 1}\n ├───── variable: cx -> 128-element " * string(ArrayType(dev)) * "{Float64, 1}\n ├───── variable: ch -> 65-element " * string(ArrayType(dev)) * "{ComplexF64, 1}\n └───── variable: cxh -> 65-element " * string(ArrayType(dev)) * "{ComplexF64, 1}\n"
369-
@test repr(diag) == "Diagnostic\n ├─── calc: get_sol\n ├─── prob: FourierFlows.Problem{DataType, " * string(ArrayType(dev)) * "{ComplexF64, 1}, Float64, " * string(ArrayType(dev)) * "{Int64, 1}}\n ├─── data: 101-element Vector{" * string(ArrayType(dev)) * "{ComplexF64, 1}}\n ├────── t: 101-element Vector{Float64}\n ├── steps: 101-element Vector{Int64}\n ├─── freq: 1\n └────── i: 1"
370-
@test repr(out) == "Output\n ├──── prob: FourierFlows.Problem{DataType, " * string(ArrayType(dev)) * "{ComplexF64, 1}, Float64, " * string(ArrayType(dev)) * "{Int64, 1}}\n ├──── path: output.jld2\n └── fields: Dict{Symbol, Function}()"
369+
@test repr(prob.vars) == "Variables\n ├───── variable: c -> 128-element CuArray{Float64, 1, CUDA.Mem.DeviceBuffer}\n ├───── variable: cx -> 128-element CuArray{Float64, 1, CUDA.Mem.DeviceBuffer}\n ├───── variable: ch -> 65-element CuArray{ComplexF64, 1, CUDA.Mem.DeviceBuffer}\n └───── variable: cxh -> 65-element CuArray{ComplexF64, 1, CUDA.Mem.DeviceBuffer}\n"
370+
@test repr(diag) == "Diagnostic\n ├─── calc: get_sol\n ├─── prob: FourierFlows.Problem{DataType, CuArray{ComplexF64, 1, CUDA.Mem.DeviceBuffer}, Float64, CuArray{Int64, 1, CUDA.Mem.DeviceBuffer}}\n ├─── data: 101-element Vector{CuArray{ComplexF64, 1, CUDA.Mem.DeviceBuffer}}\n ├────── t: 101-element Vector{Float64}\n ├── steps: 101-element Vector{Int64}\n ├─── freq: 1\n └────── i: 1"
371+
@test repr(out) == "Output\n ├──── prob: FourierFlows.Problem{DataType, CuArray{ComplexF64, 1, CUDA.Mem.DeviceBuffer}, Float64, CuArray{Int64, 1, CUDA.Mem.DeviceBuffer}}\n ├──── path: output.jld2\n └── fields: Dict{Symbol, Function}()"
371372
end
373+
372374
@test repr(prob.eqn) == "Equation\n ├──────── linear coefficients: L\n │ ├───type: Int64\n │ └───size: (65,)\n ├───────────── nonlinear term: calcN!()\n └─── type of state vector sol: ComplexF64"
373375
@test repr(prob.clock) == "Clock\n ├─── timestep dt: 0.01\n ├────────── step: 0\n └──────── time t: 0.0"
374376
@test repr(prob) == "Problem\n ├─────────── grid: grid (on " * FourierFlows.griddevice(prob.grid) * ")\n ├───── parameters: params\n ├────── variables: vars\n ├─── state vector: sol\n ├─────── equation: eqn\n ├────────── clock: clock\n └──── timestepper: RK4TimeStepper"

0 commit comments

Comments
 (0)