[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drop in sgemm



Greetings!  The last stuff I released to Clint can still be found at

http://master.debian.org/~camm/nblas.tar.gz

These unpack into the new beta atlas developer's version at Clint's
site just fine.  There are a few minor edits to my routines, though,
which are needed for the latest gcc.  I described these earlier on the
list.  Briefly, one needs to replace the 'static __inline__ void' with
simply 'void' in dpa.h, ga.h, and maa.h, and to replace the
ATL_sger_nx32.c file in include with the almost identical one below.

I hope to be making a new tarball soon once the double precision stuff
is finished.

Take care,

=============================================================================
ATL_sger_nx32.c
=============================================================================

#include <stdio.h>
#include <stdlib.h>

#define Mjoin(a,b) mjoin(a,b)
#define mjoin(a,b) a ## b

#define EXT5 5g
#define EXT4 4g
#define EXT3 3g
#define EXT2 2g
#define EXT1 1g


#define NDP 5
#define EXT EXT5
#include "ga.h"
#undef NDP
#define NDP 4
#undef EXT
#define EXT EXT4
#include "ga.h"
#undef NDP
#define NDP 3
#undef EXT
#define EXT EXT3
#include "ga.h"
#undef NDP
#define NDP 2
#undef EXT
#define EXT EXT2
#include "ga.h"
#undef NDP
#define NDP 1
#undef EXT
#define EXT EXT1
#include "ga.h"
#undef NDP

#define NDP NDPM
#undef EXT
#define EXT Mjoin(Mjoin(NDP,g),m)
#include "ga.h"


void 
ATL_sger1_a1_x1_yX(int m,int n,float alpha,const float *c,int cinc,
		   const float *b,int binc,float *a,int lda) {


  int i,mm,nn;
  const float *ae;


  ae=a+n*lda;
  nn=STRIDE*lda;

#if NDPM == 1
  for (;a<ae;a+=lda,b+=binc)
    Mjoin(g,EXT)(b,STRIDE,a,nn,c,m);
#else

  while (a+NDPM*nn<=ae) {
    for (i=0;i<STRIDE;i++,a+=lda,b+=binc) 
      Mjoin(g,EXT)(b,STRIDE*binc,a,nn,c,m);

    a+=(NDPM-1)*nn;
    b+=(NDPM-1)*STRIDE*binc;
  }

  for (i=0;a<ae && i<STRIDE;i++,a+=lda,b+=binc) {

    mm=(ae-a)/nn;
    if (((ae-a)/lda)%STRIDE)
      mm++;
    
    if (mm == 1)
      Mjoin(g,EXT1)(b,STRIDE,a,nn,c,m);

    else if (mm == 2)
      Mjoin(g,EXT2)(b,STRIDE,a,nn,c,m);

    else if (mm == 3)
      Mjoin(g,EXT3)(b,STRIDE,a,nn,c,m);

    else if (mm == 4)
      Mjoin(g,EXT4)(b,STRIDE,a,nn,c,m);

    else if (mm == 5)
      Mjoin(g,EXT5)(b,STRIDE,a,nn,c,m);

  }

#endif

}

=============================================================================


Doug ABERDEEN <daa@discus.anu.edu.au> writes:

> Hi guys, 
> 
> Some time ago there was a discussion of drop in gemv/ger. Camm was
> working on SSI GEMV/GER, and atlas_goto.tgz was an example of a drop
> in gemm. A new developer release with this stuff was on the way?
> 
> I haven't heard anything for a while. I've got time now to
> incorporate my SSE SGEMM into ATLAS. Of course I'd like to do this 
> on a bugfixed dist with a couple of examples to work from. Is there any
> chance of getting a copy of a release with the SSE GEMV/GER stuff in
> it and the fixes that Clint and Camm described on this list?
> 
> Otherwise I'll work with the goto version.
> 
> -- 
> -Doug  -- http://beaker.anu.edu.au, Ph:(02) 6279-8608, Fax:(02) 6279-8651
> 
> 

-- 
Camm Maguire			     			camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah