pub trait LaunchableMem {
type Item;
fn as_launchable_ptr(&self) -> LaunchablePtr<Self::Item>;
fn as_launchable_slice(&self) -> LaunchableSlice<'_, Self::Item>;
fn as_launchable_mut_ptr(&mut self) -> LaunchableMutPtr<Self::Item>;
fn as_launchable_mut_slice(&mut self) -> LaunchableMutSlice<'_, Self::Item>;
}
Expand description
GPU-accessible memory.
By implementing LaunchableMem
for a type, you specify that the memory can
be directly accessed on the GPU.
Associated Types
Required methods
fn as_launchable_ptr(&self) -> LaunchablePtr<Self::Item>
fn as_launchable_ptr(&self) -> LaunchablePtr<Self::Item>
Returns a launchable pointer to the beginning of the memory range.
fn as_launchable_slice(&self) -> LaunchableSlice<'_, Self::Item>
fn as_launchable_slice(&self) -> LaunchableSlice<'_, Self::Item>
Returns a launchable slice to the entire memory range.
fn as_launchable_mut_ptr(&mut self) -> LaunchableMutPtr<Self::Item>
fn as_launchable_mut_ptr(&mut self) -> LaunchableMutPtr<Self::Item>
Returns a launchable mutable pointer to the beginning of the memory range.
fn as_launchable_mut_slice(&mut self) -> LaunchableMutSlice<'_, Self::Item>
fn as_launchable_mut_slice(&mut self) -> LaunchableMutSlice<'_, Self::Item>
Returns a launchable mutable slice to the entire memory range.
Implementations on Foreign Types
sourceimpl<'a, T> LaunchableMem for [T]
impl<'a, T> LaunchableMem for [T]
Directly derefencing a main-memory slice on the GPU requires that the GPU has cache-coherent access to main-memory. For example, on POWER9 and Tesla V100 with NVLink 2.0.
On non-cache-coherent GPUs, derefencing main-memory will lead to a segmentation fault!