def get1dgridsize(sz, tpb = 1024):
    """Return CUDA grid size for 1d arrays.
    
    :param sz: input array size
    :param tpb: (optional) threads per block
    """
    return (sz + (tpb - 1)) // tpb, tpb