Simple linear model
This commit is contained in:
@@ -122,17 +122,17 @@ def benchmark(template, statement, device):
|
||||
if occupancy_record.occupancy < 15 :
|
||||
raise ValueError("Template has too low occupancy")
|
||||
else:
|
||||
try:
|
||||
template.execute(statement, True)
|
||||
#~ try:
|
||||
template.execute(statement, True)
|
||||
statement.result.context.finish_all_queues()
|
||||
N = 0
|
||||
current_time = 0
|
||||
while current_time < 1e-2:
|
||||
time_before = time.time()
|
||||
template.execute(statement,False)
|
||||
statement.result.context.finish_all_queues()
|
||||
N = 0
|
||||
current_time = 0
|
||||
while current_time < 1e-2:
|
||||
time_before = time.time()
|
||||
template.execute(statement,False)
|
||||
statement.result.context.finish_all_queues()
|
||||
current_time += time.time() - time_before
|
||||
N+=1
|
||||
return current_time/N
|
||||
except:
|
||||
raise ValueError("Invalid template")
|
||||
current_time += time.time() - time_before
|
||||
N+=1
|
||||
return current_time/N
|
||||
#~ except:
|
||||
#~ raise ValueError("Invalid template")
|
||||
|
Reference in New Issue
Block a user