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