Skip to content

Commit 5ab7675

Browse files
Merge pull request #2831 from ChrisRackauckas-Claude/add-simd-rk-sublibrary
Add OrdinaryDiffEqSIMDRK as a standalone sublibrary
2 parents b2b18dd + 136e21b commit 5ab7675

File tree

10 files changed

+1822
-0
lines changed

10 files changed

+1822
-0
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
- OrdinaryDiffEqRKN
5252
- OrdinaryDiffEqRosenbrock
5353
- OrdinaryDiffEqSDIRK
54+
- OrdinaryDiffEqSIMDRK
5455
- OrdinaryDiffEqSSPRK
5556
- OrdinaryDiffEqStabilizedIRK
5657
- OrdinaryDiffEqStabilizedRK

lib/OrdinaryDiffEqSIMDRK/LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Yingbo Ma <mayingbo5@gmail.com> and contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

lib/OrdinaryDiffEqSIMDRK/Project.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name = "OrdinaryDiffEqSIMDRK"
2+
uuid = "dc97f408-7a72-40e4-9b0d-228a53b292f8"
3+
authors = ["Yingbo Ma <mayingbo5@gmail.com>", "Chris Elrod <elrodc@gmail.com>"]
4+
version = "1.0.0"
5+
6+
[deps]
7+
MuladdMacro = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221"
8+
OrdinaryDiffEqCore = "bbf590c4-e513-4bbe-9b18-05decba2e5d8"
9+
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
10+
SLEEFPirates = "476501e8-09a2-5ece-8869-fb82de89a1fa"
11+
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
12+
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
13+
VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
14+
15+
[compat]
16+
DiffEqDevTools = "2.44"
17+
MuladdMacro = "0.2"
18+
OrdinaryDiffEqCore = "1"
19+
Reexport = "1"
20+
SafeTestsets = "0.1"
21+
SLEEFPirates = "0.6"
22+
Static = "0.7, 0.8, 1"
23+
StaticArrays = "1.9"
24+
Test = "1"
25+
UnPack = "1"
26+
VectorizationBase = "0.21"
27+
julia = "1.10"
28+
29+
[extras]
30+
DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
31+
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
32+
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
33+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
34+
35+
[targets]
36+
test = ["DiffEqDevTools", "SafeTestsets", "StaticArrays", "Test"]
37+
38+
[sources.OrdinaryDiffEqCore]
39+
path = "../OrdinaryDiffEqCore"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module OrdinaryDiffEqSIMDRK
2+
3+
using MuladdMacro, UnPack, Static
4+
using OrdinaryDiffEqCore: OrdinaryDiffEqAdaptiveAlgorithm, OrdinaryDiffEqConstantCache,
5+
trivial_limiter!, calculate_residuals, constvalue
6+
import OrdinaryDiffEqCore: initialize!, perform_step!, alg_cache
7+
8+
using Reexport: @reexport
9+
@reexport using OrdinaryDiffEqCore
10+
11+
include("algorithms.jl")
12+
include("caches.jl")
13+
include("perform_step.jl")
14+
15+
export MER5v2, MER6v2, RK6v4
16+
17+
end
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
struct MER5v2{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAdaptiveAlgorithm
2+
stage_limiter!::StageLimiter
3+
step_limiter!::StepLimiter
4+
thread::Thread
5+
end
6+
7+
function MER5v2(; stage_limiter! = trivial_limiter!, step_limiter! = trivial_limiter!,
8+
thread = False())
9+
MER5v2{typeof(stage_limiter!), typeof(step_limiter!), typeof(thread)}(stage_limiter!,
10+
step_limiter!,
11+
thread)
12+
end
13+
14+
# for backwards compatibility
15+
function MER5v2(stage_limiter!, step_limiter! = trivial_limiter!)
16+
MER5v2{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!,
17+
step_limiter!, False())
18+
end
19+
20+
struct MER6v2{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAdaptiveAlgorithm
21+
stage_limiter!::StageLimiter
22+
step_limiter!::StepLimiter
23+
thread::Thread
24+
end
25+
26+
function MER6v2(; stage_limiter! = trivial_limiter!, step_limiter! = trivial_limiter!,
27+
thread = False())
28+
MER6v2{typeof(stage_limiter!), typeof(step_limiter!), typeof(thread)}(stage_limiter!,
29+
step_limiter!,
30+
thread)
31+
end
32+
33+
# for backwards compatibility
34+
function MER6v2(stage_limiter!, step_limiter! = trivial_limiter!)
35+
MER6v2{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!,
36+
step_limiter!, False())
37+
end
38+
39+
struct RK6v4{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAdaptiveAlgorithm
40+
stage_limiter!::StageLimiter
41+
step_limiter!::StepLimiter
42+
thread::Thread
43+
end
44+
45+
function RK6v4(; stage_limiter! = trivial_limiter!, step_limiter! = trivial_limiter!,
46+
thread = False())
47+
RK6v4{typeof(stage_limiter!), typeof(step_limiter!), typeof(thread)}(stage_limiter!,
48+
step_limiter!,
49+
thread)
50+
end
51+
52+
# for backwards compatibility
53+
function RK6v4(stage_limiter!, step_limiter! = trivial_limiter!)
54+
RK6v4{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!,
55+
step_limiter!, False())
56+
end
57+
58+
function Base.show(io::IO, alg::Union{MER5v2, MER6v2, RK6v4})
59+
print(io, "$(nameof(typeof(alg)))(stage_limiter! = ", alg.stage_limiter!,
60+
", step_limiter! = ", alg.step_limiter!,
61+
", thread = ", alg.thread, ")")
62+
end
63+
64+
OrdinaryDiffEqCore.alg_order(alg::MER5v2) = 5
65+
OrdinaryDiffEqCore.alg_order(alg::MER6v2) = 6
66+
OrdinaryDiffEqCore.alg_order(alg::RK6v4) = 6

0 commit comments

Comments
 (0)