Table of Contents

Delegate TakeKernel

Namespace
NumSharp.Backends.Kernels
Assembly
NumSharp.dll

IL-emitted gather kernel for np.take. The source is treated as a 3-D layout (outerSize, maxItem, innerSize-bytes). For each (outer, j) pair the kernel reads indices[j], applies mode, and copies innerSize bytes from the source slab to the destination position.

public delegate long TakeKernel(byte* src, long* indices, long indicesCount, long outerSize, long maxItem, long innerSize, int mode, byte* dst)

Parameters

src byte*
IL-emitted gather kernel for np.take. The source is treated as a 3-D layout (outerSize, maxItem, innerSize-bytes). For each (outer, j) pair the kernel reads indices[j], applies mode, and copies innerSize bytes from the source slab to the destination position.
indices long*
IL-emitted gather kernel for np.take. The source is treated as a 3-D layout (outerSize, maxItem, innerSize-bytes). For each (outer, j) pair the kernel reads indices[j], applies mode, and copies innerSize bytes from the source slab to the destination position.
indicesCount long
IL-emitted gather kernel for np.take. The source is treated as a 3-D layout (outerSize, maxItem, innerSize-bytes). For each (outer, j) pair the kernel reads indices[j], applies mode, and copies innerSize bytes from the source slab to the destination position.
outerSize long
IL-emitted gather kernel for np.take. The source is treated as a 3-D layout (outerSize, maxItem, innerSize-bytes). For each (outer, j) pair the kernel reads indices[j], applies mode, and copies innerSize bytes from the source slab to the destination position.
maxItem long
IL-emitted gather kernel for np.take. The source is treated as a 3-D layout (outerSize, maxItem, innerSize-bytes). For each (outer, j) pair the kernel reads indices[j], applies mode, and copies innerSize bytes from the source slab to the destination position.
innerSize long
IL-emitted gather kernel for np.take. The source is treated as a 3-D layout (outerSize, maxItem, innerSize-bytes). For each (outer, j) pair the kernel reads indices[j], applies mode, and copies innerSize bytes from the source slab to the destination position.
mode int
IL-emitted gather kernel for np.take. The source is treated as a 3-D layout (outerSize, maxItem, innerSize-bytes). For each (outer, j) pair the kernel reads indices[j], applies mode, and copies innerSize bytes from the source slab to the destination position.
dst byte*
IL-emitted gather kernel for np.take. The source is treated as a 3-D layout (outerSize, maxItem, innerSize-bytes). For each (outer, j) pair the kernel reads indices[j], applies mode, and copies innerSize bytes from the source slab to the destination position.

Returns

long

outerSize * indicesCount on success. On RAISE OOB the returned value is the row-major index of the first failing (outer, j) pair.

Extension Methods