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

Update postprocessors.jl #114

Merged
merged 2 commits into from
Apr 7, 2024
Merged

Update postprocessors.jl #114

merged 2 commits into from
Apr 7, 2024

Conversation

maartenvd
Copy link
Contributor

before:

julia> @macroexpand (@planar allocator=malloc out[-1 -2 -3;-4 -5] := l[-1 1;-4]*o[1 -2;-5 -3])
quote
    numout(l) == 2 && numin(l) == 1 || throw(TensorOperations.IndexError("Incorrect number of input-output indices for l: (2, 1) instead of ($((numout(l), numin(l))))."))
    numout(o) == 2 && numin(o) == 2 || throw(TensorOperations.IndexError("Incorrect number of input-output indices for o: (2, 2) instead of ($((numout(o), numin(o))))."))
    var"##T_##304#305" = TensorOperations.promote_contract(TensorOperations.scalartype(l), TensorOperations.scalartype(o))
    var"##304" = TensorOperations.tensoralloc_contract(var"##T_##304#305", ((2, 1), (4, 5, 3)), l, ((1, 3), (2,)), :N, o, ((1,), (2, 3, 4)), :N, false, TensorOperations.Backend{:malloc}())
    var"##304" = TensorKit._planarcontract!(var"##304", ((2, 1), (4, 5, 3)), l, ((1, 3), (2,)), o, ((1,), (2, 3, 4)), VectorInterface.One(), VectorInterface.Zero())
    var"##T_out#306" = TensorOperations.scalartype(var"##304")
    out = TensorOperations.tensoralloc_add(var"##T_out#306", ((2, 5, 4), (1, 3)), var"##304", :N, false, TensorOperations.Backend{:malloc}())
    out = TensorKit._planaradd!(out, ((2, 5, 4), (1, 3)), var"##304", VectorInterface.One(), VectorInterface.Zero())
    TensorOperations.tensorfree!(var"##304", TensorOperations.Backend{:malloc}())
    out
end

Now it correctly labels var"##304" as a temporary, and no longer segfaults.

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.39%. Comparing base (fe3c9c2) to head (14f6e69).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #114      +/-   ##
==========================================
+ Coverage   81.29%   81.39%   +0.10%     
==========================================
  Files          42       42              
  Lines        5575     5575              
==========================================
+ Hits         4532     4538       +6     
+ Misses       1043     1037       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lkdvos
Copy link
Collaborator

lkdvos commented Apr 2, 2024

Nice, good catch!

@lkdvos lkdvos merged commit 3398924 into Jutho:master Apr 7, 2024
13 checks passed
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