Package ai.onnxruntime.providers
Class OrtCUDAProviderOptions
java.lang.Object
ai.onnxruntime.OrtProviderOptions
ai.onnxruntime.providers.OrtCUDAProviderOptions
- All Implemented Interfaces:
AutoCloseable
Options for configuring the CUDA execution provider.
Supported options are listed on the ORT website.
-
Nested Class Summary
Nested classes/interfaces inherited from class ai.onnxruntime.OrtProviderOptions
OrtProviderOptions.OrtProviderSupplier -
Field Summary
FieldsModifier and TypeFieldDescriptionA Java side copy of the options.Fields inherited from class ai.onnxruntime.OrtProviderOptions
closed, nativeHandle -
Constructor Summary
ConstructorsConstructorDescriptionConstructs CUDA execution provider options for device 0.OrtCUDAProviderOptions(int deviceId) Constructs CUDA execution provider options for the specified non-negative device id. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a configuration option to this options.protected voidApplies the Java side configuration to the native side object.protected voidapplyToNative(long apiHandle, long nativeHandle, String[] keys, String[] values) Adds the options to this options instance.protected voidclose(long apiHandle, long nativeHandle) Closes this options instance.Returns the serialized options stringGets the provider enum for this options instance.voidparseOptionsString(String serializedForm) Parses the output ofgetOptionsString()and adds those options to this options instance.toString()Methods inherited from class ai.onnxruntime.OrtProviderOptions
checkClosed, close, getApiHandle, isClosed, loadLibraryAndCreate
-
Field Details
-
options
A Java side copy of the options.
-
-
Constructor Details
-
OrtCUDAProviderOptions
Constructs CUDA execution provider options for device 0.- Throws:
OrtException- If CUDA is unavailable.
-
OrtCUDAProviderOptions
Constructs CUDA execution provider options for the specified non-negative device id.- Parameters:
deviceId- The device id.- Throws:
OrtException- If CUDA is unavailable.
-
-
Method Details
-
getProvider
Description copied from class:OrtProviderOptionsGets the provider enum for this options instance.- Specified by:
getProviderin classOrtProviderOptions- Returns:
- The provider enum.
-
applyToNative
protected void applyToNative(long apiHandle, long nativeHandle, String[] keys, String[] values) throws OrtException Adds the options to this options instance.- Parameters:
apiHandle- The api pointer.nativeHandle- The native options pointer.keys- The option keys.values- The option values.- Throws:
OrtException- If the addition failed.
-
close
protected void close(long apiHandle, long nativeHandle) Closes this options instance.- Specified by:
closein classOrtProviderOptions- Parameters:
apiHandle- The api pointer.nativeHandle- The native options pointer.
-
add
Adds a configuration option to this options.- Parameters:
key- The key.value- The value.- Throws:
OrtException- If the addition failed.
-
parseOptionsString
Parses the output ofgetOptionsString()and adds those options to this options instance.- Parameters:
serializedForm- The serialized form to parse.- Throws:
OrtException- If the option could not be added.
-
toString
-
getOptionsString
Returns the serialized options string- Returns:
- The serialized options string.
-
applyToNative
Description copied from class:OrtProviderOptionsApplies the Java side configuration to the native side object.- Specified by:
applyToNativein classOrtProviderOptions- Throws:
OrtException- If the native call failed.
-