StreamExecutorConfig encapsulates the set of options for constructing a StreamExecutor for a given platform.
| 72 | // StreamExecutorConfig encapsulates the set of options for constructing a |
| 73 | // StreamExecutor for a given platform. |
| 74 | struct StreamExecutorConfig { |
| 75 | // Sets members to defaults: -1 for ordinal (must be changed), and default |
| 76 | // PluginConfig and DeviceOptions. |
| 77 | StreamExecutorConfig(); |
| 78 | |
| 79 | // Simple ordinal-setting constructor. |
| 80 | explicit StreamExecutorConfig(int ordinal); |
| 81 | |
| 82 | explicit StreamExecutorConfig(int ordinal, int virtual_ordinal); |
| 83 | |
| 84 | // The ordinal of the device to be managed by the returned StreamExecutor. |
| 85 | int ordinal; |
| 86 | |
| 87 | // The virtual ordinal of the virtual device. |
| 88 | // User may set several virtual devices per gpu. |
| 89 | int virtual_ordinal; |
| 90 | |
| 91 | // The PluginConfig for the returned StreamExecutor. |
| 92 | PluginConfig plugin_config; |
| 93 | |
| 94 | // The DeviceOptions for the returned StreamExecutor. |
| 95 | DeviceOptions device_options; |
| 96 | }; |
| 97 | |
| 98 | // Abstract base class for a platform registered with the MultiPlatformManager. |
| 99 | class Platform { |