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

Unsafe wrap is not supported fully #2314

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Unsafe wrap is not supported fully #2314

wants to merge 1 commit into from

Conversation

vchuravy
Copy link
Member

@vchuravy vchuravy commented Feb 18, 2025

The added test currently fails with:

cannot find shadow for   %19 = call nonnull "enzyme_type"="{[-1]:Pointer}" {} addrspace(10)* @ijl_ptr_to_array({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 139992576232976 to {}*) to {} addrspace(10)*), i64 %16, {} addrspace(10)* noundef nonnull %17, i32 noundef 0) #27, !dbg !75

Caused by:
Stacktrace:
 [1] #unsafe_wrap#115
   @ ./pointer.jl:110
 [2] unsafe_wrap
   @ ./pointer.jl:108
 [3] Container

Follow-up to #2257

@vchuravy
Copy link
Member Author

@wsmoses how do I best go about fixing this?

Copy link
Contributor

Benchmark Results

main decf3a7... main/decf3a7b327c7b...
basics/overhead 4.33 ± 0.01 ns 4.34 ± 0.01 ns 0.998
time_to_load 1.22 ± 0.03 s 1.24 ± 0.013 s 0.981

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@wsmoses
Copy link
Member

wsmoses commented Feb 19, 2025

I would like look at the rule we have for that and make sure we initialize/store the shadow.

note that I’m not sure we implemented this so far, partially due to a semantics question. If the function copies in reverse we need to do the reverse += copy, but if not it should have an empty reverse pass

@vchuravy
Copy link
Member Author

ijl_ptr_to_array is not a copy, but it is an "aliasing" operation. It wraps a pointer in an Julia array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants