1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
<doc 17
     18
     19

     20
     21
     22
     23
     24
     25
     26
<doc 27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40

     41
     42
     43
     44
     45
<doc 46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57

     58
     59
     60
     61
<doc 62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73

     74
     75
     76
     77
     78
     79
#ifndef ULMBLAS_IMPL_LEVEL3_UKERNEL_UGEMM_H
#define ULMBLAS_IMPL_LEVEL3_UKERNEL_UGEMM_H 1

//
//  Selected optimized micro kernel
//
#if defined(USE_SSE)
#   define  SELECT_UGEMM_KERNEL     sse
#   include <ulmblas/impl/level3/ukernel/sse/ugemm.h>
#else
#   define  SELECT_UGEMM_KERNEL     ref
#   include <ulmblas/impl/level3/ukernel/ref/ugemm.h>
#endif

namespace ulmBLAS {

template <typename T>
struct BlockSizeUGemm
{
    static const int MR = SELECT_UGEMM_KERNEL::BlockSizeUGemm<T>::MR;
    static const int NR = SELECT_UGEMM_KERNEL::BlockSizeUGemm<T>::NR;
};

//
//  Buffered variant.  Used for zero padded panels.
//
template <typename IndexType, typename T, typename Beta, typename TC>
    void
    ugemm(IndexType    mr,
          IndexType    nr,
          IndexType    kc,
          const T      &alpha,
          const T      *A,
          const T      *B,
          const Beta   &beta,
          TC           *C,
          IndexType    incRowC,
          IndexType    incColC,
          const T      *nextA,
          const T      *nextB);

//
//  Buffered variant.  Used if the result alpha*A*B needs to be upcasted for
//  computing C <- beta*C + (alpha*A*B)
//
template <typename IndexType, typename T, typename Beta, typename TC>
    void
    ugemm(IndexType   kc,
          const T     &alpha,
          const T     *A,
          const T     *B,
          const Beta  &beta,
          TC          *C,
          IndexType   incRowC,
          IndexType   incColC,
          const T     *nextA,
          const T     *nextB);

//
//  Unbuffered variant.
//
template <typename IndexType, typename T>
    void
    ugemm(IndexType   kc,
          const T     &alpha,
          const T     *A,
          const T     *B,
          const T     &beta,
          T           *C,
          IndexType   incRowC,
          IndexType   incColC,
          const T     *nextA,
          const T     *nextB);

// namespace ulmBLAS

#endif // ULMBLAS_IMPL_LEVEL3_UKERNEL_UGEMM_H

#include <ulmblas/impl/level3/ukernel/ugemm.tcc>