[−][src]Struct rustacuda::function::Function
Handle to a global kernel function.
Methods
impl<'a> Function<'a>
[src]
pub fn get_attribute(&self, attr: FunctionAttribute) -> CudaResult<i32>
[src]
Returns information about a function.
Examples:
use rustacuda::function::FunctionAttribute; let function = module.get_function(&name)?; let shared_memory = function.get_attribute(FunctionAttribute::SharedMemorySizeBytes)?; println!("This function uses {} bytes of shared memory", shared_memory);
pub fn set_cache_config(&mut self, config: CacheConfig) -> CudaResult<()>
[src]
Sets the preferred cache configuration for this function.
On devices where L1 cache and shared memory use the same hardware resources, this sets the preferred cache configuration for this function. This is only a preference. The driver will use the requested configuration if possible, but is free to choose a different configuration if required to execute the function. This setting will override the context-wide setting.
This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
Example:
use rustacuda::context::CacheConfig; let mut function = module.get_function(&name)?; function.set_cache_config(CacheConfig::PreferL1)?;
pub fn set_shared_memory_config(
&mut self,
cfg: SharedMemoryConfig
) -> CudaResult<()>
[src]
&mut self,
cfg: SharedMemoryConfig
) -> CudaResult<()>
Sets the preferred shared memory configuration for this function.
On devices with configurable shared memory banks, this function will set this function's shared memory bank size which is used for subsequent launches of this function. If not set, the context-wide setting will be used instead.
Example:
use rustacuda::context::SharedMemoryConfig; let mut function = module.get_function(&name)?; function.set_shared_memory_config(SharedMemoryConfig::EightByteBankSize)?;
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,