# Struct ocl::Platform [−] [src]

    #[repr(C)]
    pub struct Platform(_);

A platform identifier.

## Methods

### `impl Platform`
[src]

####
ⓘImportant traits for Vec<u8>

### Important traits for Vec<u8>

`impl Write for Vec<u8>`
`pub fn list() -> Vec<Platform>`
[src]

Returns a list of all platforms avaliable on the host machine.

#### `pub fn first() -> OclResult<Platform>`
[src]

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.

#### `pub fn new(id_core: PlatformIdCore) -> Platform`
[src]

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.

####
ⓘImportant traits for Vec<u8>

### Important traits for Vec<u8>

`impl Write for Vec<u8>`
`pub fn list_from_core(platforms: Vec<PlatformIdCore>) -> Vec<Platform>`
[src]

Returns a list of `Platform`s from a list of `PlatformIdCore`s

#### `pub fn info(&self, info_kind: PlatformInfo) -> OclCoreResult<PlatformInfoResult>`
[src]

Returns info about the platform.

#### `pub fn profile(&self) -> OclCoreResult<String>`
[src]

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.

#### `pub fn version(&self) -> OclCoreResult<String>`
[src]

Returns the platform driver version as a string.

Returns the OpenCL version supported by the implementation. This version string has the following format:

- OpenCL<space><major_version.minor_version><space><platform-specific information>

- The major_version.minor_version value returned will be '1.2'.

- TODO: Convert this to new version system returning an `OpenclVersion`.

#### `pub fn name(&self) -> OclCoreResult<String>`
[src]

Returns the platform name as a string.

#### `pub fn vendor(&self) -> OclCoreResult<String>`
[src]

Returns the platform vendor as a string.

#### `pub fn extensions(&self) -> OclCoreResult<Extensions>`
[src]

Returns the list of platform extensions.

Extensions defined here must be supported by all devices associated with this platform.

#### `pub fn as_core(&self) -> &PlatformIdCore`
[src]

Returns a reference to the underlying `PlatformIdCore`.

## Methods from Deref<Target = PlatformIdCore>

#### `pub fn as_ptr(&self) -> *mut c_void`
[src]

Returns a pointer.

#### `pub fn version(&self) -> Result<OpenclVersion, Error>`
[src]

Returns the queried and parsed OpenCL version for this platform.

## Trait Implementations

### `impl Clone for Platform`
[src]

#### `fn clone(&self) -> Platform`
[src]

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0
[src]

Performs copy-assignment from `source`. Read more

### `impl Copy for Platform`
[src]

### `impl Debug for Platform`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl ClPlatformIdPtr for Platform`
[src]

#### `fn as_ptr(&self) -> cl_platform_id`
[src]

### `impl Default for Platform`
[src]

#### `fn default() -> Platform`
[src]

Returns the first (0th) platform available, or the platform specified by the `OCL_DEFAULT_PLATFORM_IDX` environment variable if it is set.

### Panics

Panics upon any OpenCL API error.

### `impl From<PlatformIdCore> for Platform`
[src]

#### `fn from(core: PlatformIdCore) -> Platform`
[src]

Performs the conversion.

### `impl From<Platform> for String`
[src]

#### `fn from(p: Platform) -> String`
[src]

Performs the conversion.

### `impl From<Platform> for PlatformIdCore`
[src]

#### `fn from(p: Platform) -> PlatformIdCore`
[src]

Performs the conversion.

### `impl<'a> From<&'a Platform> for PlatformIdCore`
[src]

#### `fn from(p: &Platform) -> PlatformIdCore`
[src]

Performs the conversion.

### `impl Display for Platform`
[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl Deref for Platform`
[src]

#### `type Target = PlatformIdCore`

The resulting type after dereferencing.

#### `fn deref(&self) -> &PlatformIdCore`
[src]

Dereferences the value.

### `impl DerefMut for Platform`
[src]

#### `fn deref_mut(&mut self) -> &mut PlatformIdCore`
[src]

Mutably dereferences the value.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)