import math


def cycleEstimate(arr_h=20,
                  arr_w=20,
                  ofmap_h=32,
                  ofmap_w=32,
                  filt_h=3,
                  filt_w=3,
                  num_channels=256,
                  num_filters=256,
                  isDSC=False, num_bases=5):
    """ Estimate relative latency for the given parameters """
    if not isDSC:
        numFeeds = filt_h*filt_w*num_channels
        h_folds = math.ceil(float(ofmap_h * ofmap_w) / arr_h)
        w_folds = math.ceil(float(num_filters) / arr_w)
    else:
        numFeeds = filt_h*filt_w
        h_folds = math.ceil(float(ofmap_h * ofmap_w) / arr_h)
        w_folds = math.ceil(float(num_filters) / num_bases)

    return int(numFeeds * h_folds * w_folds)