Skip to content

Commit

Permalink
Merge pull request #5 from FourierFlows/AddGPUFunctionality
Browse files Browse the repository at this point in the history
Adds GPU functionality in repo
  • Loading branch information
glwagner committed Jan 22, 2020
2 parents 3fdb296 + 703d16e commit 3dabc66
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 22 deletions.
5 changes: 4 additions & 1 deletion Project.toml
Expand Up @@ -8,6 +8,8 @@ version = "0.1.0"
versions = ["0.1.0"]

[deps]
CUDAapi = "3895d2a7-ec45-59b8-82bb-cfc6a382f9b3"
CuArrays = "3a865a2d-5b23-5a0f-bc46-62713ec82fae"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
FourierFlows = "2aec4490-903f-5c70-9b11-9bed06a700e1"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Expand All @@ -23,7 +25,8 @@ FourierFlows = "≥ 0.3.0"
julia = "≥ 1.0.0"

[extras]
Coverage = "a2441757-f6aa-5fb2-8edb-039e3f45d037"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Test", "Coverage"]
13 changes: 8 additions & 5 deletions README.md
@@ -1,16 +1,19 @@
# PassiveTracerFlows.jl

<p align="left">
<a href="https://travis-ci.org/FourierFlows/PassiveTracerFlows.jl">
<img src="https://travis-ci.org/FourierFlows/PassiveTracerFlows.jl.svg?branch=master" title="Build Status">
<a href="https://travis-ci.com/FourierFlows/PassiveTracerFlows.jl">
<img alt="Build Status for CPU" src="https://img.shields.io/travis/com/FourierFlows/PassiveTracerFlows.jl/master?label=CPU&logo=travis&logoColor=white&style=flat-square">
</a>
<a href="https://gitlab.com/JuliaGPU/PassiveTracerFlows-jl/commits/master">
<img alt="Build Status for GPU" src="https://img.shields.io/gitlab/pipeline/JuliaGPU/PassiveTracerFlows-jl/master?label=GPU&logo=gitlab&logoColor=white&style=flat-square">
</a>
<a href="https://ci.appveyor.com/project/navidcy/passivetracerflows-jl">
<img src="https://ci.appveyor.com/api/projects/status/yb5ywk9bof6u3nyg?svg=true" title="Build Status">
<img alt="Build Status for Window" src="https://img.shields.io/appveyor/ci/navidcy/passivetracerflows-jl/master?label=Window&logo=appveyor&logoColor=white&style=flat-square">
</a>
<a href="https://fourierflows.github.io/PassiveTracerFlows.jl/stable/">
<a href="https://fourierflows.github.io/passivetracerflows.jl/stable/">
<img src="https://img.shields.io/badge/docs-stable-blue.svg">
</a>
<a href="https://fourierflows.github.io/PassiveTracerFlows.jl/dev/">
<a href="https://fourierflows.github.io/passivetracerflows.jl/dev/">
<img src="https://img.shields.io/badge/docs-dev-blue.svg">
</a>
<a href='https://coveralls.io/github/FourierFlows/PassiveTracerFlows.jl?branch=master'><img src='https://coveralls.io/repos/github/FourierFlows/PassiveTracerFlows.jl/badge.svg?branch=master' alt='Coverage Status' />
Expand Down
2 changes: 2 additions & 0 deletions src/PassiveTracerFlows.jl
@@ -1,5 +1,7 @@
module PassiveTracerFlows

using FourierFlows

include("traceradvdiff.jl")

end # module
44 changes: 28 additions & 16 deletions test/runtests.jl
Expand Up @@ -10,28 +10,40 @@ using
import # use 'import' rather than 'using' for submodules to keep namespace clean
PassiveTracerFlows.TracerAdvDiff

# the devices on which tests will run
devices = (CPU(),)
@has_cuda devices = (CPU(), GPU())
@has_cuda using CuArrays

const rtol_traceradvdiff = 1e-12 # tolerance for rtol_traceradvdiff tests

# Run tests
testtime = @elapsed begin

for dev in devices

println("testing on "*string(typeof(dev)))

@testset "TracerAdvDiff" begin
include("test_traceradvdiff.jl")
@testset "TracerAdvDiff" begin
include("test_traceradvdiff.jl")

@test test_noflow()

stepper = "RK4"
dt, nsteps = 1e-2, 40
@test test_constvel(stepper, dt, nsteps)
dt, tfinal = 0.002, 0.1
@test test_timedependentvel(stepper, dt, tfinal)
dt, tfinal = 0.005, 0.1
@test test_diffusion(stepper, dt, tfinal; steadyflow=true)
dt, tfinal = 0.005, 0.1
@test test_diffusion(stepper, dt, tfinal; steadyflow=false)
dt, tfinal = 0.005, 0.1
@test test_hyperdiffusion(stepper, dt, tfinal)
@test test_noflow()

stepper = "RK4"
dt, nsteps = 1e-2, 40
@test test_constvel(stepper, dt, nsteps)
dt, tfinal = 0.002, 0.1
@test test_timedependentvel(stepper, dt, tfinal)
dt, tfinal = 0.005, 0.1
@test test_diffusion(stepper, dt, tfinal; steadyflow=true)
dt, tfinal = 0.005, 0.1
@test test_diffusion(stepper, dt, tfinal; steadyflow=false)
dt, tfinal = 0.005, 0.1
@test test_hyperdiffusion(stepper, dt, tfinal)
end

end

end
end #time

println("Total test time: ", testtime)

0 comments on commit 3dabc66

Please sign in to comment.