Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CUDACore/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Random123 = "74087812-796a-5b5d-8853-05524746bad3"
RandomNumbers = "e6cf234a-135c-5ec9-84dd-332b85af5143"
Republic = "27243419-9dde-4721-b67c-fd63626fea7f"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[weakdeps]
Expand Down Expand Up @@ -66,6 +67,7 @@ Printf = "1"
Random = "1"
Random123 = "1.2"
RandomNumbers = "1.5.3"
Republic = "2"
SpecialFunctions = "1.3, 2"
StaticArrays = "1.9.8"
julia = "1.10"
Expand Down
3 changes: 2 additions & 1 deletion CUDACore/src/CUDACore.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module CUDACore

include("utils/public.jl")
using Republic: @public
export @public

using GPUCompiler
using GPUCompiler: InvalidIRError, KernelError
Expand Down
27 changes: 0 additions & 27 deletions CUDACore/src/utils/public.jl

This file was deleted.

2 changes: 2 additions & 0 deletions CUDATools/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Republic = "27243419-9dde-4721-b67c-fd63626fea7f"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
demumble_jll = "1e29f10c-031c-5a83-9565-69cddfc27673"

Expand All @@ -36,6 +37,7 @@ PrecompileTools = "1"
Preferences = "1"
PrettyTables = "3"
Printf = "1"
Republic = "2"
Statistics = "1"
demumble_jll = "1.3"
julia = "1.10"
17 changes: 1 addition & 16 deletions CUDATools/src/CUDATools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,7 @@ module CUDATools

using CUDACore

# Define our own PUBLIC_NAMES for the Julia 1.10 fallback path in the CUDA.jl shim.
# Mirrors CUDACore's @public but keeps a separate registry (and doesn't export @public).
const PUBLIC_NAMES = Symbol[]
_public_sym(s::Symbol) = s
_public_sym(e::Expr) = e.args[1] # macrocall: @foo → :@foo
macro public(symbols_expr)
syms = symbols_expr isa Symbol ? [symbols_expr] :
symbols_expr.head == :tuple ? Symbol[_public_sym(a) for a in symbols_expr.args] :
[_public_sym(symbols_expr)]
append!(PUBLIC_NAMES, syms)
if VERSION >= v"1.11.0-DEV.469"
esc(Expr(:public, syms...))
else
nothing
end
end
using Republic: @public

using GPUCompiler
using GPUCompiler: CompilerJob, methodinstance
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ projects = ["test", "docs", "perf", "examples",
[deps]
CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2"
CUDATools = "9ec180c6-1c07-47c7-9e6e-ebefa4d1f6d0"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Republic = "27243419-9dde-4721-b67c-fd63626fea7f"
cuBLAS = "182d3088-87b7-4494-8cad-fc6afaa545bc"
cuFFT = "533571aa-0936-420e-b4be-9c66f5f626ca"
cuRAND = "20fd9a0b-12d5-4c2f-a8af-7c34e9e60431"
Expand All @@ -35,7 +35,7 @@ CUDA_Runtime_jll = "76a88914-d11a-5bdc-97e0-2f5a05c973a2"
[compat]
CUDACore = "=6.0.0"
CUDATools = "=6.0.0"
Reexport = "1.0"
Republic = "2.1"
cuBLAS = "=6.0.0"
cuFFT = "=6.0.0"
cuRAND = "=6.0.0"
Expand Down
4 changes: 2 additions & 2 deletions lib/cufft/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CUDA_Runtime_Discovery = "1af6417a-86b4-443c-805f-a4643ffb695f"
CUDA_Runtime_jll = "76a88914-d11a-5bdc-97e0-2f5a05c973a2"
GPUToolbox = "096a3bc2-3ced-46d0-87f4-dd12716f4bfc"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Republic = "27243419-9dde-4721-b67c-fd63626fea7f"

[compat]
AbstractFFTs = "0.5, 1.0"
Expand All @@ -24,5 +24,5 @@ CUDA_Runtime_Discovery = "1"
CUDA_Runtime_jll = "0.21"
GPUToolbox = "0.3, 1"
LinearAlgebra = "1"
Reexport = "1.0"
Republic = "2.1"
julia = "1.10"
2 changes: 1 addition & 1 deletion lib/cufft/src/cuFFT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using CUDACore: unsafe_free!, retry_reclaim, initialize_context

using CEnum: @cenum

using Reexport: @reexport
using Republic

if CUDACore.local_toolkit
using CUDA_Runtime_Discovery
Expand Down
41 changes: 5 additions & 36 deletions src/CUDA.jl
Original file line number Diff line number Diff line change
@@ -1,42 +1,11 @@
module CUDA

using Republic

using Reexport

@reexport using CUDACore
@reexport using CUDATools

# Forward public names so CUDA.xyz works (exported names handled by @reexport)
if VERSION >= v"1.11.0-DEV.469"
# On 1.11+, `names` returns public names, so we can forward just those
for mod in (CUDACore, CUDATools)
modname = nameof(mod)
for n in names(mod)
Base.isexported(mod, n) && continue
n === modname && continue
isdefined(mod, n) || continue
@eval using $modname: $n
@eval $(Expr(:public, n))
end
end
else
# On 1.10, there's no `public` keyword. Use PUBLIC_NAMES for names registered
# by @public, and scan names(; all=true) for public enum values created by
# @enum_without_prefix (which bypasses @public but creates const bindings).
for mod in (CUDACore, CUDATools)
modname = nameof(mod)
public_names = Set{Symbol}(mod.PUBLIC_NAMES)
for n in names(mod; all=true)
isdefined(mod, n) || continue
val = try getfield(mod, n) catch; continue end
val isa CUDACore.CEnum.Cenum && Symbol(val) !== n && push!(public_names, n)
end
for n in public_names
Base.isexported(mod, n) && continue
isdefined(mod, n) || continue
@eval using $modname: $n
end
end
# Re-export exported names and re-public public names (bringing them into CUDA)
@reexport inherit=true begin
using CUDACore
using CUDATools
end

# Load math libraries so their methods (matmul, rand, etc.) are available
Expand Down