fromGpu (Function)

Signature: fromGpu(buffer: GpuBuffer<int> | GpuBuffer<float> | GpuBuffer<bool>) -> List<t0>

Description: Materializes a GpuBuffer back into a host list, keeping the element type: a float buffer becomes a List.

Parameters

  • buffer (GpuBuffer | GpuBuffer | GpuBuffer): The buffer to copy back to a list

Returns: List

Example

fromGpu(toGpu([1, 2])) |> forEachList(print)  // Prints: 1, 2
fromGpu (toGpu [1, 2]) |> forEachList print  // Prints: 1, 2