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