Skip to content

Commit

Permalink
Remove Requires dependency (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd authored Jul 13, 2024
1 parent de31926 commit 37bcfda
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 26 deletions.
19 changes: 8 additions & 11 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ version = "1.2.0"
[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
BFloat16s = "ab4f0b2a-ad5b-11e8-123f-65d77653426b"
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
ExprTools = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
Expand All @@ -23,11 +22,18 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Python_jll = "93d3a430-8e7c-50da-8e8d-3dfcfb3baf05"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[weakdeps]
BFloat16s = "ab4f0b2a-ad5b-11e8-123f-65d77653426b"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"

[extensions]
BFloat16sExt = "BFloat16s"
SpecialFunctionsExt = "SpecialFunctions"

[compat]
Adapt = "4"
Artifacts = "1"
Expand All @@ -45,19 +51,10 @@ ObjectiveC = "2.1, 3"
PrecompileTools = "1"
Preferences = "1"
Reexport = "1.0"
Requires = "1"
SHA = "0.7"
SpecialFunctions = "2"
StaticArrays = "1"
julia = "1.10"

[extensions]
BFloat16sExt = "BFloat16s"
SpecialFunctionsExt = "SpecialFunctions"

[extras]
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"

[weakdeps]
BFloat16s = "ab4f0b2a-ad5b-11e8-123f-65d77653426b"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
2 changes: 1 addition & 1 deletion ext/SpecialFunctionsExt.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module SpecialFunctionsExt # Should be same name as the file (just like a normal package)

using Metal
isdefined(Base, :get_extension) ? (using SpecialFunctions) : (using ..SpecialFunctions)
using SpecialFunctions

# math functionality corresponding to SpecialFunctions.jl

Expand Down
8 changes: 0 additions & 8 deletions src/Metal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ using ExprTools: splitdef, combinedef
using Artifacts
using ObjectiveC, .CoreFoundation, .Foundation, .Dispatch, .OS

if !isdefined(Base, :get_extension)
using Requires: @require
end

# core library
include("../lib/mtl/MTL.jl")
@reexport using .MTL
Expand Down Expand Up @@ -69,10 +65,6 @@ include("MetalKernels.jl")
import .MetalKernels: MetalBackend
export MetalBackend

@static if !isdefined(Base, :get_extension)
include("../ext/BFloat16sExt.jl")
end

include("deprecated.jl")

include("precompile.jl")
Expand Down
6 changes: 0 additions & 6 deletions src/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ function __init__()
if isdefined(Base, :active_repl_backend)
push!(Base.active_repl_backend.ast_transforms, synchronize_metal_tasks)
end

@static if !isdefined(Base, :get_extension)
@require SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" begin
include("../ext/SpecialFunctionsExt.jl")
end
end
end

function synchronize_metal_tasks(ex)
Expand Down

0 comments on commit 37bcfda

Please sign in to comment.