Skip to content

Commit

Permalink
ENH: Updated cl.Context init arguement device_type= to allow a string.
Browse files Browse the repository at this point in the history
  • Loading branch information
srossross committed Jan 10, 2012
1 parent 036f009 commit 90f3ddf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion opencl/copencl.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 90f3ddf

Please sign in to comment.