Add setInterOpNumThreads to ORTSessionOptions
CodeQL Advanced / Analyze (swift) (push) Has been cancelled
CodeQL Advanced / Analyze (swift) (push) Has been cancelled
Wraps the C API's SetInterOpNumThreads, mirroring the existing setIntraOpNumThreads binding. Automated-By: Claude Fable 5
This commit is contained in:
@@ -405,6 +405,7 @@ public final class ORTSession {
|
||||
public final class ORTSessionOptions {
|
||||
public private(set) var executionProviders: [(name: String, options: [String: String])] = []
|
||||
public private(set) var intraOpNumThreads: Int32 = 0
|
||||
public private(set) var interOpNumThreads: Int32 = 0
|
||||
public private(set) var graphOptimizationLevel: ORTGraphOptimizationLevel = .all
|
||||
public private(set) var optimizedModelFilePath: String?
|
||||
public private(set) var logID: String?
|
||||
@@ -470,6 +471,14 @@ public final class ORTSessionOptions {
|
||||
intraOpNumThreads = count
|
||||
}
|
||||
|
||||
public func setInterOpNumThreads(_ count: Int32) throws {
|
||||
try ORTNative.check(
|
||||
ORTNative.api.pointee.SetInterOpNumThreads?(handle, Int32(count)),
|
||||
action: "SetInterOpNumThreads"
|
||||
)
|
||||
interOpNumThreads = count
|
||||
}
|
||||
|
||||
public func setGraphOptimizationLevel(_ level: ORTGraphOptimizationLevel) throws {
|
||||
try ORTNative.check(
|
||||
ORTNative.api.pointee.SetSessionGraphOptimizationLevel?(handle, level.native),
|
||||
|
||||
Reference in New Issue
Block a user