use crate::HostTypes;
pub trait AddressRegion<H: HostTypes> {
type RegionBound: RegionBound<H>;
fn region_bound(&self) -> &Self::RegionBound;
type LocalityMetric: LocalityMetric<H>;
fn locality_metric(&self) -> &Self::LocalityMetric;
fn region_cardinality(&self) -> u64;
}
pub trait RegionBound<H: HostTypes> {
type Element: crate::kernel::address::Element<H>;
fn region_lower(&self) -> &Self::Element;
fn region_upper(&self) -> &Self::Element;
}
pub trait LocalityMetric<H: HostTypes>: crate::bridge::observable::MetricObservable<H> {}
pub trait WorkingSet<H: HostTypes> {
type AddressRegion: AddressRegion<H>;
fn working_set_regions(&self) -> &[Self::AddressRegion];
type ReductionStep: crate::kernel::reduction::ReductionStep<H>;
fn working_set_stage(&self) -> &Self::ReductionStep;
type TypeDefinition: crate::user::type_::TypeDefinition<H>;
fn working_set_type(&self) -> &Self::TypeDefinition;
fn working_set_size(&self) -> u64;
}
pub trait RegionAllocation<H: HostTypes> {
type ReductionStep: crate::kernel::reduction::ReductionStep<H>;
fn allocation_stage(&self) -> &[Self::ReductionStep];
type WorkingSet: WorkingSet<H>;
fn allocation_working_set(&self) -> &[Self::WorkingSet];
}