adding implicit gemm v3

This commit is contained in:
Chao Liu
2019-05-15 09:58:17 -05:00
parent 4957d5a399
commit b7d052459d
29 changed files with 977 additions and 296 deletions

View File

@@ -1,4 +1,19 @@
#pragma once
#include "common.hip.hpp"
#include "ConstantMatrixDescriptor.hip.hpp"
template <class Float, class Matrix>
__device__ void threadwise_matrix_set_zero(Matrix, Float* __restrict__ p_thread)
{
for(index_t i = 0; i < Matrix::NRow(); ++i)
{
for(index_t j = 0; j < Matrix::NCol(); ++j)
{
const index_t id = Matrix::Get1dIndex(i, j);
p_thread[id] = 0;
}
}
}
template <class Float,
class SrcMatrix,
@@ -64,9 +79,9 @@ __device__ void threadwise_gemm(MatrixA,
for(index_t k = 0; k < K; ++k)
{
for(index_t i = 0; i < M; i++)
for(index_t i = 0; i < M; ++i)
{
for(index_t j = 0; j < N; j++)
for(index_t j = 0; j < N; ++j)
{
const index_t aindex = a_mtx.Get1dIndex(k, i); // A is transposed
const index_t bindex = b_mtx.Get1dIndex(k, j);