Skip to content

Commit

Permalink
Workaround breakage in llvm.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Jun 6, 2024
1 parent e17da2c commit d028cd1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ struct CFnTypeInfo
end


@static isdefined(LLVM, InstructionMetadataDict)
Base.haskey(md::LLVM.InstructionMetadataDict, kind::String) =
ccall((:EnzymeGetStringMD, libEnzyme), Cvoid, (LLVM.API.LLVMValueRef, Cstring), md.inst, kind) != C_NULL

Expand All @@ -115,6 +116,7 @@ function Base.getindex(md::LLVM.InstructionMetadataDict, kind::String)

Base.setindex!(md::LLVM.InstructionMetadataDict, node::LLVM.Metadata, kind::String) =
ccall((:EnzymeSetStringMD, libEnzyme), Cvoid, (LLVM.API.LLVMValueRef, Cstring, LLVM.API.LLVMValueRef), md.inst, kind, LLVM.Value(node))
end

@cenum(CDIFFE_TYPE,
DFT_OUT_DIFF = 0, # add differential to an output struct
Expand Down

0 comments on commit d028cd1

Please sign in to comment.