Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial memory handling #1972

Merged
merged 13 commits into from
Oct 17, 2024
Merged
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
15 changes: 14 additions & 1 deletion src/absint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ function abs_typeof(
nm == "jl_alloc_array_3d" ||
nm == "ijl_alloc_array_3d" ||
nm == "jl_new_array" ||
nm == "ijl_new_array"
nm == "ijl_new_array" ||
nm == "jl_alloc_genericmemory" ||
nm == "ijl_alloc_genericmemory"
vals = absint(operands(arg)[1], partial)
return (vals[1], vals[2], vals[1] ? GPUCompiler.MUT_REF : nothing)
end
Expand Down Expand Up @@ -365,6 +367,17 @@ function abs_typeof(
end
return (legal, RT, nothing)
end
@static if VERSION < v"1.11-"
else
if nm == "jl_genericmemory_copy_slice" || nm == "ijl_genericmemory_copy_slice"
legal, RT, _ = abs_typeof(operands(arg)[1], partial)
if legal
@assert RT <: Memory
return (legal, RT, GPUCompiler.MUT_REF)
end
return (legal, RT, nothing)
end
end

_, RT = enzyme_custom_extract_mi(arg, false)
if RT !== nothing
Expand Down
Loading
Loading