条数不同,加速比差多少
运行下面这段程序,填写它打印出来的结果。
STAGES = 5
def one_by_one(n):
return n * STAGES
def pipelined(n):
return n + STAGES - 1
for n in (1, 3, 10, 100):
print(str(round(one_by_one(n) / pipelined(n), 2)), end="/")
运行下面这段程序,填写它打印出来的结果。
STAGES = 5
def one_by_one(n):
return n * STAGES
def pipelined(n):
return n + STAGES - 1
for n in (1, 3, 10, 100):
print(str(round(one_by_one(n) / pipelined(n), 2)), end="/")
全部评论