Fixed indentation
This commit is contained in:
@@ -182,5 +182,3 @@ class GeneticOperators(object):
|
||||
sys.stdout.flush()
|
||||
sys.stdout.write('\n')
|
||||
return population
|
||||
|
||||
|
||||
|
@@ -60,23 +60,21 @@ class PhysicalLimits:
|
||||
else:
|
||||
raise Exception('Compute capability not supported!')
|
||||
|
||||
class OccupancyRecord:
|
||||
|
||||
def _int_floor(value, multiple_of=1):
|
||||
"""Round C{value} down to be a C{multiple_of} something."""
|
||||
# Mimicks the Excel "floor" function (for code stolen from occupancy calculator)
|
||||
|
||||
from math import floor
|
||||
return int(floor(value/multiple_of))*multiple_of
|
||||
|
||||
def _int_ceiling(value, multiple_of=1):
|
||||
"""Round C{value} up to be a C{multiple_of} something."""
|
||||
# Mimicks the Excel "floor" function (for code stolen from occupancy calculator)
|
||||
|
||||
from math import ceil
|
||||
return int(ceil(value/multiple_of))*multiple_of
|
||||
|
||||
class OccupancyRecord:
|
||||
|
||||
def __init__(self, dev, threads, shared_mem=0, registers=0):
|
||||
def init_nvidia(self, dev, threads, shared_mem, registers):
|
||||
physical_limits = PhysicalLimits(dev)
|
||||
limits = [];
|
||||
allocated_warps = max(1,_int_ceiling(threads/physical_limits.threads_per_warp))
|
||||
@@ -102,6 +100,10 @@ class OccupancyRecord:
|
||||
self.warps_per_mp = self.limit*allocated_warps
|
||||
self.occupancy = 100*self.warps_per_mp/physical_limits.warps_per_mp
|
||||
|
||||
def __init__(self, dev, threads, shared_mem=0, registers=0):
|
||||
self.init_nvidia(self, dev, threads, shared_mem, registers)
|
||||
|
||||
|
||||
|
||||
def skip(template, statement, device):
|
||||
statements = StatementsTuple(statement)
|
||||
|
Reference in New Issue
Block a user