#[repr(C)]pub struct Platform(/* private fields */);
Expand description
A platform identifier.
Implementations§
source§impl Platform
impl Platform
sourcepub fn first() -> OclResult<Platform>
pub fn first() -> OclResult<Platform>
Returns the first available platform.
This method differs from Platform::default()
in two ways. First, it
ignores the OCL_DEFAULT_PLATFORM_IDX
environment variable
(Platform::default
always respects it). Second, this function will
not panic if no platforms are available but will instead return an
error.
sourcepub fn new(id_core: PlatformIdCore) -> Platform
pub fn new(id_core: PlatformIdCore) -> Platform
Creates a new Platform
from a PlatformIdCore
.
§Safety
Not meant to be called unless you know what you’re doing.
Use list to get a list of platforms.
sourcepub fn list_from_core(platforms: Vec<PlatformIdCore>) -> Vec<Platform>
pub fn list_from_core(platforms: Vec<PlatformIdCore>) -> Vec<Platform>
Returns a list of Platform
s from a list of PlatformIdCore
s
sourcepub fn info(&self, info_kind: PlatformInfo) -> OclResult<PlatformInfoResult>
pub fn info(&self, info_kind: PlatformInfo) -> OclResult<PlatformInfoResult>
Returns info about the platform.
sourcepub fn profile(&self) -> OclResult<String>
pub fn profile(&self) -> OclResult<String>
Returns the platform profile as a string.
Returns the profile name supported by the implementation. The profile name returned can be one of the following strings:
-
FULL_PROFILE - if the implementation supports the OpenCL specification (functionality defined as part of the core specification and does not require any extensions to be supported).
-
EMBEDDED_PROFILE - if the implementation supports the OpenCL embedded profile. The embedded profile is defined to be a subset for each version of OpenCL.
sourcepub fn version(&self) -> OclResult<String>
pub fn version(&self) -> OclResult<String>
Returns the platform driver version as a string.
Returns the OpenCL version supported by the implementation. This version string has the following format:
-
OpenCL
<major_version.minor_version> -
The major_version.minor_version value returned will be ‘1.2’.
-
TODO: Convert this to new version system returning an
OpenclVersion
.
sourcepub fn extensions(&self) -> OclResult<Extensions>
pub fn extensions(&self) -> OclResult<Extensions>
Returns the list of platform extensions.
Extensions defined here must be supported by all devices associated with this platform.
sourcepub fn as_core(&self) -> &PlatformIdCore
pub fn as_core(&self) -> &PlatformIdCore
Returns a reference to the underlying PlatformIdCore
.
Methods from Deref<Target = PlatformIdCore>§
sourcepub fn version(&self) -> Result<OpenclVersion, Error>
pub fn version(&self) -> Result<OpenclVersion, Error>
Returns the queried and parsed OpenCL version for this platform.