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: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ steps:
- label: "OpenCL.jl"
plugins:
- JuliaCI/julia#v1:
version: "1.10"
version: "1.11"
- JuliaCI/julia-coverage#v1:
codecov: true
command: |
Expand Down
22 changes: 1 addition & 21 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ['1.10', '1.11', '1.12', '1.13-nightly', 'nightly']
version: ['1.11', '1.12', '1.13-nightly', 'nightly']
os: [ubuntu-24.04, ubuntu-24.04-arm, macOS-15, macOS-15-intel, windows-2025]
arch: [x64, arm64]
llvm_args: ['']
Expand All @@ -38,26 +38,6 @@ jobs:
include:
# starting with Julia 1.10, we can enable opaque pointers
# from Julia 1.12 on, this is the default.
- version: '1.10'
os: 'ubuntu-24.04'
arch: 'x64'
llvm_args: '--opaque-pointers'
- version: '1.10'
os: 'ubuntu-24.04-arm'
arch: 'arm64'
llvm_args: '--opaque-pointers'
- version: '1.10'
os: 'macOS-15'
arch: 'arm64'
llvm_args: '--opaque-pointers'
- version: '1.10'
os: 'macOS-15-intel'
arch: 'x64'
llvm_args: '--opaque-pointers'
- version: '1.10'
os: 'windows-2025'
arch: 'x64'
llvm_args: '--opaque-pointers'
- version: '1.11'
os: 'ubuntu-24.04'
arch: 'x64'
Expand Down
8 changes: 3 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,28 @@ authors = ["Tim Besard <tim.besard@gmail.com>"]
projects = ["test"]

[deps]
CompilerCaching = "9db33cc3-5358-4881-8759-fa4194144afd"
ExprTools = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LLVM = "929cbde3-209d-540e-8aea-75f648917ca0"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Scratch = "6c6a2e73-6563-6170-7368-637461726353"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Tracy = "e689c965-62c8-4b79-b2c5-8359227902fd"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
CompilerCaching = "0.2.4"
ExprTools = "0.1"
InteractiveUtils = "1"
LLVM = "9.6"
Libdl = "1"
Logging = "1"
PrecompileTools = "1"
Preferences = "1"
Scratch = "1"
Serialization = "1"
TOML = "1"
Tracy = "0.1.4"
UUIDs = "1"
julia = "1.10"
julia = "1.11"
19 changes: 0 additions & 19 deletions src/GPUCompiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ using ExprTools: splitdef, combinedef

using Libdl

using Serialization
using Scratch: @get_scratch!
using Preferences

const ENABLE_TRACY = parse(Bool, @load_preference("tracy", "false"))
Expand All @@ -35,9 +33,6 @@ end
const CC = Core.Compiler
using Core: MethodInstance, CodeInstance, CodeInfo

compile_cache = nothing # set during __init__()
const pkgver = Base.pkgversion(GPUCompiler)

include("utils.jl")
include("mangling.jl")

Expand Down Expand Up @@ -67,25 +62,11 @@ include("driver.jl")
include("execution.jl")
include("reflection.jl")

include("deprecated.jl")

include("precompile.jl")

function __init__()
STDERR_HAS_COLOR[] = get(stderr, :color, false)

dir = @get_scratch!("compiled")
## add the Julia version
dir = joinpath(dir, "v$(VERSION.major).$(VERSION.minor)")
## also add the package version
if pkgver !== nothing
# XXX: `Base.pkgversion` is buggy and sometimes returns `nothing`, see e.g.
# JuliaLang/PackageCompiler.jl#896 and JuliaGPU/GPUCompiler.jl#593
dir = joinpath(dir, "v$(pkgver.major).$(pkgver.minor)")
end
mkpath(dir)
global compile_cache = dir

@static if ENABLE_TRACY
Tracy.@register_tracepoints()
end
Expand Down
2 changes: 0 additions & 2 deletions src/bpf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ end

## job

runtime_slug(job::CompilerJob{BPFCompilerTarget}) = "bpf"

const bpf_intrinsics = () # TODO
isintrinsic(::CompilerJob{BPFCompilerTarget}, fn::String) = in(fn, bpf_intrinsics)

