/* ************************************************************************ * * MIT License * * Copyright (C) 2024-2025 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * ************************************************************************ */ #include "matrix_transform.h" #include #include #include #include namespace amd_detail { template struct VectorIOType { using vtype = void; constexpr static size_t vw{VectorWidth}; }; template <> struct VectorIOType { using vtype = char4; }; template <> struct VectorIOType { using vtype = int4; }; template <> struct VectorIOType { using vtype = float4; }; template __device__ uint32_t getOffset(uint32_t row, uint32_t col, uint32_t ld) { if constexpr(RowMaj) { return ld * row + col; } else { return ld * col + row; } } template __device__ uint32_t getThreadLocalRowIdx(uint32_t tId) { constexpr auto numComponentsM = RowMaj ? TileM : TileM / VectorWidth + !!(TileM % VectorWidth); constexpr auto v = RowMaj ? 1 : VectorWidth; return (tId % numComponentsM) * v; } template __device__ uint32_t getThreadLocalColIdx(uint32_t tId) { constexpr auto numComponentsM = RowMaj ? TileM : TileM / VectorWidth + !!(TileM % VectorWidth); constexpr auto v = RowMaj ? VectorWidth : 1; return (tId / numComponentsM) * v; } template uint32_t getLeadingDimSize(uint32_t numRows, uint32_t numCols) { return RowMaj ? numCols : numRows; } template __device__ void transform(DType* c, const DType* a, const DType* b, ScaleType alpha, const ScaleType* alphaPtr, ScaleType beta, const ScaleType* betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { constexpr auto TileM = RowMajC ? NumThreadsM : NumThreadsM * VectorWidth; constexpr auto TileN = RowMajC ? NumThreadsN * VectorWidth : NumThreadsN; const auto tId = threadIdx.x; const auto bId = blockIdx.x; const auto numThreadsPerBlock = blockDim.x; assert(TileM * TileN == numThreadsPerBlock * VectorWidth); const auto numTilesM = numRows / TileM + !!(numRows % TileM); const auto batchIdx = blockIdx.z; const auto blockRow = (bId % numTilesM) * TileM; const auto blockCol = (bId / numTilesM) * TileN; const auto tRow = getThreadLocalRowIdx(tId); const auto tCol = getThreadLocalColIdx(tId); const auto row = blockRow + tRow; const auto col = blockCol + tCol; if(alphaPtr) { alpha = *alphaPtr; } if(betaPtr) { beta = *betaPtr; } const auto batchOffset = batchIdx * batchStride; if constexpr(VectorWidth == 1) { if(row < numRows && col < numCols) { const auto offsetA = (transA ? getOffset(col, row, ldA) : getOffset(row, col, ldA)) + batchOffset; const auto offsetB = (transB ? getOffset(col, row, ldB) : getOffset(row, col, ldB)) + batchOffset; const ScaleType aData = a ? static_cast(a[offsetA]) : 0; const ScaleType bData = b ? static_cast(b[offsetB]) : 0; const DType cData = static_cast(aData * alpha + bData * beta); const auto offsetC = getOffset(tRow + blockRow, tCol + blockCol, ldC) + batchOffset; c[offsetC] = cData; } } else { const auto vectorWriteDirSize = RowMajC ? numCols : numRows; const auto blockVectorWriteEndBound = RowMajC ? (col + VectorWidth) : (row + VectorWidth); const auto vectorShift = blockVectorWriteEndBound > vectorWriteDirSize ? (blockVectorWriteEndBound - vectorWriteDirSize) : 0; ScaleType aData[VectorWidth] = {}; ScaleType bData[VectorWidth] = {}; if constexpr(RowMajC) { if(row >= numRows) { return; } } if constexpr(!RowMajC) { if(col >= numCols) { return; } } #pragma unroll for(uint32_t i = 0; i < VectorWidth; ++i) { uint32_t offsetA, offsetB; if constexpr(RowMajC) { offsetA = (transA ? getOffset(col + i - vectorShift, row, ldA) : getOffset(row, col + i - vectorShift, ldA)) + batchOffset; offsetB = (transB ? getOffset(col + i - vectorShift, row, ldB) : getOffset(row, col + i - vectorShift, ldB)) + batchOffset; } else { offsetA = (transA ? getOffset(col, row + i - vectorShift, ldA) : getOffset(row + i - vectorShift, col, ldA)) + batchOffset; offsetB = (transB ? getOffset(col, row + i - vectorShift, ldB) : getOffset(row + i - vectorShift, col, ldB)) + batchOffset; } aData[i] = a ? static_cast(a[offsetA]) : 0; bData[i] = b ? static_cast(b[offsetB]) : 0; } // only begin index is required, since vector write always along with // continuous direction uint32_t cOffset{}; if constexpr(RowMajC) { cOffset = getOffset(tRow + blockRow, tCol + blockCol - vectorShift, ldC) + batchOffset; } else { cOffset = getOffset(tRow + blockRow - vectorShift, tCol + blockCol, ldC) + batchOffset; } using VectorType = typename VectorIOType::vtype; if constexpr(std::is_same::value) { DType cData[VectorWidth]; #pragma unroll for(uint32_t i = 0; i < VectorWidth; ++i) { cData[i] = static_cast(alpha * aData[i] + beta * bData[i]); } if(!vectorShift) { #pragma unroll for(uint32_t i = 0; i < VectorWidth; ++i) { c[cOffset + i] = cData[i]; } } else { for(uint32_t i = vectorShift; i < VectorWidth; ++i) { c[cOffset + i] = cData[i]; } } } else { VectorType cData; #pragma unroll for(uint32_t i = 0; i < VectorWidth; ++i) { HIPBLASLT_HIPVEC_ACCESS(cData) [i] = static_cast(alpha * aData[i] + beta * bData[i]); } if(!vectorShift) { #pragma unroll for(uint32_t i = 0; i < VectorWidth; ++i) { c[cOffset + i] = HIPBLASLT_HIPVEC_ACCESS(cData)[i]; } } else { for(uint32_t i = vectorShift; i < VectorWidth; ++i) { c[cOffset + i] = HIPBLASLT_HIPVEC_ACCESS(cData)[i]; } } } } } } // namespace amd_detail extern "C" { __global__ void TRANSFORM_FUNC_NAME(S, S, 1, 1, 1, 16, 16, 1)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 1, 1, 1, 16, 16, 4)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 1, 1, 0, 16, 16, 1)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 1, 1, 0, 16, 16, 4)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 1, 0, 1, 16, 16, 1)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 1, 0, 1, 16, 16, 4)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 1, 0, 0, 16, 16, 1)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 1, 0, 0, 16, 16, 4)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 0, 1, 1, 16, 16, 1)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 0, 1, 1, 16, 16, 4)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 0, 1, 0, 16, 16, 1)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 0, 1, 0, 16, 16, 4)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 0, 0, 1, 16, 16, 1)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 0, 0, 1, 16, 16, 4)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 0, 0, 0, 16, 16, 1)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(S, S, 0, 0, 0, 16, 16, 4)(DTYPE(S) * c, const DTYPE(S) * a, const DTYPE(S) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 1, 1, 1, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 1, 1, 1, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 1, 1, 0, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 1, 1, 0, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 1, 0, 1, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 1, 0, 1, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 1, 0, 0, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 1, 0, 0, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 0, 1, 1, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 0, 1, 1, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 0, 1, 0, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 0, 1, 0, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 0, 0, 1, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 0, 0, 1, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 0, 0, 0, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, H, 0, 0, 0, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(H) alpha, const DTYPE(H) * alphaPtr, DTYPE(H) beta, const DTYPE(H) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 1, 1, 1, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 1, 1, 1, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 1, 1, 0, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 1, 1, 0, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 1, 0, 1, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 1, 0, 1, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 1, 0, 0, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 1, 0, 0, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 0, 1, 1, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 0, 1, 1, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 0, 1, 0, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 0, 1, 0, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 0, 0, 1, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 0, 0, 1, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 0, 0, 0, 16, 16, 1)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(H, S, 0, 0, 0, 16, 16, 4)(DTYPE(H) * c, const DTYPE(H) * a, const DTYPE(H) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 1, 1, 1, 16, 16, 1)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 1, 1, 1, 16, 16, 4)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 1, 1, 0, 16, 16, 1)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 1, 1, 0, 16, 16, 4)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 1, 0, 1, 16, 16, 1)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 1, 0, 1, 16, 16, 4)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 1, 0, 0, 16, 16, 1)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 1, 0, 0, 16, 16, 4)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 0, 1, 1, 16, 16, 1)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 0, 1, 1, 16, 16, 4)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 0, 1, 0, 16, 16, 1)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 0, 1, 0, 16, 16, 4)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 0, 0, 1, 16, 16, 1)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 0, 0, 1, 16, 16, 4)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 0, 0, 0, 16, 16, 1)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(BF16, S, 0, 0, 0, 16, 16, 4)(DTYPE(BF16) * c, const DTYPE(BF16) * a, const DTYPE(BF16) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 1, 1, 1, 16, 16, 1)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 1, 1, 1, 16, 16, 4)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 1, 1, 0, 16, 16, 1)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 1, 1, 0, 16, 16, 4)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 1, 0, 1, 16, 16, 1)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 1, 0, 1, 16, 16, 4)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 1, 0, 0, 16, 16, 1)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 1, 0, 0, 16, 16, 4)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 0, 1, 1, 16, 16, 1)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 0, 1, 1, 16, 16, 4)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 0, 1, 0, 16, 16, 1)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 0, 1, 0, 16, 16, 4)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 0, 0, 1, 16, 16, 1)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 0, 0, 1, 16, 16, 4)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 0, 0, 0, 16, 16, 1)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I8, S, 0, 0, 0, 16, 16, 4)(DTYPE(I8) * c, const DTYPE(I8) * a, const DTYPE(I8) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 1, 1, 1, 16, 16, 1)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 1, 1, 1, 16, 16, 4)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 1, 1, 0, 16, 16, 1)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 1, 1, 0, 16, 16, 4)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 1, 0, 1, 16, 16, 1)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 1, 0, 1, 16, 16, 4)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 1, 0, 0, 16, 16, 1)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 1, 0, 0, 16, 16, 4)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 0, 1, 1, 16, 16, 1)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 0, 1, 1, 16, 16, 4)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 0, 1, 0, 16, 16, 1)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 0, 1, 0, 16, 16, 4)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 0, 0, 1, 16, 16, 1)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 0, 0, 1, 16, 16, 4)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 0, 0, 0, 16, 16, 1)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } __global__ void TRANSFORM_FUNC_NAME(I32, S, 0, 0, 0, 16, 16, 4)(DTYPE(I32) * c, const DTYPE(I32) * a, const DTYPE(I32) * b, DTYPE(S) alpha, const DTYPE(S) * alphaPtr, DTYPE(S) beta, const DTYPE(S) * betaPtr, uint32_t numRows, uint32_t numCols, uint32_t ldA, uint32_t ldB, uint32_t ldC, uint32_t batchStride, bool transA, bool transB) { amd_detail::transform(c, a, b, alpha, alphaPtr, beta, betaPtr, numRows, numCols, ldA, ldB, ldC, batchStride, transA, transB); } }