예제 #1
0
파일: cmnd.py 프로젝트: leitao/math-atlas
def test(ATLdir, ARCH, pre, blas, N, M, lda, rout, cc=None, ccf=None, opt=""):
    
    l1blas = kernels.GetFKOlevel1Blas()
    l2blas = kernels.GetLevel2Blas()
    l3blas = kernels.GetLevel3Blas()
    #fkogemm = kernels.GetAllFKOGEMM()
   
    if blas in l1blas:
        return l1cmnd.test(ATLdir, ARCH, pre, blas, N, rout, cc, ccf, opt)
    elif blas in l2blas:
        return l2cmnd.test(ATLdir, ARCH, pre, blas, N, M, lda, rout, cc, ccf, opt)
#right now, we support gemm kernel with beta = 1, may change the kernel name
# like: gemmkb1 
    elif blas in l3blas:
        return l3cmnd.test(ATLdir, ARCH, pre, blas, N, 1, rout, cc, ccf, opt)
    elif blas in kernels.GetAllFKOGEMM():
        return l3cmnd.test(ATLdir, ARCH, pre, blas, N, 1, rout, cc, ccf, opt)
    else:
        print "UNKNOWN KERNEL [FOR CMND] !!! "
        return -1
예제 #2
0
def test(ATLdir, ARCH, pre, blas, N, M, lda, rout, cc=None, ccf=None, opt=""):

    l1blas = kernels.GetFKOlevel1Blas()
    l2blas = kernels.GetLevel2Blas()
    l3blas = kernels.GetLevel3Blas()
    #fkogemm = kernels.GetAllFKOGEMM()

    if blas in l1blas:
        return l1cmnd.test(ATLdir, ARCH, pre, blas, N, rout, cc, ccf, opt)
    elif blas in l2blas:
        return l2cmnd.test(ATLdir, ARCH, pre, blas, N, M, lda, rout, cc, ccf,
                           opt)


#right now, we support gemm kernel with beta = 1, may change the kernel name
# like: gemmkb1
    elif blas in l3blas:
        return l3cmnd.test(ATLdir, ARCH, pre, blas, N, 1, rout, cc, ccf, opt)
    elif blas in kernels.GetAllFKOGEMM():
        return l3cmnd.test(ATLdir, ARCH, pre, blas, N, 1, rout, cc, ccf, opt)
    else:
        print "UNKNOWN KERNEL [FOR CMND] !!! "
        return -1
예제 #3
0
pre = sys.argv[1]
blas = sys.argv[2]
file = sys.argv[3]

if nargs > 4:
    NB = int(sys.argv[4])
    if nargs > 5:
        beta = int(sys.argv[5])
        if nargs > 6:
            TEST = sys.argv[6]
            if nargs > 7:
                uopt = sys.argv[7]

# opt = "-X 1 -Y 1 " + uopt
# opt = "-X 1 -Y 1 -Fx 16 -Fy 16 " + uopt
# opt = "-X 1 -Y 1 -Fx 32 -Fy 32 " + uopt
opt = uopt
t0 = -1
mf = -1
if TEST:
    i = l3cmnd.test(ATLdir, ARCH, pre, blas, NB, beta, file, cc=CC, ccf=CCF, opt=opt)
    # i = cmnd.test(ATLdir, ARCH, pre, blas, NB, 0, 0, file, cc=CC, ccf=CCF, opt=teopt)
    if i:
        PF = "FAIL"
    else:
        PF = "PASS"
        [t0, mf] = l3cmnd.time(ATLdir, ARCH, pre, blas, NB, beta, file, cc=CC, ccf=CCF, opt=opt)
else:
    PF = "SKIP"
print "%s%s-%s: time=%e, mflop=%.2f -- %s " % (pre, blas, file, t0, mf, PF)
예제 #4
0
            TEST = sys.argv[6]
            if nargs > 7:
                uopt = sys.argv[7]

#opt = "-X 1 -Y 1 " + uopt
#opt = "-X 1 -Y 1 -Fx 16 -Fy 16 " + uopt
#opt = "-X 1 -Y 1 -Fx 32 -Fy 32 " + uopt
opt = uopt
t0 = -1
mf = -1
if TEST:
    i = l3cmnd.test(ATLdir,
                    ARCH,
                    pre,
                    blas,
                    NB,
                    beta,
                    file,
                    cc=CC,
                    ccf=CCF,
                    opt=opt)
    #i = cmnd.test(ATLdir, ARCH, pre, blas, NB, 0, 0, file, cc=CC, ccf=CCF, opt=teopt)
    if i: PF = "FAIL"
    else:
        PF = "PASS"
        [t0, mf] = l3cmnd.time(ATLdir,
                               ARCH,
                               pre,
                               blas,
                               NB,
                               beta,
                               file,