Commit 2b11e197 authored by Sven Liefgen's avatar Sven Liefgen
Browse files

Clean up unused warnings if disabled

parent c24c5388
use std::convert::AsRef;
use std::io::prelude::*;
use std::sync::atomic::AtomicPtr;
use std::sync::atomic::Ordering;
#[cfg(feature = "xlap")]
use std::{
convert::AsRef,
io::prelude::*,
sync::atomic::{AtomicPtr, Ordering},
};
use std::time::Instant;
#[cfg(feature = "xlap")]
use strum::{AsRefStr, EnumCount, EnumIter, IntoEnumIterator};
// Include the correct function for cycle counts depending on the architecture
#[cfg(target_arch = "x86")]
#[cfg(all(target_arch = "x86", feature = "xlap"))]
use core::arch::x86::_rdtsc as current_cycle;
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", feature = "xlap"))]
use core::arch::x86_64::_rdtsc as current_cycle;
// On all other architectures there is no cycle counting, so just set it to zero
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
#[cfg(all(not(any(target_arch = "x86", target_arch = "x86_64")), feature = "xlap"))]
#[inline(always)]
pub unsafe fn current_cycle() -> u64 {
0
......@@ -41,6 +44,7 @@ include!(concat!(env!("OUT_DIR"), "/xlap_generated.rs"));
// ---------------------------------------------
/// A moment in time, expressed in cycles and time
#[cfg(feature = "xlap")]
struct Timestamp {
c: u64,
t: Instant,
......@@ -205,9 +209,9 @@ macro_rules! kind {
( $kind:expr ) => {
{
#[cfg(feature = "xlap")]
$kind
{ $kind }
#[cfg(not(feature = "xlap"))]
$crate::Kind::NoKind
{ $crate::Kind::NoKind }
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment