Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version=1.29.0-2-SNAPSHOT
version=1.30.0-1-SNAPSHOT
org.gradle.parallel=true
org.gradle.caching=true
108 changes: 107 additions & 1 deletion src/main/java/com/jyuzawa/onnxruntime_extern/OrtApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@
* OrtExperimentalFnPtr (*GetExperimentalFunction)(const char *);
* OrtStatusPtr (*KernelContext_GetSyncStream)(const OrtKernelContext *, OrtSyncStream **);
* OrtStatusPtr (*SessionOptionsSetWeightlessSourceModelBuffer)(OrtSessionOptions *, const void *, size_t);
* OrtStatusPtr (*KernelContext_GetPreallocatedOutput)(const OrtKernelContext *, size_t, OrtValue **);
* }
* }
*/
Expand Down Expand Up @@ -875,7 +876,8 @@ public class OrtApi {
onnxruntime_all_h.C_POINTER.withName("SessionReleaseCapturedGraph"),
onnxruntime_all_h.C_POINTER.withName("GetExperimentalFunction"),
onnxruntime_all_h.C_POINTER.withName("KernelContext_GetSyncStream"),
onnxruntime_all_h.C_POINTER.withName("SessionOptionsSetWeightlessSourceModelBuffer"))
onnxruntime_all_h.C_POINTER.withName("SessionOptionsSetWeightlessSourceModelBuffer"),
onnxruntime_all_h.C_POINTER.withName("KernelContext_GetPreallocatedOutput"))
.withName("OrtApi");

/**
Expand Down Expand Up @@ -44787,6 +44789,110 @@ public static void SessionOptionsSetWeightlessSourceModelBuffer(MemorySegment st
fieldValue);
}

/**
* {@snippet lang=c :
* OrtStatusPtr (*KernelContext_GetPreallocatedOutput)(const OrtKernelContext *, size_t, OrtValue **)
* }
*/
public static final class KernelContext_GetPreallocatedOutput {

private KernelContext_GetPreallocatedOutput() {
// Should not be called directly
}

/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
MemorySegment apply(MemorySegment _x0, long _x1, MemorySegment _x2);
}

private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
onnxruntime_all_h.C_POINTER,
onnxruntime_all_h.C_POINTER,
onnxruntime_all_h.C_LONG,
onnxruntime_all_h.C_POINTER);

/**
* The descriptor of this function pointer
*/
public static FunctionDescriptor descriptor() {
return $DESC;
}

private static final MethodHandle UP$MH =
onnxruntime_all_h.upcallHandle(KernelContext_GetPreallocatedOutput.Function.class, "apply", $DESC);

/**
* Allocates a new upcall stub, whose implementation is defined by {@code fi}.
* The lifetime of the returned segment is managed by {@code arena}
*/
public static MemorySegment allocate(KernelContext_GetPreallocatedOutput.Function fi, Arena arena) {
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
}

private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

/**
* Invoke the upcall stub {@code funcPtr}, with given parameters
*/
public static MemorySegment invoke(MemorySegment funcPtr, MemorySegment _x0, long _x1, MemorySegment _x2) {
try {
return (MemorySegment) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2);
} catch (Error | RuntimeException ex) {
throw ex;
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}

private static final AddressLayout KernelContext_GetPreallocatedOutput$LAYOUT =
(AddressLayout) $LAYOUT.select(groupElement("KernelContext_GetPreallocatedOutput"));

/**
* Layout for field:
* {@snippet lang=c :
* OrtStatusPtr (*KernelContext_GetPreallocatedOutput)(const OrtKernelContext *, size_t, OrtValue **)
* }
*/
public static final AddressLayout KernelContext_GetPreallocatedOutput$layout() {
return KernelContext_GetPreallocatedOutput$LAYOUT;
}

private static final long KernelContext_GetPreallocatedOutput$OFFSET =
$LAYOUT.byteOffset(groupElement("KernelContext_GetPreallocatedOutput"));

/**
* Offset for field:
* {@snippet lang=c :
* OrtStatusPtr (*KernelContext_GetPreallocatedOutput)(const OrtKernelContext *, size_t, OrtValue **)
* }
*/
public static final long KernelContext_GetPreallocatedOutput$offset() {
return KernelContext_GetPreallocatedOutput$OFFSET;
}

