Skip to content

Commit

Permalink
Don't cache non-pow of 2 ints (#2216)
Browse files Browse the repository at this point in the history
* Don't cache pow of 2 ints

* Update Project.toml
  • Loading branch information
wsmoses authored Dec 23, 2024
1 parent 7626c52 commit 7af0e58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Enzyme"
uuid = "7da242da-08ed-463a-9acd-ee780be4f1d9"
authors = ["William Moses <[email protected]>", "Valentin Churavy <[email protected]>"]
version = "0.13.24"
version = "0.13.25"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Expand Down Expand Up @@ -39,7 +39,7 @@ BFloat16s = "0.2, 0.3, 0.4, 0.5"
CEnum = "0.4, 0.5"
ChainRulesCore = "1"
EnzymeCore = "0.8.8"
Enzyme_jll = "0.0.168"
Enzyme_jll = "0.0.170"
GPUCompiler = "0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 1"
LLVM = "6.1, 7, 8, 9"
LogExpFunctions = "0.3"
Expand Down
5 changes: 5 additions & 0 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,11 @@ function memmove_warning!(val)
ccall((:EnzymeSetCLBool, libEnzyme), Cvoid, (Ptr{Cvoid}, UInt8), ptr, val)
end

function EnzymeNonPower2Cache!(val)
ptr = cglobal((:EnzymeNonPower2Cache, libEnzyme))
ccall((:EnzymeSetCLInteger, libEnzyme), Cvoid, (Ptr{Cvoid}, UInt8), ptr, val)
end

function EnzymeRemoveTrivialAtomicIncrements(func)
ccall((:EnzymeRemoveTrivialAtomicIncrements, libEnzyme), Cvoid, (LLVMValueRef,), func)
end
Expand Down
1 change: 1 addition & 0 deletions src/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,7 @@ end
function __init__()
API.memmove_warning!(false)
API.typeWarning!(false)
API.EnzymeNonPower2Cache!(false)
API.EnzymeSetHandler(
@cfunction(
julia_error,
Expand Down

0 comments on commit 7af0e58

Please sign in to comment.