Example #1
0
 def wrapConvNdbenchmark(datashape, Wshape, stride, pad, dilation, groups,
                         transpose):
     assert dilation == (1, 1) and groups == 1
     return MIOpen.conv2dbenchmark(datashape,
                                   Wshape,
                                   stride,
                                   pad,
                                   mode=MIOpen.ConvMode.transpose
                                   if transpose else MIOpen.ConvMode.conv)
Example #2
0
def timeConv(datashape, Wshape, stride, pad):
    fwdResults, bwdFilterResults, bwdDataResults = MIOpen.conv2dbenchmark(
        datashape, Wshape, stride, pad)

    formatstr = "%-40s %-25s %-28s"

    print("Forward results:")
    for res in fwdResults:
        print(formatstr % ("Algo %s" % MIOpen.ConvFwdAlgo(res.algo),
                           "time %.6f secs" % res.time, "memory %.6f mbytes" %
                           (res.memory / 1024**2)))

    print("\nBackward filter results:")
    for res in bwdFilterResults:
        print(formatstr % ("Algo %s" % MIOpen.ConvBwdFilterAlgo(res.algo),
                           "time %.6f secs" % res.time, "memory %.6f mbytes" %
                           (res.memory / 1024**2)))

    print("\nBackward data results:")
    for res in bwdDataResults:
        print(formatstr % ("Algo %s" % MIOpen.ConvBwdDataAlgo(res.algo),
                           "time %.6f secs" % res.time, "memory %.6f mbytes" %
                           (res.memory / 1024**2)))