/**
* Getter for field:
* {@snippet lang=c :
* OrtStatusPtr (*KernelContext_GetPreallocatedOutput)(const OrtKernelContext *, size_t, OrtValue **)
* }
*/
public static MemorySegment KernelContext_GetPreallocatedOutput(MemorySegment struct) {
return struct.get(KernelContext_GetPreallocatedOutput$LAYOUT, KernelContext_GetPreallocatedOutput$OFFSET);
}

/**
* Setter for field:
* {@snippet lang=c :
* OrtStatusPtr (*KernelContext_GetPreallocatedOutput)(const OrtKernelContext *, size_t, OrtValue **)
* }
*/
public static void KernelContext_GetPreallocatedOutput(MemorySegment struct, MemorySegment fieldValue) {
struct.set(KernelContext_GetPreallocatedOutput$LAYOUT, KernelContext_GetPreallocatedOutput$OFFSET, fieldValue);
}

/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
Expand Down
50 changes: 40 additions & 10 deletions src/main/java/com/jyuzawa/onnxruntime_extern/onnxruntime_all_h.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public class onnxruntime_all_h extends onnxruntime_all_h$shared {
static final SymbolLookup SYMBOL_LOOKUP =
SymbolLookup.loaderLookup().or(Linker.nativeLinker().defaultLookup());

private static final int ORT_API_VERSION = (int) 29L;
private static final int ORT_API_VERSION = (int) 30L;
/**
* {@snippet lang=c :
* #define ORT_API_VERSION 29
* #define ORT_API_VERSION 30
* }
*/
public static int ORT_API_VERSION() {
Expand Down Expand Up @@ -1308,24 +1308,34 @@ public static int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP() {
return ORT_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP;
}

private static final int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_WIN32 = (int) 2L;
private static final int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_MEMORY_WIN32 = (int) 2L;
/**
* {@snippet lang=c :
* enum OrtExternalMemoryHandleType.ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_WIN32 = 2
* enum OrtExternalMemoryHandleType.ORT_EXTERNAL_MEMORY_HANDLE_TYPE_MEMORY_WIN32 = 2
* }
*/
public static int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_WIN32() {
return ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_WIN32;
public static int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_MEMORY_WIN32() {
return ORT_EXTERNAL_MEMORY_HANDLE_TYPE_MEMORY_WIN32;
}

private static final int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_OPAQUE_FD = (int) 3L;
private static final int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_MEMORY_OPAQUE_FD = (int) 3L;
/**
* {@snippet lang=c :
* enum OrtExternalMemoryHandleType.ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_OPAQUE_FD = 3
* enum OrtExternalMemoryHandleType.ORT_EXTERNAL_MEMORY_HANDLE_TYPE_MEMORY_OPAQUE_FD = 3
* }
*/
public static int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_OPAQUE_FD() {
return ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_OPAQUE_FD;
public static int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_MEMORY_OPAQUE_FD() {
return ORT_EXTERNAL_MEMORY_HANDLE_TYPE_MEMORY_OPAQUE_FD;
}

private static final int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION = (int) 4L;
/**
* {@snippet lang=c :
* enum OrtExternalMemoryHandleType.ORT_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION = 4
* }
*/
public static int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION() {
return ORT_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION;
}

private static final int ORT_EXTERNAL_SEMAPHORE_D3D12_FENCE = (int) 0L;
Expand Down Expand Up @@ -2075,4 +2085,24 @@ class Holder {
}
return Holder.ORT_FILE;
}

private static final int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_WIN32 = (int) 2L;
/**
* {@snippet lang=c :
* #define ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_WIN32 2
* }
*/
public static int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_WIN32() {
return ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_WIN32;
}

private static final int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_OPAQUE_FD = (int) 3L;
/**
* {@snippet lang=c :
* #define ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_OPAQUE_FD 3
* }
*/
public static int ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_OPAQUE_FD() {
return ORT_EXTERNAL_MEMORY_HANDLE_TYPE_VK_MEMORY_OPAQUE_FD;
}
}
Loading