Skip to content

Commit

Permalink
Initial memory handling (#1972)
Browse files Browse the repository at this point in the history
* Initial memory handling

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix
  • Loading branch information
wsmoses authored Oct 17, 2024
1 parent 72ae040 commit bc64880
Show file tree
Hide file tree
Showing 6 changed files with 1,041 additions and 630 deletions.
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

0 comments on commit bc64880

Please sign in to comment.