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

Insufficiently aggressive activity analysis #660

Closed
wsmoses opened this issue Mar 9, 2023 · 0 comments
Closed

Insufficiently aggressive activity analysis #660

wsmoses opened this issue Mar 9, 2023 · 0 comments

Comments

@wsmoses
Copy link
Member

wsmoses commented Mar 9, 2023

using Enzyme 

struct RHS_terms
    eta1::Vector{Float64}
    u_t::Vector{Float64} 
    eta_t::Vector{Float64}
end

@noinline function comp_u_v_eta_t(rhs) 
    Base.unsafe_copyto!(rhs.eta_t, 1, rhs.u_t, 1, 1)
    return nothing
end 

function advance(eta, rhs)

    @inbounds rhs.eta1[1] = @inbounds eta[1]

    comp_u_v_eta_t(rhs)

    @inbounds eta[1] = @inbounds rhs.eta_t[1]

    return nothing 

end

rhs_terms = RHS_terms(zeros(1), zeros(1), zeros(1))

u_v_eta = Float64[NaN]

Enzyme.API.printall!(true)
Enzyme.API.printactivity!(true)

ad_eta = zeros(1)

@show ad_eta
# Enzyme.API.runtimeActivity!(true)

autodiff(Reverse, advance, 
    Duplicated(u_v_eta, ad_eta),
    Const(rhs_terms), 
)
@show ad_eta

requires: EnzymeAD/Enzyme#1020

@wsmoses wsmoses closed this as completed Mar 11, 2023
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

No branches or pull requests

1 participant