| 2382 | }; |
| 2383 | |
| 2384 | void ExposePipelineParams(py::module &m) { |
| 2385 | py::enum_<ExecutorType>(m, "_ExecutorType") |
| 2386 | .value("Simple", ExecutorType::Simple) |
| 2387 | .value("PipelinedFlag", ExecutorType::PipelinedFlag) |
| 2388 | .value("SeparatedFlag", ExecutorType::SeparatedFlag) |
| 2389 | .value("AsyncFlag", ExecutorType::AsyncFlag) |
| 2390 | .value("DynamicFlag", ExecutorType::DynamicFlag) |
| 2391 | .value("AsyncPipelined", ExecutorType::AsyncPipelined) |
| 2392 | .value("SeparatedPipelined", ExecutorType::SeparatedPipelined) |
| 2393 | .value("AsyncSeparatedPipelined", ExecutorType::AsyncSeparatedPipelined) |
| 2394 | .value("Dynamic", ExecutorType::Dynamic); |
| 2395 | |
| 2396 | py::enum_<ExecutorFlags>(m, "_ExecutorFlags") |
| 2397 | .value("NoFlags", ExecutorFlags::None) |
| 2398 | .value("SetAffinity", ExecutorFlags::SetAffinity) |
| 2399 | .value("StreamPolicyMask", ExecutorFlags::StreamPolicyMask) |
| 2400 | .value("StreamPolicyPerOperator", ExecutorFlags::StreamPolicyPerOperator) |
| 2401 | .value("StreamPolicyPerBackend", ExecutorFlags::StreamPolicyPerBackend) |
| 2402 | .value("StreamPolicySingle", ExecutorFlags::StreamPolicySingle) |
| 2403 | .value("ConcurrencyMask", ExecutorFlags::ConcurrencyMask) |
| 2404 | .value("ConcurrencyNone", ExecutorFlags::ConcurrencyNone) |
| 2405 | .value("ConcurrencyFull", ExecutorFlags::ConcurrencyFull) |
| 2406 | .value("ConcurrencyBackend", ExecutorFlags::ConcurrencyBackend); |
| 2407 | |
| 2408 | m.def("_MakeExecutorType", MakeExecutorType); |
| 2409 | |
| 2410 | py::class_<PipelineParams>(m, "_PipelineParams") |
| 2411 | .def(py::init([]( |
| 2412 | std::optional<int> max_batch_size, |
| 2413 | std::optional<int> num_threads, |
| 2414 | std::optional<int> device_id, |
| 2415 | std::optional<int64_t> seed, |
| 2416 | std::optional<ExecutorType> executor_type, |
| 2417 | std::optional<ExecutorFlags> executor_flags, |
| 2418 | std::optional<std::pair<int, int>> prefetch_queue_depths, |
| 2419 | std::optional<bool> enable_checkpointing, |
| 2420 | std::optional<bool> enable_memory_stats, |
| 2421 | std::optional<size_t> bytes_per_sample_hint) { |
| 2422 | std::optional<QueueSizes> queue_sizes; |
| 2423 | if (prefetch_queue_depths) |
| 2424 | queue_sizes = QueueSizes{prefetch_queue_depths->first, prefetch_queue_depths->second}; |
| 2425 | |
| 2426 | return std::unique_ptr<PipelineParams>(new PipelineParams{ |
| 2427 | max_batch_size, |
| 2428 | num_threads, |
| 2429 | device_id, |
| 2430 | seed, |
| 2431 | executor_type, |
| 2432 | executor_flags, |
| 2433 | queue_sizes, |
| 2434 | enable_checkpointing, |
| 2435 | enable_memory_stats, |
| 2436 | bytes_per_sample_hint |
| 2437 | }); |
| 2438 | }), |
| 2439 | "max_batch_size"_a = py::none(), |
| 2440 | "num_threads"_a = py::none(), |
| 2441 | "device_id"_a = py::none(), |
no test coverage detected