Struct ocl_core::types::structs::OpenclVersion
source · pub struct OpenclVersion { /* private fields */ }
Expand description
Parsed OpenCL version in the layout ({major}, {minor})
.
ex.: ‘OpenCL 1.2’ -> OpenclVersion(1, 2)
.
Implementations
sourceimpl OpenclVersion
impl OpenclVersion
pub fn new(major: u16, minor: u16) -> OpenclVersion
pub fn max(&self) -> OpenclVersion
sourcepub fn from_info_str(ver: &str) -> OclCoreResult<OpenclVersion>
pub fn from_info_str(ver: &str) -> OclCoreResult<OpenclVersion>
Parse the string ver
and return a dual-integer result as
OpenclVersion
.
Looks for the sequence of chars, “OpenCL” (non-case-sensitive), then splits the word just after that (at ‘.’) and parses the two results into integers (major and minor version numbers).
Trait Implementations
sourceimpl Clone for OpenclVersion
impl Clone for OpenclVersion
sourcefn clone(&self) -> OpenclVersion
fn clone(&self) -> OpenclVersion
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for OpenclVersion
impl Debug for OpenclVersion
sourceimpl Display for OpenclVersion
impl Display for OpenclVersion
sourceimpl From<[u16; 2]> for OpenclVersion
impl From<[u16; 2]> for OpenclVersion
sourcefn from(ver: [u16; 2]) -> OpenclVersion
fn from(ver: [u16; 2]) -> OpenclVersion
Converts to this type from the input type.
sourceimpl Ord for OpenclVersion
impl Ord for OpenclVersion
sourcefn cmp(&self, other: &OpenclVersion) -> Ordering
fn cmp(&self, other: &OpenclVersion) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<OpenclVersion> for OpenclVersion
impl PartialEq<OpenclVersion> for OpenclVersion
sourcefn eq(&self, other: &OpenclVersion) -> bool
fn eq(&self, other: &OpenclVersion) -> bool
sourceimpl PartialOrd<OpenclVersion> for OpenclVersion
impl PartialOrd<OpenclVersion> for OpenclVersion
sourcefn partial_cmp(&self, other: &OpenclVersion) -> Option<Ordering>
fn partial_cmp(&self, other: &OpenclVersion) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for OpenclVersion
impl Eq for OpenclVersion
impl StructuralEq for OpenclVersion
impl StructuralPartialEq for OpenclVersion
Auto Trait Implementations
impl RefUnwindSafe for OpenclVersion
impl Send for OpenclVersion
impl Sync for OpenclVersion
impl Unpin for OpenclVersion
impl UnwindSafe for OpenclVersion
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more