Skip to content

Commit

Permalink
Merge pull request #121 from yuzawa-san/v15_providers
Browse files Browse the repository at this point in the history
update providers
  • Loading branch information
yuzawa-san authored May 31, 2023
2 parents e5497bb + 28b6357 commit 310e468
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
23 changes: 20 additions & 3 deletions src/main/java/com/jyuzawa/onnxruntime/ExecutionProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
/**
* The universe of possible execution providers.
*
* The identifiers are the constants defined in //https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/graph/constants.h
* The identifiers are the constants defined in https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/graph/constants.h
*
* Support in the public C API and in the provided native library is a requirement for successful usage.
*/
public enum ExecutionProvider {
/**
Expand All @@ -20,7 +21,7 @@ public enum ExecutionProvider {
*/
CUDA_EXECUTION_PROVIDER("CUDAExecutionProvider", ExecutionProviderCUDAConfig::new),
/**
* DNNL: supported
* oneDNN (DNNL): supported
*/
DNNL_EXECUTION_PROVIDER("DnnlExecutionProvider", ExecutionProviderDnnlConfig::new),
/**
Expand All @@ -39,6 +40,10 @@ public enum ExecutionProvider {
* NNApi: not supported
*/
NNAPI_EXECUTION_PROVIDER("NnapiExecutionProvider"),
/**
* QNN: supported
*/
QNN_EXECUTION_PROVIDER("QNNExecutionProvider", ExecutionProviderSimpleMapConfig.of("QNN")),
/**
* RKNPU: not supported
*/
Expand Down Expand Up @@ -67,6 +72,10 @@ public enum ExecutionProvider {
* CoreML: supported
*/
COREML_EXECUTION_PROVIDER("CoreMLExecutionProvider", ExecutionProviderCoreMLConfig::new),
/**
* JS Execution Provider: not supported
*/
JS_EXECUTION_PROVIDER("JsExecutionProvider"),
/**
* SNPE: supported
*/
Expand All @@ -79,10 +88,18 @@ public enum ExecutionProvider {
* XNNPACK: supported
*/
XNNPACK_EXECUTION_PROVIDER("XnnpackExecutionProvider", ExecutionProviderSimpleMapConfig.of("XNNPACK")),
/**
* WebNN: not supported
*/
WEBNN_EXECUTION_PROVIDER("WebNNExecutionProvider"),
/**
* CANN: not supported
*/
CANN_EXECUTION_PROVIDER("CANNExecutionProvider");
CANN_EXECUTION_PROVIDER("CANNExecutionProvider"),
/**
* Azure: not supported
*/
AZURE_EXECUTION_PROVIDER("AzureExecutionProvider");

private final String identifier;
final ExecutionProviderConfigFactory factory;
Expand Down
17 changes: 16 additions & 1 deletion src/test/java/com/jyuzawa/onnxruntime/SessionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,21 @@ public void rocmTest() throws Exception {

@Test
public void dnnlTest() throws Exception {
providerTest(ExecutionProvider.ROCM_EXECUTION_PROVIDER, Map.of("device_id", "0"));
providerTest(ExecutionProvider.DNNL_EXECUTION_PROVIDER, Map.of("device_id", "0"));
}

@Test
public void snpeTest() throws Exception {
providerTest(ExecutionProvider.SNPE_EXECUTION_PROVIDER, Map.of("device_id", "0"));
}

@Test
public void xnnpackTest() throws Exception {
providerTest(ExecutionProvider.XNNPACK_EXECUTION_PROVIDER, Map.of("device_id", "0"));
}

@Test
public void qnnTest() throws Exception {
providerTest(ExecutionProvider.QNN_EXECUTION_PROVIDER, Map.of("device_id", "0"));
}
}

0 comments on commit 310e468

Please sign in to comment.