EXLA.DeviceBuffer (EXLA v0.12.0)

Copy Markdown View Source

An EXLA DeviceBuffer for data allocated in the device.

Summary

Functions

Copies buffer to device with given device ID.

Deallocates the underlying buffer.

Places the given binary data on the given device using client.

Reads size from the underlying buffer ref.

Functions

copy_to_device(device_buffer, client, device_id)

Copies buffer to device with given device ID.

deallocate(device_buffer)

Deallocates the underlying buffer.

Returns :ok | :already_deallocated.

place_on_device(data, typespec, client, device_id)

Places the given binary data on the given device using client.

read(device_buffer, size \\ -1)

Reads size from the underlying buffer ref.

This copies the underlying device memory into a binary without destroying it. If size is negative, then it reads the whole buffer.