From 6f0703602270d03f4025221f13fee21aa842a863 Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Mon, 12 Sep 2011 16:41:17 -0400 Subject: add chroma-sim script. get rid of GPU class; contexts should now be created with create_cuda_context(). --- gpu.py | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'gpu.py') diff --git a/gpu.py b/gpu.py index b98d42b..4e2ecf3 100644 --- a/gpu.py +++ b/gpu.py @@ -797,28 +797,3 @@ def create_cuda_context(device_id=None): context.set_cache_config(cuda.func_cache.PREFER_L1) return context - -class GPU(object): - def __init__(self, device_id=None): - """Initialize a GPU context on the specified device. - If device_id is None, the default device is used.""" - - if device_id is None: - self.context = pycuda.tools.make_default_context() - else: - device = cuda.Device(device_id) - self.context = device.make_context() - - print 'device %s' % self.context.get_device().name() - - self.print_mem_info() - - self.context.set_cache_config(cuda.func_cache.PREFER_L1) - - def print_mem_info(self): - free, total = cuda.mem_get_info() - - print '%.1f %% of device memory is free.' % ((free/float(total))*100) - - def __del__(self): - self.context.pop() -- cgit