Skip to content

add create_shadow and zero_shadow#87

Draft
vchuravy wants to merge 1 commit intomainfrom
vc/shadow_alloc
Draft

add create_shadow and zero_shadow#87
vchuravy wants to merge 1 commit intomainfrom
vc/shadow_alloc

Conversation

@vchuravy
Copy link
Copy Markdown
Member

No description provided.

@github-actions
Copy link
Copy Markdown

Once the build has completed, you can preview your PR at this URL: https://NumericalMathematics.github.io/Ariadne.jl/previews/PR87/ in a couple of minutes.

Comment thread src/Ariadne.jl
function init_cache(x, ::Val{N}) where {N}
if !Enzyme.Compiler.guaranteed_const(typeof(x))
return ntuple(_ -> Enzyme.make_zero(x), Val(N))
return ntuple(_ -> create_shadow(x), Val(N))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why create an anonymous function if you can use

Suggested change
return ntuple(_ -> create_shadow(x), Val(N))
return ntuple(create_shadow, Val(N))

directly?

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