onnxruntime/java/src/main/native/ai_onnxruntime_OnnxRuntime.c
Ryan Hill 6049de8d26
Ryanunderhill/rel 1.1.0 (#2615)
* Add missig env variables for mac pipeline test (#2595)
* Java API for onnxruntime (#2215)
* Rename automl python tools folder to featurizer_ops. (#2593)
2019-12-13 13:37:02 -08:00

20 lines
678 B
C

/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Licensed under the MIT License.
*/
#include <jni.h>
#include "onnxruntime/core/session/onnxruntime_c_api.h"
#include "ai_onnxruntime_OnnxRuntime.h"
/*
* Class: ai_onnxruntime_OnnxRuntime
* Method: initialiseAPIBase
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_ai_onnxruntime_OnnxRuntime_initialiseAPIBase
(JNIEnv * jniEnv, jclass clazz, jint apiVersion) {
(void) jniEnv; (void) clazz; // required JNI parameters not needed by functions which don't call back into Java.
const OrtApi* ortPtr = OrtGetApiBase()->GetApi((uint32_t) apiVersion);
return (jlong) ortPtr;
}