Package org.bytedeco.javacpp.indexer
Class Bfloat16Indexer
- java.lang.Object
-
- org.bytedeco.javacpp.indexer.Indexer
-
- org.bytedeco.javacpp.indexer.Bfloat16Indexer
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Direct Known Subclasses:
Bfloat16ArrayIndexer,Bfloat16BufferIndexer,Bfloat16RawIndexer
public abstract class Bfloat16Indexer extends Indexer
Abstract indexer for theshortprimitive type, treated as bfloat16.- See Also:
- BFLOAT16 – Hardware Numerics Definition
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBfloat16Indexer(long[] sizes, long[] strides)protectedBfloat16Indexer(Index index)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Bfloat16Indexercreate(short[] array)Returnsnew Bfloat16ArrayIndexer(array)static Bfloat16Indexercreate(short[] array, long... sizes)Returnsnew Bfloat16ArrayIndexer(array, sizes)static Bfloat16Indexercreate(short[] array, long[] sizes, long[] strides)Returnsnew Bfloat16ArrayIndexer(array, sizes, strides)static Bfloat16Indexercreate(short[] array, Index index)Returnsnew Bfloat16ArrayIndexer(array, index)static Bfloat16Indexercreate(java.nio.ShortBuffer buffer)Returnsnew Bfloat16BufferIndexer(buffer)static Bfloat16Indexercreate(java.nio.ShortBuffer buffer, long... sizes)Returnsnew Bfloat16BufferIndexer(buffer, sizes)static Bfloat16Indexercreate(java.nio.ShortBuffer buffer, long[] sizes, long[] strides)Returnsnew Bfloat16BufferIndexer(buffer, sizes, strides)static Bfloat16Indexercreate(java.nio.ShortBuffer buffer, Index index)Returnsnew Bfloat16BufferIndexer(buffer, index)static Bfloat16Indexercreate(ShortPointer pointer)Returnsnew Bfloat16RawIndexer(pointer)static Bfloat16Indexercreate(ShortPointer pointer, long... sizes)Returnsnew Bfloat16RawIndexer(pointer, sizes)static Bfloat16Indexercreate(ShortPointer pointer, long[] sizes, long[] strides)Returnsnew Bfloat16RawIndexer(pointer, sizes, strides)static Bfloat16Indexercreate(ShortPointer pointer, long[] sizes, long[] strides, boolean direct)Returnscreate(pointer, Index.create(sizes, strides), direct)static Bfloat16Indexercreate(ShortPointer pointer, Index index)Returnsnew Bfloat16RawIndexer(pointer, index)static Bfloat16Indexercreate(ShortPointer pointer, Index index, boolean direct)Creates a bfloat16 indexer to access efficiently the data of a pointer.static intfromFloat(float h)returns all higher 16 bits as 0 for all resultsabstract floatget(long i)Returnsarray/buffer[index(i)]abstract floatget(long... indices)Returnsarray/buffer[index(indices)]Bfloat16Indexerget(long[] indices, float[] h)Returnsthiswhereh = array/buffer[index(indices)]abstract Bfloat16Indexerget(long[] indices, float[] h, int offset, int length)Returnsthiswhereh[offset:offset + length] = array/buffer[index(indices)]Bfloat16Indexerget(long i, float[] h)Returnsthiswhereh = array/buffer[index(i)]abstract Bfloat16Indexerget(long i, float[] h, int offset, int length)Returnsthiswhereh[offset:offset + length] = array/buffer[index(i)]abstract floatget(long i, long j)Returnsarray/buffer[index(i, j)]Bfloat16Indexerget(long i, long j, float[] h)Returnsthiswhereh = array/buffer[index(i, j)]abstract Bfloat16Indexerget(long i, long j, float[] h, int offset, int length)Returnsthiswhereh[offset:offset + length] = array/buffer[index(i, j)]abstract floatget(long i, long j, long k)Returnsarray/buffer[index(i, j, k)]doublegetDouble(long... indices)Callsget(int...indices)and returns the value as a double.abstract Bfloat16Indexerput(long[] indices, float h)Returnsthiswherearray/buffer[index(indices)] = hBfloat16Indexerput(long[] indices, float... h)Returnsthiswherearray/buffer[index(indices)] = habstract Bfloat16Indexerput(long[] indices, float[] h, int offset, int length)Returnsthiswherearray/buffer[index(indices)] = h[offset:offset + length]abstract Bfloat16Indexerput(long i, float h)Returnsthiswherearray/buffer[index(i)] = hBfloat16Indexerput(long i, float... h)Returnsthiswherearray/buffer[index(i)] = habstract Bfloat16Indexerput(long i, float[] h, int offset, int length)Returnsthiswherearray/buffer[index(i)] = h[offset:offset + length]abstract Bfloat16Indexerput(long i, long j, float h)Returnsthiswherearray/buffer[index(i, j)] = hBfloat16Indexerput(long i, long j, float... h)Returnsthiswherearray/buffer[index(i, j)] = habstract Bfloat16Indexerput(long i, long j, float[] h, int offset, int length)Returnsthiswherearray/buffer[index(i, j)] = h[offset:offset + length]abstract Bfloat16Indexerput(long i, long j, long k, float h)Returnsthiswherearray/buffer[index(i, j, k)] = hBfloat16IndexerputDouble(long[] indices, double h)Casts value to primitive type and callsput(long[] indices, <type> value).static floattoFloat(int h)ignores the higher 16 bits
-
-
-
Field Detail
-
VALUE_BYTES
public static final int VALUE_BYTES
The number of bytes used to represent a short.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Bfloat16Indexer
protected Bfloat16Indexer(Index index)
-
Bfloat16Indexer
protected Bfloat16Indexer(long[] sizes, long[] strides)
-
-
Method Detail
-
create
public static Bfloat16Indexer create(short[] array)
Returnsnew Bfloat16ArrayIndexer(array)
-
create
public static Bfloat16Indexer create(java.nio.ShortBuffer buffer)
Returnsnew Bfloat16BufferIndexer(buffer)
-
create
public static Bfloat16Indexer create(ShortPointer pointer)
Returnsnew Bfloat16RawIndexer(pointer)
-
create
public static Bfloat16Indexer create(short[] array, Index index)
Returnsnew Bfloat16ArrayIndexer(array, index)
-
create
public static Bfloat16Indexer create(java.nio.ShortBuffer buffer, Index index)
Returnsnew Bfloat16BufferIndexer(buffer, index)
-
create
public static Bfloat16Indexer create(ShortPointer pointer, Index index)
Returnsnew Bfloat16RawIndexer(pointer, index)
-
create
public static Bfloat16Indexer create(short[] array, long... sizes)
Returnsnew Bfloat16ArrayIndexer(array, sizes)
-
create
public static Bfloat16Indexer create(java.nio.ShortBuffer buffer, long... sizes)
Returnsnew Bfloat16BufferIndexer(buffer, sizes)
-
create
public static Bfloat16Indexer create(ShortPointer pointer, long... sizes)
Returnsnew Bfloat16RawIndexer(pointer, sizes)
-
create
public static Bfloat16Indexer create(short[] array, long[] sizes, long[] strides)
Returnsnew Bfloat16ArrayIndexer(array, sizes, strides)
-
create
public static Bfloat16Indexer create(java.nio.ShortBuffer buffer, long[] sizes, long[] strides)
Returnsnew Bfloat16BufferIndexer(buffer, sizes, strides)
-
create
public static Bfloat16Indexer create(ShortPointer pointer, long[] sizes, long[] strides)
Returnsnew Bfloat16RawIndexer(pointer, sizes, strides)
-
create
public static Bfloat16Indexer create(ShortPointer pointer, long[] sizes, long[] strides, boolean direct)
Returnscreate(pointer, Index.create(sizes, strides), direct)
-
create
public static Bfloat16Indexer create(ShortPointer pointer, Index index, boolean direct)
Creates a bfloat16 indexer to access efficiently the data of a pointer.- Parameters:
pointer- data to access via a buffer or to copy to an arrayindex- to usedirect-trueto use a direct buffer, seeIndexerfor details- Returns:
- the new bfloat16 indexer backed by the raw memory interface, a buffer, or an array
-
toFloat
public static float toFloat(int h)
ignores the higher 16 bits
-
fromFloat
public static int fromFloat(float h)
returns all higher 16 bits as 0 for all results
-
get
public abstract float get(long i)
Returnsarray/buffer[index(i)]
-
get
public Bfloat16Indexer get(long i, float[] h)
Returnsthiswhereh = array/buffer[index(i)]
-
get
public abstract Bfloat16Indexer get(long i, float[] h, int offset, int length)
Returnsthiswhereh[offset:offset + length] = array/buffer[index(i)]
-
get
public abstract float get(long i, long j)Returnsarray/buffer[index(i, j)]
-
get
public Bfloat16Indexer get(long i, long j, float[] h)
Returnsthiswhereh = array/buffer[index(i, j)]
-
get
public abstract Bfloat16Indexer get(long i, long j, float[] h, int offset, int length)
Returnsthiswhereh[offset:offset + length] = array/buffer[index(i, j)]
-
get
public abstract float get(long i, long j, long k)Returnsarray/buffer[index(i, j, k)]
-
get
public abstract float get(long... indices)
Returnsarray/buffer[index(indices)]
-
get
public Bfloat16Indexer get(long[] indices, float[] h)
Returnsthiswhereh = array/buffer[index(indices)]
-
get
public abstract Bfloat16Indexer get(long[] indices, float[] h, int offset, int length)
Returnsthiswhereh[offset:offset + length] = array/buffer[index(indices)]
-
put
public abstract Bfloat16Indexer put(long i, float h)
Returnsthiswherearray/buffer[index(i)] = h
-
put
public Bfloat16Indexer put(long i, float... h)
Returnsthiswherearray/buffer[index(i)] = h
-
put
public abstract Bfloat16Indexer put(long i, float[] h, int offset, int length)
Returnsthiswherearray/buffer[index(i)] = h[offset:offset + length]
-
put
public abstract Bfloat16Indexer put(long i, long j, float h)
Returnsthiswherearray/buffer[index(i, j)] = h
-
put
public Bfloat16Indexer put(long i, long j, float... h)
Returnsthiswherearray/buffer[index(i, j)] = h
-
put
public abstract Bfloat16Indexer put(long i, long j, float[] h, int offset, int length)
Returnsthiswherearray/buffer[index(i, j)] = h[offset:offset + length]
-
put
public abstract Bfloat16Indexer put(long i, long j, long k, float h)
Returnsthiswherearray/buffer[index(i, j, k)] = h
-
put
public abstract Bfloat16Indexer put(long[] indices, float h)
Returnsthiswherearray/buffer[index(indices)] = h
-
put
public Bfloat16Indexer put(long[] indices, float... h)
Returnsthiswherearray/buffer[index(indices)] = h
-
put
public abstract Bfloat16Indexer put(long[] indices, float[] h, int offset, int length)
Returnsthiswherearray/buffer[index(indices)] = h[offset:offset + length]
-
getDouble
public double getDouble(long... indices)
Description copied from class:IndexerCallsget(int...indices)and returns the value as a double.
-
putDouble
public Bfloat16Indexer putDouble(long[] indices, double h)
Description copied from class:IndexerCasts value to primitive type and callsput(long[] indices, <type> value).
-
-