Fork me on GitHub

src/arraymancer/tensor/init_opencl

  Source Edit

Procs

proc cpu[T: SomeFloat](t: ClTensor[T]): Tensor[T] {.noinit.}
Convert a tensor on an OpenCL device to a tensor on Cpu.   Source Edit
proc ones_like[T: SomeFloat](t: ClTensor[T]): ClTensor[T] {.noinit, inline.}
Creates a new ClTensor filled with 1 with the same shape as the input and filled with 1 Input:
- A CudaTensor

Result:

- A one-ed ClTensor of the same shape
  Source Edit
proc opencl[T: SomeFloat](t: Tensor[T]): ClTensor[T] {.noinit.}
Convert a tensor on Cpu to a tensor on an OpenCL device.   Source Edit
proc zeros_like[T: SomeFloat](t: ClTensor[T]): ClTensor[T] {.noinit, inline.}
Creates a new ClTensor filled with 0 with the same shape as the input Input:
- Shape of the CudaTensor
- Type of its elements

Result:

- A zero-ed ClTensor of the same shape
  Source Edit
Arraymancer Technical reference Tutorial Spellbook (How-To's) Under the hood