AI-generated Key Takeaways
-
CpuAccelerationConfig.Builderis a builder class for creating CPU acceleration configurations. -
It has methods to set the number of threads and disable default delegates like XNNPack.
-
The
build()method creates the CPU acceleration config and can throw exceptions for invalid thread numbers or conflicting delegate settings.
Builder class.
Public Constructor Summary
|
Builder()
Creates the CPU acceleration config builder.
|
Public Method Summary
| CpuAccelerationConfig |
build()
Builds the CPU acceleration config.
|
| CpuAccelerationConfig.Builder |
setDisableDefaultDelegates(boolean value)
Sets whether to disable the default delegates (XNNPack).
|
| CpuAccelerationConfig.Builder |
setNumThreads(int numThreads)
Sets the number of threads.
|
Inherited Method Summary
Public Constructors
public Builder ()
Creates the CPU acceleration config builder.
Public Methods
public CpuAccelerationConfig build ()
Builds the CPU acceleration config.
Throws
| IllegalArgumentException | if number of threads is not -1 or positive |
|---|---|
| IllegalArgumentException | if default delegates are disabled and XNNPack delegate flag is set |
public CpuAccelerationConfig.Builder setDisableDefaultDelegates (boolean value)
Sets whether to disable the default delegates (XNNPack).
public CpuAccelerationConfig.Builder setNumThreads (int numThreads)
Sets the number of threads. Set to -1 to let the interpreter choose.
Otherwise, must be > 0.