Skip to content

Commit 1028f40

Browse files
authored
Minor M1 change and fix README plot (#87)
* modify init_(a/b)cache, don't pack B if there is no bcache * Fix README link.
1 parent 9265bb7 commit 1028f40

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Environment:
5757
JULIA_NUM_THREADS = 36
5858
```
5959
Resulted in the following:
60-
![octavian10980xebench](https://github.com/JuliaLinearAlgebra/Octavian.jl/tree/master/docs/src/assets/bench10980xe.png)
60+
![octavian10980xebench](https://raw.githubusercontent.com/JuliaLinearAlgebra/Octavian.jl/master/docs/src/assets/bench10980xe.png)
6161

6262
## Related Packages
6363

src/init.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ function __init__()
1414
end
1515

1616
function init_bcache()
17-
BCACHEPTR[] = VectorizationBase.valloc(second_cache_size() * bcache_count(), Cvoid, ccall(:jl_getpagesize, Int, ()))
17+
if bcache_count() Zero()
18+
BCACHEPTR[] = VectorizationBase.valloc(second_cache_size() * bcache_count(), Cvoid, ccall(:jl_getpagesize, Int, ()))
19+
end
1820
nothing
1921
end
2022

21-
function init_acache()
22-
Sys.WORD_SIZE 32 || return
23-
ACACHEPTR[] = VectorizationBase.valloc(first_cache_size() * init_num_tasks(), Cvoid, ccall(:jl_getpagesize, Int, ()))
24-
nothing
23+
if Sys.WORD_SIZE 32
24+
function init_acache()
25+
ACACHEPTR[] = VectorizationBase.valloc(first_cache_size() * init_num_tasks(), Cvoid, ccall(:jl_getpagesize, Int, ()))
26+
nothing
27+
end
28+
else
29+
init_acache() = nothing
2530
end
2631

2732
function init_num_tasks()

src/matmul.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ function __matmul!(
355355
# `nᵣ*nspawn ≥ N` is needed at the moment to avoid accidentally splitting `N` to be `< nᵣ` while packing
356356
# Should probably handle that with a smarter splitting function...
357357
matmulsplitn!(C, A, B, α, β, Mc, M, K, N, nspawn, Val{false}())
358-
elseif ((nspawn*(W+W) > M) || (contiguousstride1(B) ? (roundtostaticint(Kc * Nc * R₂Default()) K * N) : (firstbytestride(B) 1600)))
358+
elseif (bcache_count() === Zero()) || ((nspawn*(W+W) > M) || (contiguousstride1(B) ? (roundtostaticint(Kc * Nc * R₂Default()) K * N) : (firstbytestride(B) 1600)))
359359
matmulsplitn!(C, A, B, α, β, Mc, M, K, N, nspawn, Val{true}())
360360
else # TODO: Allow splitting along `N` for `matmul_pack_A_and_B!`
361361
matmul_pack_A_and_B!(C, A, B, α, β, M, K, N, nspawn, W₁Default(), W₂Default(), R₁Default(), R₂Default())

0 commit comments

Comments
 (0)