pub mod executor;
pub mod task;
pub mod taskflow;
pub mod subflow;
pub mod future;
pub mod algorithms;
pub mod condition;
pub mod cycle_detection;
pub mod pipeline;
pub mod typed_pipeline;
pub mod composition;
pub mod advanced;
pub mod scheduler;
pub mod numa;
pub mod profiler;
pub mod visualization;
pub mod monitoring;
pub mod metrics;
pub mod debug;
pub mod preemptive;
pub mod dynamic_priority;
pub mod hwloc_topology;
#[cfg(feature = "async")]
pub mod async_executor;
pub mod gpu;
pub mod gpu_backend;
pub mod gpu_stream;
#[cfg(feature = "gpu")]
pub mod gpu_cuda_backend;
#[cfg(feature = "opencl")]
pub mod gpu_opencl;
#[cfg(feature = "rocm")]
pub mod gpu_rocm;
pub use executor::Executor;
pub use task::{Task, TaskHandle};
pub use taskflow::Taskflow;
pub use subflow::Subflow;
pub use future::TaskflowFuture;
pub use condition::{ConditionalHandle, BranchId, Loop};
pub use cycle_detection::{CycleDetector, CycleDetectionResult};
pub use pipeline::{ConcurrentPipeline, Token, StageType};
pub use composition::{
Composition, CompositionBuilder, ComposedInstance, TaskflowComposable,
CloneableWork, CompositionParams, ParamValue, ParameterizedComposition, CompositionFactory
};
pub use advanced::{Priority, CancellationToken, TaskMetadata};
pub use scheduler::{Scheduler, FifoScheduler, PriorityScheduler, RoundRobinScheduler};
pub use numa::{NumaTopology, NumaNode, NumaPinning};
pub use profiler::{Profiler, ExecutionProfile, TaskStats};
pub use visualization::{
generate_dot_graph, save_dot_graph,
generate_timeline_svg, save_timeline_svg,
generate_html_report, save_html_report
};
pub use monitoring::PerformanceMetrics;
pub use metrics::{Metrics, MetricsSummary};
pub use typed_pipeline::{TypeSafePipeline, PipelineBuilder, SimplePipeline};
pub use debug::{DebugLogger, LogLevel, LogEntry};
pub use preemptive::{
PreemptiveCancellationToken,
DeadlineGuard,
Preempted,
with_deadline,
};
pub use dynamic_priority::{
DynamicPriorityScheduler,
SharedDynamicScheduler,
PriorityHandle,
EscalationPolicy,
};
pub use hwloc_topology::{
TopologyProvider,
HwTopology,
HwlocWorkerAffinity,
AffinityStrategy,
CacheInfo,
PackageInfo,
BindError,
};
#[cfg(feature = "async")]
pub use async_executor::AsyncExecutor;
pub use gpu::{GpuDevice, GpuBuffer, GpuTaskConfig};
pub use gpu_stream::{GpuStream, StreamPool, StreamSet, StreamGuard, StreamAssignment};
pub use gpu_backend::{BackendKind, GpuError};
pub use algorithms::{
parallel_for_each,
parallel_reduce,
parallel_transform,
parallel_sort,
parallel_inclusive_scan,
parallel_exclusive_scan,
};
pub mod dashboard;
pub mod flamegraph;
pub mod regression;
pub use dashboard::{DashboardConfig, DashboardHandle, DashboardServer};
pub use flamegraph::{FlamegraphConfig, FlamegraphGenerator};
pub use regression::{
Baseline, MetricComparison, RegressionDetector, RegressionReport, RegressionThresholds,
Severity, Violation,
};
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_simple_taskflow() {
let mut executor = Executor::new(4);
let mut taskflow = Taskflow::new();
let a = taskflow.emplace(|| {
println!("Task A");
}).name("A");
let b = taskflow.emplace(|| {
println!("Task B");
}).name("B");
a.precede(&b);
executor.run(&taskflow).wait();
}
#[test]
fn test_preemptive_cancellation_export() {
let token = PreemptiveCancellationToken::new();
assert!(!token.is_cancelled());
token.cancel();
assert!(token.is_cancelled());
}
#[test]
fn test_dynamic_priority_export() {
let sched = SharedDynamicScheduler::new();
let handle = sched.push(1, Priority::Low);
handle.reprioritize(Priority::Critical);
assert_eq!(sched.pop(), Some(1));
}
#[test]
fn test_hwloc_topology_export() {
let topo = TopologyProvider::detect();
assert!(topo.cpu_count() >= 1);
}
}