()
Run the benchmarks.
Run the benchmarks.
Run the benchmarks .
def main():
    """Run the benchmarks."""
    print_version()

    types = [
        "float64", "float64", "float64",
        "float32", "float32", "float32",
        "int32", "int32", "int32",
        "uint8", "uint8", "uint8",
        "complex64", "complex64", "complex64",
        "complex128", "complex128", "complex128"
    ]

    for j in range(0, len(types)//3):
        dtype1 = types[j*3]
        dtype2 = types[(j*3)+1]
        dtype3 = types[(j*3)+2]

        iters = ITERATIONS
        p = MIN
        while p <= MAX:
            n = 10**p
            p += 1
            name = ":len="+str(n)+",xtype="+dtype1+",ytype="+dtype2+",ztype="+dtype3
            setup = "import numpy as np;"
            setup += "x = np.ones([1,"+str(n)+"], dtype='"+dtype1+"');"
            setup += "y = np.ones([1,"+str(n)+"], dtype='"+dtype2+"');"
            setup += "out = np.zeros([1,"+str(n)+"], dtype='"+dtype3+"');"
            stmt = "z = np.add(x, y, out=out)"
            benchmark(name, setup, stmt, iters)
            iters //= 4

    print_summary(COUNT[0], COUNT[0])
def main ( ) : print_version ( ) types = [ "float64" , "float64" , "float64" , "float32" , "float32" , "float32" , "int32" , "int32" , "int32" , "uint8" , "uint8" , "uint8" , "complex64" , "complex64" , "complex64" , "complex128" , "complex128" , "complex128" ] for j in range ( 0 , len ( types ) // 3 ) : dtype1 = types [ j * 3 ] dtype2 = types [ ( j * 3 ) + 1 ] dtype3 = types [ ( j * 3 ) + 2 ] iters = ITERATIONS p = MIN while p <= MAX : n = 10 ** p p += 1 name = ":len=" + str ( n ) + ",xtype=" + dtype1 + ",ytype=" + dtype2 + ",ztype=" + dtype3 setup = "import numpy as np;" setup += "x = np.ones([1," + str ( n ) + "], dtype='" + dtype1 + "');" setup += "y = np.ones([1," + str ( n ) + "], dtype='" + dtype2 + "');" setup += "out = np.zeros([1," + str ( n ) + "], dtype='" + dtype3 + "');" stmt = "z = np.add(x, y, out=out)" benchmark ( name , setup , stmt , iters ) iters //= 4 print_summary ( COUNT [ 0 ] , COUNT [ 0 ] )