Skip to content

Commit 48b488a

Browse files
kshyattKatharine Hyatt
authored andcommitted
More scalar indexing
1 parent 09eddcc commit 48b488a

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

test/amd/tensors.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -483,15 +483,14 @@ for V in spacelist
483483
for T in (Float64, ComplexF64)
484484
t = project_hermitian!(AMDGPU.randn(T, W, W))
485485
s = dim(W)
486-
#@test (@constinferred sqrt(t))^2 ≈ t
487-
#@test TensorKit.to_cpu(sqrt(t)) ≈ sqrt(TensorKit.to_cpu(t))
488-
489-
expt = @constinferred exp(t)
490-
@test TensorKit.to_cpu(expt) exp(TensorKit.to_cpu(t))
491-
492-
# log doesn't work on AMDGPU yet (scalar indexing)
493-
#@test exp(@constinferred log(project_hermitian!(expt))) ≈ expt
494-
#@test TensorKit.to_cpu(log(project_hermitian!(expt))) ≈ log(TensorKit.to_cpu(expt))
486+
AMDGPU.@allowscalar begin
487+
@test (@constinferred sqrt(t))^2 t
488+
@test TensorKit.to_cpu(sqrt(t)) sqrt(TensorKit.to_cpu(t))
489+
expt = @constinferred exp(t)
490+
@test TensorKit.to_cpu(expt) exp(TensorKit.to_cpu(t))
491+
@test exp(@constinferred log(project_hermitian!(expt))) expt
492+
@test TensorKit.to_cpu(log(project_hermitian!(expt))) log(TensorKit.to_cpu(expt))
493+
end
495494

496495
#=@test (@constinferred cos(t))^2 + (@constinferred sin(t))^2 ≈
497496
id(storagetype(t), W)

0 commit comments

Comments
 (0)