#[repr(C)]pub struct Target { /* private fields */ }Implementations§
Source§impl Target
impl Target
Sourcepub fn new(target: &str) -> Result<Self>
pub fn new(target: &str) -> Result<Self>
The target a tag ("nvidia/nvidia-a100"), a kind name ("llvm") or a JSON config
describes (target.Target).
Sourcepub fn from_config(config: &Map<String, Any>) -> Result<Self>
pub fn from_config(config: &Map<String, Any>) -> Result<Self>
The target a config map describes, such as {"kind": "cuda", "arch": "sm_80"} or a tag
with attribute overrides (target.Target).
The two-target form of target.Target, a target with a host, is Target::with_host.
Sourcepub fn scope(&self) -> Result<TargetScope>
pub fn scope(&self) -> Result<TargetScope>
Make this the current target until the returned scope is dropped
(target.TargetEnterScope, target.TargetExitScope).
Sourcepub fn current(allow_none: bool) -> Result<Option<Self>>
pub fn current(allow_none: bool) -> Result<Option<Self>>
The innermost current target; without one, None if allow_none, else an error
(target.TargetCurrent).
Sourcepub fn export(&self) -> Result<Map<String, Any>>
pub fn export(&self) -> Result<Map<String, Any>>
The config map that describes the target (target.TargetExport).
Sourcepub fn with_host(&self, host: Option<&Target>) -> Result<Self>
pub fn with_host(&self, host: Option<&Target>) -> Result<Self>
A copy of the target with host as its host, or none (target.WithHost).
Sourcepub fn get_target_device_type(&self) -> Result<i32>
pub fn get_target_device_type(&self) -> Result<i32>
The DLDeviceType of the devices the target runs on (target.TargetGetDeviceType).
Sourcepub fn feature(&self, name: &str) -> Result<Any>
pub fn feature(&self, name: &str) -> Result<Any>
The feature.<name> attribute of the target, None when it has none
(target.TargetGetFeature).
Sourcepub fn list_kinds() -> Result<Array<String>>
pub fn list_kinds() -> Result<Array<String>>
The names of the registered target kinds (target.ListTargetKinds).
Trait Implementations§
Source§impl AnyCompatible for Target
impl AnyCompatible for Target
Source§unsafe fn is_undefined(field: *const Self) -> bool
unsafe fn is_undefined(field: *const Self) -> bool
field, which holds a value of this type or all-zero bytes,
holds all-zero bytes that are no value of this type, as a null object
reference, a string of type index None or a zero device type: a field
that a creator left undefined for reflection to set, as C++ UnsafeInit
leaves a reference undefined (null). Unlike a C++ undefined reference,
it is no value; a nullable reference is Option<T>, whose None is a
defined value. Read moreSource§unsafe fn copy_to_any_view(src: &Self, data: &mut TVMFFIAny)
unsafe fn copy_to_any_view(src: &Self, data: &mut TVMFFIAny)
unsafe fn check_any_strict(data: &TVMFFIAny) -> bool
Source§unsafe fn copy_from_any_view_after_check(data: &TVMFFIAny) -> Self
unsafe fn copy_from_any_view_after_check(data: &TVMFFIAny) -> Self
Source§unsafe fn move_to_any(src: Self, data: &mut TVMFFIAny)
unsafe fn move_to_any(src: Self, data: &mut TVMFFIAny)
Source§unsafe fn move_from_any_after_check(data: &mut TVMFFIAny) -> Self
unsafe fn move_from_any_after_check(data: &mut TVMFFIAny) -> Self
Source§unsafe fn try_cast_from_any_view(data: &TVMFFIAny) -> Result<Self, ()>
unsafe fn try_cast_from_any_view(data: &TVMFFIAny) -> Result<Self, ()>
Source§fn get_mismatch_type_info(data: &TVMFFIAny) -> String
fn get_mismatch_type_info(data: &TVMFFIAny) -> String
Source§fn type_schema() -> String
fn type_schema() -> String
TypeTraits<T>::TypeSchema writes, which the type schemas of functions
and fields embed. Read moreSource§impl<'a> ArgIntoRef for &'a Target
impl<'a> ArgIntoRef for &'a Target
Source§impl ArgIntoRef for Target
impl ArgIntoRef for Target
Source§impl<'a> IntoArgHolder for &'a Target
impl<'a> IntoArgHolder for &'a Target
Source§impl IntoArgHolder for Target
impl IntoArgHolder for Target
Source§impl ObjectRefCore for Target
impl ObjectRefCore for Target
type ContainerType = <ObjectArc<TargetObj> as Deref>::Target
fn data(this: &Self) -> &ObjectArc<Self::ContainerType>
fn into_data(this: Self) -> ObjectArc<Self::ContainerType>
Source§unsafe fn from_data(data: ObjectArc<Self::ContainerType>) -> Self
unsafe fn from_data(data: ObjectArc<Self::ContainerType>) -> Self
Source§fn same_as<Other>(&self, other: &Other) -> boolwhere
Other: ObjectRefCore,
fn same_as<Other>(&self, other: &Other) -> boolwhere
Other: ObjectRefCore,
Source§fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectCore,
fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectCore,
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnwindSafe for Target
Blanket Implementations§
Source§impl<T> ArgType for Twhere
T: ObjectRefCore + AnyCompatible + 'static,
impl<T> ArgType for Twhere
T: ObjectRefCore + AnyCompatible + 'static,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ObjectRefCast for Twhere
T: ObjectRefCore + AnyCompatible,
impl<T> ObjectRefCast for Twhere
T: ObjectRefCore + AnyCompatible,
Source§fn try_cast<B>(self) -> Result<B, Error>where
B: ObjectRefCore + AnyCompatible,
fn try_cast<B>(self) -> Result<B, Error>where
B: ObjectRefCore + AnyCompatible,
self and rewrap the underlying object as B without copying.