GPUData

GPU data is the base class for any data that needs to co-exist on both CPU and GPU memory. It keeps track of the smallest contiguous area that needs to be uploaded to GPU to keep the CPU and GPU data synced. This allows to update the data in one operation. Even though this might be sub-optimal in a few cases, it provides a greater usage flexibility and most of the time, it will be faster.

This is done transparently and user can use a GPU buffer as a regular numpy array. The pending_data property indicates the region (offset/nbytes) of the base array that needs to be uploaded.

Example:

data = np.zeros((5,5)).view(GPUData)
print data.pending_data
(0, 200)
class glumpy.gloo.GPUData(*args, **kwargs)

Bases: numpy.ndarray

Memory tracked numpy array.

offset

Byte offset in the base array.

pending_data

Pending data region as (byte offset, byte size)

stride

Item stride in the base array.