Skip to content

Commit

Permalink
Add test for store plans
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Feb 25, 2020
1 parent 46d6f75 commit 6056503
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/tensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,18 @@ end
mC = reshape(permutedims(C, ipC), (loA, loB))
@test mC mA * mB

# simple case with plan storage
opA = CUTENSOR.CUTENSOR_OP_IDENTITY
opB = CUTENSOR.CUTENSOR_OP_IDENTITY
opC = CUTENSOR.CUTENSOR_OP_IDENTITY
opOut = CUTENSOR.CUTENSOR_OP_IDENTITY
plan = CUTENSOR.contraction_plan(dA, indsA, opA, dB, indsB, opB, dC, indsC, opC, opOut)
dC = CUTENSOR.contraction!(1, dA, indsA, opA, dB, indsB, opB,
0, dC, indsC, opC, opOut, plan=plan)
C = collect(dC)
mC = reshape(permutedims(C, ipC), (loA, loB))
@test mC mA * mB

# with non-trivial α
α = rand(eltyC)
dC = CUTENSOR.contraction!(α, dA, indsA, opA, dB, indsB, opB,
Expand Down

0 comments on commit 6056503

Please sign in to comment.