Class OrtAllocator

java.lang.Object
smile.onnx.foreign.OrtAllocator

public class OrtAllocator extends Object
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 *);
}
  • Method Details

    • layout

      public static final GroupLayout layout()
      The layout of this struct
    • version$layout

      public static final ValueLayout.OfInt version$layout()
      Layout for field:
      uint32_t version
      
    • version$offset

      public static final long version$offset()
      Offset for field:
      uint32_t version
      
    • version

      public static int version(MemorySegment struct)
      Getter for field:
      uint32_t version
      
    • version

      public static void version(MemorySegment struct, int fieldValue)
      Setter for field:
      uint32_t version
      
    • Alloc$layout

      public static final AddressLayout 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

      public static MemorySegment Alloc(MemorySegment struct)
      Getter for field:
      void *(*Alloc)(struct OrtAllocator *, size_t)
      
    • Alloc

      public static void Alloc(MemorySegment struct, MemorySegment fieldValue)
      Setter for field:
      void *(*Alloc)(struct OrtAllocator *, size_t)
      
    • Free$layout

      public static final AddressLayout 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

      public static MemorySegment Free(MemorySegment struct)
      Getter for field:
      void (*Free)(struct OrtAllocator *, void *)
      
    • Free

      public static void Free(MemorySegment struct, MemorySegment fieldValue)
      Setter for field:
      void (*Free)(struct OrtAllocator *, void *)
      
    • Info$layout

      public static final AddressLayout 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

      public static MemorySegment Info(MemorySegment struct)
      Getter for field:
      const struct OrtMemoryInfo *(*Info)(const struct OrtAllocator *)
      
    • Info

      public static void Info(MemorySegment struct, MemorySegment fieldValue)
      Setter for field:
      const struct OrtMemoryInfo *(*Info)(const struct OrtAllocator *)
      
    • Reserve$layout

      public static final AddressLayout 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

      public static MemorySegment Reserve(MemorySegment struct)
      Getter for field:
      void *(*Reserve)(struct OrtAllocator *, size_t)
      
    • Reserve

      public static void Reserve(MemorySegment struct, MemorySegment fieldValue)
      Setter for field:
      void *(*Reserve)(struct OrtAllocator *, size_t)
      
    • GetStats$layout

      public static final AddressLayout 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

      public static MemorySegment GetStats(MemorySegment struct)
      Getter for field:
      OrtStatusPtr (*GetStats)(const struct OrtAllocator *, OrtKeyValuePairs **)
      
    • GetStats

      public static void GetStats(MemorySegment struct, MemorySegment fieldValue)
      Setter for field:
      OrtStatusPtr (*GetStats)(const struct OrtAllocator *, OrtKeyValuePairs **)
      
    • AllocOnStream$layout

      public static final AddressLayout 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

      public static MemorySegment AllocOnStream(MemorySegment struct)
      Getter for field:
      void *(*AllocOnStream)(struct OrtAllocator *, size_t, OrtSyncStream *)
      
    • AllocOnStream

      public static void AllocOnStream(MemorySegment struct, MemorySegment fieldValue)
      Setter for field:
      void *(*AllocOnStream)(struct OrtAllocator *, size_t, OrtSyncStream *)
      
    • asSlice

      public static MemorySegment asSlice(MemorySegment array, long index)
      Obtains a slice of arrayParam which selects the array element at index. The returned segment has address arrayParam.address() + index * layout().byteSize()
    • sizeof

      public static long sizeof()
      The size (in bytes) of this struct
    • allocate

      public static MemorySegment allocate(SegmentAllocator allocator)
      Allocate a segment of size layout().byteSize() using allocator
    • allocateArray

      public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator)
      Allocate an array of size elementCount using allocator. The returned segment has size elementCount * layout().byteSize().
    • reinterpret

      public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer<MemorySegment> cleanup)
      Reinterprets addr using target arena and cleanupAction (if any). The returned segment has size layout().byteSize()
    • reinterpret

      public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer<MemorySegment> cleanup)
      Reinterprets addr using target arena and cleanupAction (if any). The returned segment has size elementCount * layout().byteSize()