Skip to content

Commit dbf24f3

Browse files
committed
Fixes
1 parent 7e72182 commit dbf24f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/host/linalg.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ function LinearAlgebra.ldiv!(B::AbstractGPUVecOrMat,
326326
end
327327

328328
# XXX: figure out how to do dynamically
329-
const TILE_DIM = 16
329+
MAX_TILE_DIM = 16
330330

331331
## matrix multiplication
332332
# legacy method
@@ -347,13 +347,13 @@ function generic_matmatmul!(C::AbstractGPUMatrix{R}, A::AbstractGPUMatrix{T}, B:
347347
end
348348

349349
@kernel unsafe_indices=true function coalesced_matmul_kernel!(
350-
output, input1, input2, N, Q, M,
350+
output, @Const(input1), @Const(input2), N, Q, M,
351351
::Val{BANK} = Val(1),
352352
) where {BANK}
353353
grow, gcol = @index(Group, NTuple)
354354
tile_row, tile_col = @index(Local, NTuple)
355355

356-
# TILE_DIM = @uniform @groupsize()[1]
356+
TILE_DIM = @uniform @groupsize()[1]
357357

358358
# +1 to avoid bank conflicts on shared memory
359359
tile1 = @localmem(R, (TILE_DIM + BANK, TILE_DIM))
@@ -402,7 +402,7 @@ function generic_matmatmul!(C::AbstractGPUMatrix{R}, A::AbstractGPUMatrix{T}, B:
402402
end
403403
end
404404

405-
coalesced_matmul_kernel!(get_backend(C), (TILE_DIM, TILE_DIM))(C, A, B, N, Q, M;ndrange=map(x -> ceil(Int,x/TILE_DIM)*TILE_DIM, size(C)))
405+
coalesced_matmul_kernel!(get_backend(C), (MAX_TILE_DIM, MAX_TILE_DIM))(C, A, B, N, Q, M;ndrange=map(x -> ceil(Int,x/MAX_TILE_DIM)*MAX_TILE_DIM, size(C)))
406406
C
407407
end
408408
function generic_matmatmul!(C::AbstractArray{R}, A::AbstractArray{T}, B::AbstractArray{S}, add::MulAddMul) where {T,S,R}

0 commit comments

Comments
 (0)