JuliaLinearAlgebra / Octavian.jl

Multi-threaded BLAS-like library that provides pure Julia matrix multiplication
https://julialinearalgebra.github.io/Octavian.jl/stable/
Other
232 stars 18 forks source link

An experiment to see if we can thread loop 3 #18

Closed DilumAluthge closed 3 years ago

codecov[bot] commented 3 years ago

Codecov Report

Merging #18 (193a792) into master (5975d5c) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #18   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          109       109           
=========================================
  Hits           109       109           
Impacted Files Coverage Δ
src/matmul.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5975d5c...193a792. Read the comment docs.

DilumAluthge commented 3 years ago

I think something is not threadsafe inside loop 3. Is it Aptr? I.e. is Aptr the same across threads, and could that be the problem?

DilumAluthge commented 3 years ago

Does each thread inside loop 3 needs its own Aptr? Since each thread will be trying to copy into that location.

chriselrod commented 3 years ago

Oops, just saw this, yes, you're exactly right. Every thread needs its own Aptr.

chriselrod commented 3 years ago

Every thread should make their own Aptr (which should be stack allocated, and hence free to do) and then pack it and use it for multiplication. So it shouldn't take any real management effort, unlike Bptr.