public class PointerUtil extends Object
| Constructor and Description |
|---|
PointerUtil() |
| Modifier and Type | Method and Description |
|---|---|
static CUdeviceptr |
constructAndAlloc(int length,
DataBuffer.Type dType)
Construct and allocate a device pointer
|
static int |
getNumBlocks(int n,
int maxBlocks,
int maxThreads)
Compute the number of blocks that should be used for the
given input size and limits
|
static int |
getNumThreads(int n,
int maxThreads)
Compute the number of threads that should be used for the
given input size and limits
|
static Pointer |
getPointer(cuComplex x)
Get the pointer for a single complex float
|
static Pointer |
getPointer(cuDoubleComplex x)
Get the pointer for a single complex float
|
static Pointer |
getPointer(double alpha) |
static Pointer |
getPointer(float alpha) |
static Pointer |
getPointer(IComplexDouble x)
Get the pointer for a single complex float
|
static Pointer |
getPointer(IComplexFloat x)
Get the pointer for a single complex float
|
static Object |
getPointer(ScalarOp scalarOp) |
static int |
nextPow2(int x)
Returns the power of 2 that is equal to or greater than x
|
static int |
sizeFor(DataBuffer.Type dataType) |
static double[] |
toDoubles(Object[] extraArgs) |
static float[] |
toFloats(Object[] extraArgs) |
static int[] |
toShapeInfoBuffer(INDArray arr)
Converts a raw int buffer of the layout:
rank
shape
stride
offset
element wise stride
ordering
where shape and stride are both straight int pointers
Of note here is that offset will be zero automatically
because the offset is handled by the
pointer object instead
|
static int[] |
toShapeInfoBuffer(INDArray arr,
int... dimension)
Converts a raw int buffer of the layout:
rank
shape
stride
offset
element wise stride
ordering
where shape and stride are both straight int pointers
Of note here is that offset will be zero automatically
because the offset is handled by the
pointer object instead
|
public static double[] toDoubles(Object[] extraArgs)
public static int[] toShapeInfoBuffer(INDArray arr, int... dimension)
public static int[] toShapeInfoBuffer(INDArray arr)
public static Pointer getPointer(IComplexDouble x)
x - the number ot get the pointer forpublic static Pointer getPointer(IComplexFloat x)
x - the number ot get the pointer forpublic static Pointer getPointer(cuDoubleComplex x)
x - the number ot get the pointer forpublic static Pointer getPointer(cuComplex x)
x - the number ot get the pointer forpublic static float[] toFloats(Object[] extraArgs)
public static int getNumBlocks(int n,
int maxBlocks,
int maxThreads)
n - The input sizemaxBlocks - The maximum number of blocksmaxThreads - The maximum number of threadspublic static int getNumThreads(int n,
int maxThreads)
n - The input sizemaxThreads - The maximum number of threadspublic static int nextPow2(int x)
x - The inputpublic static CUdeviceptr constructAndAlloc(int length, DataBuffer.Type dType)
length - the length of the pointerdType - the data type to choosepublic static int sizeFor(DataBuffer.Type dataType)
public static Pointer getPointer(double alpha)
public static Pointer getPointer(float alpha)
Copyright © 2015. All Rights Reserved.