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§
source§impl OpenclVersion
impl OpenclVersion
pub fn new(major: u16, minor: u16) -> OpenclVersion
pub fn max(&self) -> OpenclVersion
pub fn to_raw(&self) -> (u16, u16)
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§
source§impl Clone for OpenclVersion
impl Clone for OpenclVersion
source§fn clone(&self) -> OpenclVersion
fn clone(&self) -> OpenclVersion
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for OpenclVersion
impl Debug for OpenclVersion
source§impl Display for OpenclVersion
impl Display for OpenclVersion
source§impl Ord for OpenclVersion
impl Ord for OpenclVersion
source§fn cmp(&self, other: &OpenclVersion) -> Ordering
fn cmp(&self, other: &OpenclVersion) -> Ordering
1.21.0 · source§fn 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
source§impl PartialEq for OpenclVersion
impl PartialEq for OpenclVersion
source§fn eq(&self, other: &OpenclVersion) -> bool
fn eq(&self, other: &OpenclVersion) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for OpenclVersion
impl PartialOrd for OpenclVersion
source§fn partial_cmp(&self, other: &OpenclVersion) -> Option<Ordering>
fn partial_cmp(&self, other: &OpenclVersion) -> Option<Ordering>
1.0.0 · source§fn 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§
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
Mutably borrows from an owned value. Read more