Skip to content

Commit 1b6c8e3

Browse files
committed
fix and test dot product
1 parent 018b9aa commit 1b6c8e3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/linalg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function dot(x::DVector, y::DVector)
4141

4242
results=Any[]
4343
asyncmap(procs(x)) do p
44-
push!(results, remotecall_fetch((x, y) -> dot(localpart(x), makelocal(y, localindices(x)...)), x, y))
44+
push!(results, remotecall_fetch((x, y) -> dot(localpart(x), makelocal(y, localindices(x)...)), p, x, y))
4545
end
4646
return reduce(+, results)
4747
end

test/darray.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,19 @@ end
898898

899899
check_leaks()
900900

901+
@testset "dot product" begin
902+
A = drandn(20,20)
903+
b = drandn(20)
904+
c = A * b
905+
906+
@test dot(c, b) dot(convert(Array, c), convert(Array, b))
907+
close(A)
908+
close(b)
909+
close(c)
910+
end
911+
912+
check_leaks()
913+
901914
@testset "test norm" begin
902915
x = drandn(20)
903916

0 commit comments

Comments
 (0)