Expand Down
45 changes: 0 additions & 45 deletions src/deprecated.jl

This file was deleted.

53 changes: 6 additions & 47 deletions src/driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,34 +50,16 @@ const compile_hook = Ref{Union{Nothing,Function}}(nothing)
compile(target::Symbol, job::CompilerJob)

Compile a `job` to one of the following formats as specified by the `target` argument:
`:julia` for Julia IR, `:llvm` for LLVM IR and `:asm` for machine code.
`:llvm` for LLVM IR, `:asm` for assembly, or `:obj` for object code.
"""
function compile(target::Symbol, @nospecialize(job::CompilerJob); kwargs...)
# XXX: remove on next major version
if !isempty(kwargs)
Base.depwarn("The GPUCompiler `compile` API does not take keyword arguments anymore. Use CompilerConfig instead.", :compile)
config = CompilerConfig(job.config; kwargs...)
job = CompilerJob(job.source, config)
end

function compile(target::Symbol, @nospecialize(job::CompilerJob))
if compile_hook[] !== nothing
Base.invokelatest(compile_hook[], job)
end

return compile_unhooked(target, job)
end

# XXX: remove on next major version
function codegen(output::Symbol, @nospecialize(job::CompilerJob); kwargs...)
if !isempty(kwargs)
Base.depwarn("The GPUCompiler `codegen` function is an internal API. Use `GPUCompiler.compile` (with any kwargs passed to `CompilerConfig`) instead.", :codegen)
config = CompilerConfig(job.config; kwargs...)
job = CompilerJob(job.source, config)
end
compile_unhooked(output, job)
end

function compile_unhooked(output::Symbol, @nospecialize(job::CompilerJob); kwargs...)
function compile_unhooked(output::Symbol, @nospecialize(job::CompilerJob))
if context(; throw_error=false) === nothing
error("No active LLVM context. Use `JuliaContext()` do-block syntax to create one.")
end
Expand Down Expand Up @@ -179,14 +161,7 @@ end

const __llvm_initialized = Ref(false)

@locked function emit_llvm(@nospecialize(job::CompilerJob); kwargs...)
# XXX: remove on next major version
if !isempty(kwargs)
Base.depwarn("The GPUCompiler `emit_llvm` function is an internal API. Use `GPUCompiler.compile` (with any kwargs passed to `CompilerConfig`) instead.", :emit_llvm)
config = CompilerConfig(job.config; kwargs...)
job = CompilerJob(job.source, config)
end

@locked function emit_llvm(@nospecialize(job::CompilerJob))
if !__llvm_initialized[]
InitializeAllTargets()
InitializeAllTargetInfos()
Expand Down Expand Up @@ -250,7 +225,7 @@ const __llvm_initialized = Ref(false)
target = nest_target(dyn_job.config.target, job.config.target)
params = nest_params(dyn_job.config.params, job.config.params)
config = CompilerConfig(dyn_job.config; toplevel=false, target, params)
return codegen(:llvm, CompilerJob(dyn_job; config))
return compile_unhooked(:llvm, CompilerJob(dyn_job; config))
end

# compile and link
Expand Down Expand Up @@ -314,23 +289,7 @@ const __llvm_initialized = Ref(false)

@tracepoint "Library linking" begin
# target-specific libraries
@tracepoint "target libraries" begin
if has_legacy_link_libraries(job)
Base.depwarn(
"3-arg `link_libraries!(job, mod, undefined_fns)` is deprecated; " *
"migrate your override to the 2-arg form `link_libraries!(job, mod)`. " *
"Instead of inspecting `undefined_fns` to decide what to link, " *
"parse the library lazily with `parse(LLVM.Module, bytes; lazy=true)` " *
"and link it with `LLVM.link!(mod, lib; only_needed=true)` — " *
"the linker will then materialize only the referenced symbols.",
:link_libraries!)
undefined_fns = [LLVM.name(f) for f in functions(ir)
if isdeclaration(f) && !LLVM.isintrinsic(f)]
link_libraries!(job, ir, undefined_fns)
else
link_libraries!(job, ir)
end
end
@tracepoint "target libraries" link_libraries!(job, ir)

# GPU run-time library
if !uses_julia_runtime(job)
Expand Down
Loading
Loading