MuladdMacro.jl-46d2c3a1-f734-5fdb-9937-b9b9aeba4221
Last mirrored from https://github.com/JuliaDiffEq/MuladdMacro.jl.git on 2019-11-19T01:57:32.97-05:00 by @UnofficialJuliaMirrorBot via Travis job 481.24 , triggered by Travis cron job on branch "master"
https://gitlab.com/UnofficialJuliaMirror/MuladdMacro.jl-46d2c3a1-f734-5fdb-9937-b9b9aeba4221
Science Score: 18.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.6%) to scientific vocabulary
Repository
Last mirrored from https://github.com/JuliaDiffEq/MuladdMacro.jl.git on 2019-11-19T01:57:32.97-05:00 by @UnofficialJuliaMirrorBot via Travis job 481.24 , triggered by Travis cron job on branch "master"
Basic Info
- Host: gitlab.com
- Owner: UnofficialJuliaMirror
- Default Branch: master
Statistics
- Stars: 0
- Forks: 0
- Open Issues:
- Releases: 0
Metadata Files
README.md
MuladdMacro.jl
This package provides the @muladd macro. It automatically converts expressions
with multiplications and additions or subtractions to calls with muladd which then fuse via
FMA when it would increase the performance of the code. The @muladd macro
can be placed on code blocks and it will automatically find the appropriate
expressions and nest muladd expressions when necessary. In mixed expressions summands without multiplication will be grouped together and evaluated first but otherwise the order of evaluation of multiplications and additions is not changed.
Examples
```julia julia> @macroexpand(@muladd k3 = f(t + c3dt, @. uprev+dt(a031k1+a032k2))) :(k3 = f((muladd)(c3, dt, t), (muladd).(dt, (muladd).(a032, k2, (*).(a031, k1)), uprev)))
julia> @macroexpand(@muladd integrator.EEst = integrator.opts.internalnorm((update - dt(bhat1k1 + bhat4k4 + bhat5k5 + bhat6k6 + bhat7k7 + bhat10k10))./ @. (integrator.opts.abstol+max(abs(uprev),abs(u))integrator.opts.reltol))) :(integrator.EEst = (integrator.opts).internalnorm((muladd)(-dt, (muladd)(bhat10, k10, (muladd)(bhat7, k7, (muladd)(bhat6, k6, (muladd)(bhat5, k5, (muladd)(bhat4, k4, bhat1 * k1))))), update) ./ (muladd).(max.(abs.(uprev), abs.(u)), (integrator.opts).reltol, (integrator.opts).abstol))) ```
Broadcasting
A muladd call will be broadcasted if both the * and the + or - are broadcasted.
If either one is not broadcasted, then the expression will be converted to a
non-dotted muladd.
Credit
Most of the credit goes to @fcard and @devmotion for building the first version and greatly refining the macro. These contributions are not directly shown as this was developed in Gitter chats and in the DiffEqBase.jl repository, but these two individuals did almost all of the work.
Citation (CITATION.bib)
@article{DifferentialEquations.jl-2017,
author = {Rackauckas, Christopher and Nie, Qing},
doi = {10.5334/jors.151},
journal = {The Journal of Open Source Software},
keywords = {Applied Mathematics},
note = {Exported from https://app.dimensions.ai on 2019/05/05},
number = {1},
pages = {},
title = {DifferentialEquations.jl – A Performant and Feature-Rich Ecosystem for Solving Differential Equations in Julia},
url = {https://app.dimensions.ai/details/publication/pub.1085583166 and http://openresearchsoftware.metajnl.com/articles/10.5334/jors.151/galley/245/download/},
volume = {5},
year = {2017}
}
Dependencies
- MacroTools *
- julia 0.7-beta2