Class OrtAllocator
java.lang.Object
smile.onnx.foreign.OrtAllocator
struct OrtAllocator {
uint32_t version;
void *(*Alloc)(struct OrtAllocator *, size_t);
void (*Free)(struct OrtAllocator *, void *);
const struct OrtMemoryInfo *(*Info)(const struct OrtAllocator *);
void *(*Reserve)(struct OrtAllocator *, size_t);
OrtStatusPtr (*GetStats)(const struct OrtAllocator *, OrtKeyValuePairs **);
void *(*AllocOnStream)(struct OrtAllocator *, size_t, OrtSyncStream *);
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classvoid *(*Alloc)(struct OrtAllocator *, size_t)static final classvoid *(*AllocOnStream)(struct OrtAllocator *, size_t, OrtSyncStream *)static final classvoid (*Free)(struct OrtAllocator *, void *)static final classOrtStatusPtr (*GetStats)(const struct OrtAllocator *, OrtKeyValuePairs **)static final classconst struct OrtMemoryInfo *(*Info)(const struct OrtAllocator *)static final classvoid *(*Reserve)(struct OrtAllocator *, size_t) -
Method Summary
Modifier and TypeMethodDescriptionstatic MemorySegmentAlloc(MemorySegment struct) Getter for field:void *(*Alloc)(struct OrtAllocator *, size_t)static voidAlloc(MemorySegment struct, MemorySegment fieldValue) Setter for field:void *(*Alloc)(struct OrtAllocator *, size_t)static final AddressLayoutLayout for field:void *(*Alloc)(struct OrtAllocator *, size_t)static final longOffset for field:void *(*Alloc)(struct OrtAllocator *, size_t)static MemorySegmentallocate(SegmentAllocator allocator) Allocate a segment of sizelayout().byteSize()usingallocatorstatic MemorySegmentallocateArray(long elementCount, SegmentAllocator allocator) Allocate an array of sizeelementCountusingallocator.static MemorySegmentAllocOnStream(MemorySegment struct) Getter for field:void *(*AllocOnStream)(struct OrtAllocator *, size_t, OrtSyncStream *)static voidAllocOnStream(MemorySegment struct, MemorySegment fieldValue) Setter for field:void *(*AllocOnStream)(struct OrtAllocator *, size_t, OrtSyncStream *)static final AddressLayoutLayout for field:void *(*AllocOnStream)(struct OrtAllocator *, size_t, OrtSyncStream *)static final longOffset for field:void *(*AllocOnStream)(struct OrtAllocator *, size_t, OrtSyncStream *)static MemorySegmentasSlice(MemorySegment array, long index) Obtains a slice ofarrayParamwhich selects the array element atindex.static MemorySegmentFree(MemorySegment struct) Getter for field:void (*Free)(struct OrtAllocator *, void *)static voidFree(MemorySegment struct, MemorySegment fieldValue) Setter for field:void (*Free)(struct OrtAllocator *, void *)static final AddressLayoutLayout for field:void (*Free)(struct OrtAllocator *, void *)static final longOffset for field:void (*Free)(struct OrtAllocator *, void *)static MemorySegmentGetStats(MemorySegment struct) Getter for field:OrtStatusPtr (*GetStats)(const struct OrtAllocator *, OrtKeyValuePairs **)static voidGetStats(MemorySegment struct, MemorySegment fieldValue) Setter for field:OrtStatusPtr (*GetStats)(const struct OrtAllocator *, OrtKeyValuePairs **)static final AddressLayoutLayout for field:OrtStatusPtr (*GetStats)(const struct OrtAllocator *, OrtKeyValuePairs **)static final longOffset for field:OrtStatusPtr (*GetStats)(const struct OrtAllocator *, OrtKeyValuePairs **)static MemorySegmentInfo(MemorySegment struct) Getter for field:const struct OrtMemoryInfo *(*Info)(const struct OrtAllocator *)static voidInfo(MemorySegment struct, MemorySegment fieldValue) Setter for field:const struct OrtMemoryInfo *(*Info)(const struct OrtAllocator *)static final AddressLayoutLayout for field:const struct OrtMemoryInfo *(*Info)(const struct OrtAllocator *)static final longOffset for field:const struct OrtMemoryInfo *(*Info)(const struct OrtAllocator *)static final GroupLayoutlayout()The layout of this structstatic MemorySegmentreinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer<MemorySegment> cleanup) Reinterpretsaddrusing targetarenaandcleanupAction(if any).static MemorySegmentreinterpret(MemorySegment addr, Arena arena, Consumer<MemorySegment> cleanup) Reinterpretsaddrusing targetarenaandcleanupAction(if any).static MemorySegmentReserve(MemorySegment struct) Getter for field:void *(*Reserve)(struct OrtAllocator *, size_t)static voidReserve(MemorySegment struct, MemorySegment fieldValue) Setter for field:void *(*Reserve)(struct OrtAllocator *, size_t)static final AddressLayoutLayout for field:void *(*Reserve)(struct OrtAllocator *, size_t)static final longOffset for field:void *(*Reserve)(struct OrtAllocator *, size_t)static longsizeof()The size (in bytes) of this structstatic intversion(MemorySegment struct) Getter for field:uint32_t versionstatic voidversion(MemorySegment struct, int fieldValue) Setter for field:uint32_t versionstatic final ValueLayout.OfIntLayout for field:uint32_t versionstatic final longOffset for field:uint32_t version
-
Method Details
-
layout
The layout of this struct -
version$layout
Layout for field:uint32_t version -
version$offset
public static final long version$offset()Offset for field:uint32_t version -
version
Getter for field:uint32_t version -
version
Setter for field:uint32_t version -
Alloc$layout
Layout for field:void *(*Alloc)(struct OrtAllocator *, size_t) -
Alloc$offset
public static final long Alloc$offset()Offset for field:void *(*Alloc)(struct OrtAllocator *, size_t) -
Alloc
Getter for field:void *(*Alloc)(struct OrtAllocator *, size_t) -
Alloc
Setter for field:void *(*Alloc)(struct OrtAllocator *, size_t) -
Free$layout
Layout for field:void (*Free)(struct OrtAllocator *, void *) -
Free$offset
public static final long Free$offset()Offset for field:void (*Free)(struct OrtAllocator *, void *) -
Free
Getter for field:void (*Free)(struct OrtAllocator *, void *) -
Free
Setter for field:void (*Free)(struct OrtAllocator *, void *) -
Info$layout
Layout for field:const struct OrtMemoryInfo *(*Info)(const struct OrtAllocator *) -
Info$offset
public static final long Info$offset()Offset for field:const struct OrtMemoryInfo *(*Info)(const struct OrtAllocator *) -
Info
Getter for field:const struct OrtMemoryInfo *(*Info)(const struct OrtAllocator *) -
Info
Setter for field:const struct OrtMemoryInfo *(*Info)(const struct OrtAllocator *) -
Reserve$layout
Layout for field:void *(*Reserve)(struct OrtAllocator *, size_t) -
Reserve$offset
public static final long Reserve$offset()Offset for field:void *(*Reserve)(struct OrtAllocator *, size_t) -
Reserve
Getter for field:void *(*Reserve)(struct OrtAllocator *, size_t) -
Reserve
Setter for field:void *(*Reserve)(struct OrtAllocator *, size_t) -
GetStats$layout
Layout for field:OrtStatusPtr (*GetStats)(const struct OrtAllocator *, OrtKeyValuePairs **) -
GetStats$offset
public static final long GetStats$offset()Offset for field:OrtStatusPtr (*GetStats)(const struct OrtAllocator *, OrtKeyValuePairs **) -
GetStats
Getter for field:OrtStatusPtr (*GetStats)(const struct OrtAllocator *, OrtKeyValuePairs **) -
GetStats
Setter for field:OrtStatusPtr (*GetStats)(const struct OrtAllocator *, OrtKeyValuePairs **) -
AllocOnStream$layout
Layout for field:void *(*AllocOnStream)(struct OrtAllocator *, size_t, OrtSyncStream *) -
AllocOnStream$offset
public static final long AllocOnStream$offset()Offset for field:void *(*AllocOnStream)(struct OrtAllocator *, size_t, OrtSyncStream *) -
AllocOnStream
Getter for field:void *(*AllocOnStream)(struct OrtAllocator *, size_t, OrtSyncStream *) -
AllocOnStream
Setter for field:void *(*AllocOnStream)(struct OrtAllocator *, size_t, OrtSyncStream *) -
asSlice
Obtains a slice ofarrayParamwhich selects the array element atindex. The returned segment has addressarrayParam.address() + index * layout().byteSize() -
sizeof
public static long sizeof()The size (in bytes) of this struct -
allocate
Allocate a segment of sizelayout().byteSize()usingallocator -
allocateArray
Allocate an array of sizeelementCountusingallocator. The returned segment has sizeelementCount * layout().byteSize(). -
reinterpret
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer<MemorySegment> cleanup) Reinterpretsaddrusing targetarenaandcleanupAction(if any). The returned segment has sizelayout().byteSize() -
reinterpret
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer<MemorySegment> cleanup) Reinterpretsaddrusing targetarenaandcleanupAction(if any). The returned segment has sizeelementCount * layout().byteSize()
-