#[repr(C)]pub struct GpuGrid {
pub packed_key_to_active_block: GridHashMap,
pub dispatch_block_to_active_block: DevicePointer<DispatchBlock2ActiveBlock>,
pub dispatch_halo_block_to_active_block: DevicePointer<DispatchBlock2ActiveBlock>,
/* private fields */
}
Fields§
§packed_key_to_active_block: GridHashMap
§dispatch_block_to_active_block: DevicePointer<DispatchBlock2ActiveBlock>
§dispatch_halo_block_to_active_block: DevicePointer<DispatchBlock2ActiveBlock>
Implementations§
Source§impl GpuGrid
impl GpuGrid
Sourcepub unsafe fn new(
cell_width: Real,
capacity: u64,
buffer: DevicePointer<GpuGridNode>,
active_blocks: DevicePointer<ActiveBlockHeader>,
num_active_blocks: DevicePointer<u32>,
dispatch_block_to_active_block: DevicePointer<DispatchBlock2ActiveBlock>,
dispatch_halo_block_to_active_block: DevicePointer<DispatchBlock2ActiveBlock>,
packed_key_to_active_block: GridHashMap,
) -> Self
pub unsafe fn new( cell_width: Real, capacity: u64, buffer: DevicePointer<GpuGridNode>, active_blocks: DevicePointer<ActiveBlockHeader>, num_active_blocks: DevicePointer<u32>, dispatch_block_to_active_block: DevicePointer<DispatchBlock2ActiveBlock>, dispatch_halo_block_to_active_block: DevicePointer<DispatchBlock2ActiveBlock>, packed_key_to_active_block: GridHashMap, ) -> Self
Creates a new GPU grid.
The input buffer must be a valid pointer to a buffer able to hold exactly capacity
grid nodes.
pub fn capacity(&self) -> usize
pub fn cell_width(&self) -> Real
pub unsafe fn dispatch_block_to_active_block_unchecked( &self, dispatch_block_id: usize, ) -> DispatchBlock2ActiveBlock
pub unsafe fn dispatch_block_to_active_block_unchecked_mut( &mut self, dispatch_block_id: usize, ) -> &mut DispatchBlock2ActiveBlock
pub unsafe fn active_block_unchecked( &self, block_id: BlockHeaderId, ) -> &ActiveBlockHeader
pub unsafe fn active_block_unchecked_mut( &mut self, block_id: BlockHeaderId, ) -> &mut ActiveBlockHeader
pub fn num_active_blocks(&self) -> u32
pub fn num_active_blocks_mut(&mut self) -> &mut u32
pub fn block_associated_to_point(&self, pt: &Point<Real>) -> BlockVirtualId
pub fn blocks_associated_to_point( &self, pt: &Point<Real>, ) -> [BlockVirtualId; 4]
pub fn blocks_associated_to_block(block: Vector<usize>) -> [BlockVirtualId; 4]
pub fn blocks_transferring_into_block( block: Vector<usize>, ) -> [BlockVirtualId; 4]
pub fn mark_block_as_active(&mut self, virtual_id: BlockVirtualId)
pub unsafe fn get_packed_block_mut( &mut self, id: BlockVirtualId, ) -> Option<&mut ActiveBlockHeader>
pub unsafe fn get_header_block_id( &self, id: BlockVirtualId, ) -> Option<BlockHeaderId>
pub unsafe fn get_node_unchecked(&self, id: NodePhysicalId) -> &GpuGridNode
pub fn get_node(&self, id: NodePhysicalId) -> Option<&GpuGridNode>
pub fn get_node_mut(&mut self, id: NodePhysicalId) -> Option<&mut GpuGridNode>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuGrid
impl RefUnwindSafe for GpuGrid
impl !Send for GpuGrid
impl !Sync for GpuGrid
impl Unpin for GpuGrid
impl UnwindSafe for GpuGrid
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DeviceCopyExt for Twhere
T: DeviceCopy,
impl<T> DeviceCopyExt for Twhere
T: DeviceCopy,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.