Struct microbench::tlb_latency::gpu_tlb_latency::GpuTlbLatency
source · [−]pub(super) struct GpuTlbLatency {
module: Module,
_context: Context,
device_id: u32,
template: DataPoint,
nvml: NVML,
}
Fields
module: Module
_context: Context
device_id: u32
template: DataPoint
nvml: NVML
Implementations
sourceimpl GpuTlbLatency
impl GpuTlbLatency
pub(super) fn new(device_id: u32, template: DataPoint) -> Result<Self, Error>
fn load_module() -> Result<Module, Error>
pub(super) fn measure(
&self,
mem_type: MemType,
ranges: RangeInclusive<usize>,
strides: &[usize],
do_iotlb_flush: bool
) -> Result<Vec<DataPoint>, Error>
sourcefn cycle_counter_overhead(&self) -> Result<u32, Error>
fn cycle_counter_overhead(&self) -> Result<u32, Error>
Measures the overhead of get_clock()
in cycles
get_clock()
is implemented as a native special register on each
architecture. See the documentation in the CUDA module for details.
sourcefn write_strides(
data: &mut [u64],
stride_bytes: usize,
old_len: Option<usize>
) -> usize
fn write_strides(
data: &mut [u64],
stride_bytes: usize,
old_len: Option<usize>
) -> usize
Initializes a slice with strides
After initialization, each element of the slice contains the position of
its successor. For example, element 4
points to element 8
if the
stride is 4
(as measured in size_of::<Position>()
).
If the slice is being resized without changing the stride, then
old_len
may be set to specify the previous slice length to reduce
initialization time.
sourcefn flush_cpu_tlb(data: &[u64]) -> Result<(), Error>
fn flush_cpu_tlb(data: &[u64]) -> Result<(), Error>
Flushes the CPU’s TLB
The flush is atomic and system-wide. The flush also includes the IOTLB.
For a high-level description, refer to the book Gorman “Understanding the Linux Virtual Memory Manager” p. 44, Table 3.2“
For the code, see the Linux kernel: https://code.woboq.org/linux/linux/mm/hugetlb.c.html#hugetlb_change_protection
Trait Implementations
sourceimpl Debug for GpuTlbLatency
impl Debug for GpuTlbLatency
Auto Trait Implementations
impl !RefUnwindSafe for GpuTlbLatency
impl !Send for GpuTlbLatency
impl !Sync for GpuTlbLatency
impl Unpin for GpuTlbLatency
impl !UnwindSafe for GpuTlbLatency
Blanket Implementations
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
pub fn approx_from(
src: Src
) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
pub fn approx_from(
src: Src
) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
pub fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
pub fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ConvUtil for T
impl<T> ConvUtil for T
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
Approximate the subject to a given type with the default scheme.
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
impl<T> Pointable for T
impl<T> Pointable for T
impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
pub fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
pub fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
impl<Src, Dst> ValueInto<Dst> for Src where
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Src where
Dst: ValueFrom<Src>,
type Err = <Dst as ValueFrom<Src>>::Err
type Err = <Dst as ValueFrom<Src>>::Err
The error type produced by a failed conversion.
pub fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
pub fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.