Permalink
Browse files

ENH: Updated cl.Context init arguement device_type= to allow a string.

  • Loading branch information...
1 parent 036f009 commit 90f3ddf142ce695861e1f9d022ce42374a90f2fd srossross committed Jan 10, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 opencl/copencl.pyx
View
@@ -177,11 +177,20 @@ cdef class Device:
processors such as DSPs and the Cell/B.E. processor.
'''
- DEFAULT = CL_DEVICE_TYPE_DEFAULT
+ ACCELERATOR = CL_DEVICE_TYPE_ACCELERATOR
ALL = CL_DEVICE_TYPE_ALL
CPU = CL_DEVICE_TYPE_CPU
+ DEFAULT = CL_DEVICE_TYPE_DEFAULT
GPU = CL_DEVICE_TYPE_GPU
+ DEV_TYPE_MAP = {
+ 'ACCELERATOR' : CL_DEVICE_TYPE_ACCELERATOR,
+ 'ALL' : CL_DEVICE_TYPE_ALL,
+ 'CPU' : CL_DEVICE_TYPE_CPU,
+ 'DEFAULT' : CL_DEVICE_TYPE_DEFAULT,
+ 'GPU' : CL_DEVICE_TYPE_GPU,
+ }
+
cdef cl_device_id device_id
def __cinit__(self):

0 comments on commit 90f3ddf

Please sign in to comment.