SetGlobalIntraOpThreadAffinity property
Pointer<NativeFunction<OrtStatusPtr Function(Pointer<OrtThreadingOptions> tp_options, Pointer<Char> affinity_string)> >
SetGlobalIntraOpThreadAffinity
getter/setter pair
\brief Set affinities for intra op threads
Affinity string follows format: logical_processor_id,logical_processor_id;logical_processor_id,logical_processor_id Semicolon isolates configurations among threads, while comma split processors where ith thread expected to attach to. e.g. 1,2,3;4,5 specifies affinities for two threads, with the 1st thread attach to the 1st, 2nd, and 3rd processor, and 2nd thread to the 4th and 5th. To ease the configuration, an "interval" is also allowed: e.g. 1-8;8-16;17-24 orders that the 1st thread runs on first eight processors, 2nd thread runs on next eight processors, and so forth. Note:
- Once set, the number of thread affinities must equal to intra_op_num_threads - 1, ort does not set affinity on the main thread which is started and managed by the calling app;
- For windows, ort will infer the group id from a logical processor id, for example, assuming there are two groups with each has 64 logical processors, an id of 64 will be inferred as the last processor of the 1st group, while 65 will be interpreted as the 1st processor of the second group. Hence 64-65 is an invalid configuration, because a windows thread cannot be attached to processors across group boundary.
\since Version 1.14
Implementation
external ffi.Pointer<
ffi.NativeFunction<
OrtStatusPtr Function(
ffi.Pointer<OrtThreadingOptions> tp_options,
ffi.Pointer<ffi.Char> affinity_string,
)
>
>
SetGlobalIntraOpThreadAffinity;