3.5. Supported Python features in CUDA Python¶
This page lists the Python features supported in the CUDA Python. This includes all kernel and device functions compiled with @cuda.jit and other higher level Numba decorators that targets the CUDA GPU.
126.96.36.199. Execution Model¶
CUDA Python maps directly to the single-instruction multiple-thread execution (SIMT) model of CUDA. Each instruction is implicitly executed by multiple threads in parallel. With this execution model, array expressions are less useful because we don’t want multiple threads to perform the same task. Instead, we want threads to perform a task in a cooperative fashion.
For details please consult the CUDA Programming Guide.
The following Python constructs are not supported:
- Exception handling (try .. except, try .. finally)
- Context management (the with statement)
- Comprehensions (either list, dict, set or generator comprehensions)
- Generator (any yield statements)
The raise and assert statements are supported. See nopython language support.
3.5.2. Built-in types¶
The following built-in types support are inherited from CPU nopython mode.
3.5.3. Built-in functions¶
The following built-in functions are supported:
3.5.4. Standard library modules¶
The following functions from the cmath module are supported:
The following functions from the math module are supported:
- math.expm1() not available in Python 2.6
The following functions from the operator module are supported:
- operator.div() (Python 2 only)
- operator.idiv() (Python 2 only)