From ca0c075de2a73f250046876b0ca5f90dc4ef0e77 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Mon, 3 Oct 2016 20:09:15 +0200 Subject: Added functions to load from off-chip to local memory without vector loads for the GEMM direct kernels --- src/kernels/level3/xgemm_direct_part2.opencl | 93 ++++++++++++++++++++-------- 1 file changed, 68 insertions(+), 25 deletions(-) (limited to 'src/kernels/level3/xgemm_direct_part2.opencl') diff --git a/src/kernels/level3/xgemm_direct_part2.opencl b/src/kernels/level3/xgemm_direct_part2.opencl index 953a3b3c..5f5c6883 100644 --- a/src/kernels/level3/xgemm_direct_part2.opencl +++ b/src/kernels/level3/xgemm_direct_part2.opencl @@ -160,6 +160,74 @@ inline void GlobalToLocalDirectB(const __global realND* restrict bgm, __local re } } +// ================================================================================================= + +// Caches global off-chip memory into local (shared) memory on-chip. This function is specific for +// caching the A input matrix. In contrast to the functions above, this function performs doesn't +// use the vector data-types. +inline void GlobalToLocalScalarA(const __global real* restrict agms, __local real* alm, + const int a_ld, const int a_offset, const int kwg, + const int a_transpose, const int a_conjugate) { + #if MDIMCD == MDIMAD + const int la0 = get_local_id(0); + const int la1 = get_local_id(1); + #else + const int tid = get_local_id(0) + MDIMCD*get_local_id(1); + const int la0 = tid % MDIMAD; + const int la1 = tid / MDIMAD; + #endif + #pragma unroll + for (int mia=0; mia