Where a batch runs and when its output is ready#
A batch’s array types and submission method determine where its coordinates are transformed and when a consumer can read or reuse the storage. Consider a transformation from EPSG:4326 to EPSG:32631 with these fixed input values.
x = np.array([3, 4], dtype=np.int16)
y = np.array([0.0, 1.0], dtype=np.float32)
Where the same x and y run#
The table follows the same coordinate values as their array types or submission method change. For the CuPy row, both columns contain the same values as the NumPy arrays above.
Call |
Input columns |
Execution location |
Return value |
|---|---|---|---|
|
NumPy |
Host, even in a CUDA-capable build |
NumPy arrays |
|
CuPy |
CUDA |
CuPy arrays |
|
NumPy |
Inputs are staged on the selected CUDA stream, and the call waits for completion |
CuPy arrays |
If only x in the first row changes to a CuPy array while y remains a NumPy array, transform(x, y) raises TypeError: both input columns must have matching array types.
When the consumer can read the coordinates#
With the same NumPy inputs, Python’s enqueue_device() returns an execution handle. The adapter may stage coordinates, pack validity, or allocate outputs or workspace. It can reuse a prepared route with workspace sized for a batch capacity.
The consumer can check the handle with query(). The first query may already report completion. If work is pending, a successful wait() establishes readiness for a dependent read. Check CudaExecution.failures separately from the output coordinates for per-point failures. To order the transform relative to work on another stream, see Overlap transforms with other CUDA work.
When the caller can reclaim storage#
At the C interface, the caller prepares the plan, supplies sized workspace, and binds device buffers before submission. Preparation with a DeviceResource waits on its stream. Native enqueue itself allocates nothing and transfers no coordinates.
Keep borrowed resources live through successful release, including when a failed enqueue returns a non-NULL cleanup handle. Python execution objects retain their owners until native release succeeds. A failed close may need a retry. Completion permits a dependent read. Successful release ends the execution’s claim on the buffers and workspace. For lifecycle calls, workspace sizing, and capture restrictions, see Native API and device interchange.