Skip to content

Commit

Permalink
Add prefix to extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Feb 20, 2023
1 parent aea598e commit e4194f8
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LogDensityProblemsAD"
uuid = "996a588d-648d-4e1f-a8f0-a84b347e47b1"
authors = ["Tamás K. Papp <tkpapp@gmail.com>"]
version = "1.2.1"
version = "1.2.2"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand All @@ -18,12 +18,12 @@ Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[extensions]
EnzymeExt = "Enzyme"
ForwardDiffBenchmarkToolsExt = ["BenchmarkTools", "ForwardDiff"]
ForwardDiffExt = "ForwardDiff"
ReverseDiffExt = "ReverseDiff"
TrackerExt = "Tracker"
ZygoteExt = "Zygote"
LogDensityProblemsADEnzymeExt = "Enzyme"
LogDensityProblemsADForwardDiffBenchmarkToolsExt = ["BenchmarkTools", "ForwardDiff"]
LogDensityProblemsADForwardDiffExt = "ForwardDiff"
LogDensityProblemsADReverseDiffExt = "ReverseDiff"
LogDensityProblemsADTrackerExt = "Tracker"
LogDensityProblemsADZygoteExt = "Zygote"

[compat]
julia = "1.6"
Expand Down
2 changes: 1 addition & 1 deletion ext/EnzymeExt.jl → ext/LogDensityProblemsADEnzymeExt.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Gradient AD implementation using Enzyme.
"""
module EnzymeExt
module LogDensityProblemsADEnzymeExt

using LogDensityProblemsAD: ADGradientWrapper, EXTENSIONS_SUPPORTED, logdensity
using LogDensityProblemsAD.UnPack: @unpack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Utilities for benchmarking a log density problem with various chunk sizes using
Loaded when both ForwardDiff and BenchmarkTools are loaded.
"""
module ForwardDiffBenchmarkToolsExt
module LogDensityProblemsForwardDiffBenchmarkToolsExt

using LogDensityProblemsAD: ADgradient, EXTENSIONS_SUPPORTED, SIGNATURES, dimension, logdensity_and_gradient

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Gradient AD implementation using ForwardDiff.
"""
module ForwardDiffExt
module LogDensityProblemsADForwardDiffExt

using LogDensityProblemsAD: ADGradientWrapper, EXTENSIONS_SUPPORTED, SIGNATURES, dimension, logdensity
using LogDensityProblemsAD.UnPack: @unpack
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Gradient AD implementation using ReverseDiff.
"""
module ReverseDiffExt
module LogDensityProblemsADReverseDiffExt

using LogDensityProblemsAD: ADGradientWrapper, EXTENSIONS_SUPPORTED, SIGNATURES, dimension, logdensity
using LogDensityProblemsAD.UnPack: @unpack
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Gradient AD implementation using Tracker.
"""
module TrackerExt
module LogDensityProblemsADTrackerExt

using LogDensityProblemsAD: ADGradientWrapper, EXTENSIONS_SUPPORTED, logdensity
using LogDensityProblemsAD.UnPack: @unpack
Expand Down
2 changes: 1 addition & 1 deletion ext/ZygoteExt.jl → ext/LogDensityProblemsADZygoteExt.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Gradient AD implementation using Zygote.
"""
module ZygoteExt
module LogDensityProblemsADZygoteExt

using LogDensityProblemsAD: ADGradientWrapper, EXTENSIONS_SUPPORTED, logdensity
using LogDensityProblemsAD.UnPack: @unpack
Expand Down
16 changes: 8 additions & 8 deletions src/LogDensityProblemsAD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,18 @@ const EXTENSIONS_SUPPORTED = isdefined(Base, :get_extension)
if !EXTENSIONS_SUPPORTED
using Requires: @require
end
function __init__()
@static if !EXTENSIONS_SUPPORTED
if !EXTENSIONS_SUPPORTED
function __init__()
@require ForwardDiff="f6369f11-7733-5829-9624-2563aa707210" begin
include("../ext/ForwardDiffExt.jl")
include("../ext/LogDensityProblemsADForwardDiffExt.jl")
@require BenchmarkTools="6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" begin
include("../ext/ForwardDiffBenchmarkToolsExt.jl")
include("../ext/LogDensityProblemsADForwardDiffBenchmarkToolsExt.jl")
end
end
@require Tracker="9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" include("../ext/TrackerExt.jl")
@require Zygote="e88e6eb3-aa80-5325-afca-941959d7151f" include("../ext/ZygoteExt.jl")
@require ReverseDiff="37e2e3b7-166d-5795-8a7a-e32c996b4267" include("../ext/ReverseDiffExt.jl")
@require Enzyme="7da242da-08ed-463a-9acd-ee780be4f1d9" include("../ext/EnzymeExt.jl")
@require Tracker="9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" include("../ext/LogDensityProblemsADTrackerExt.jl")
@require Zygote="e88e6eb3-aa80-5325-afca-941959d7151f" include("../ext/LogDensityProblemsADZygoteExt.jl")
@require ReverseDiff="37e2e3b7-166d-5795-8a7a-e32c996b4267" include("../ext/LogDensityProblemsADReverseDiffExt.jl")
@require Enzyme="7da242da-08ed-463a-9acd-ee780be4f1d9" include("../ext/LogDensityProblemsADEnzymeExt.jl")
end
end

Expand Down

0 comments on commit e4194f8

Please sign in to comment.