summaryrefslogtreecommitdiff
path: root/gpu.py
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-09-12 16:41:17 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-09-12 16:41:17 -0400
commit6f0703602270d03f4025221f13fee21aa842a863 (patch)
tree2d227fbc236e647e3d6c96113f1d6b93a4113793 /gpu.py
parent4b5d9c633bd01ce8b2819d92eaf3e01d881fb996 (diff)
downloadchroma-6f0703602270d03f4025221f13fee21aa842a863.tar.gz
chroma-6f0703602270d03f4025221f13fee21aa842a863.tar.bz2
chroma-6f0703602270d03f4025221f13fee21aa842a863.zip
add chroma-sim script. get rid of GPU class; contexts should now be created with create_cuda_context().
Diffstat (limited to 'gpu.py')
-rw-r--r--gpu.py25
1 files changed, 0 insertions, 25 deletions
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()