pub struct GpuWeightSlots { /* private fields */ }Expand description
Device-resident mapping from neural output slots to CNF variable ids.
Slots are grouped (one group per neural predicate instance). Each slot is a CNF var id (DIMACS, 1-based) whose log-weights should be updated from the group’s probability vector.
Implementations§
Source§impl GpuWeightSlots
impl GpuWeightSlots
Sourcepub fn upload(
provider: &CudaKernelProvider,
groups: &[Vec<u32>],
) -> Result<Self>
pub fn upload( provider: &CudaKernelProvider, groups: &[Vec<u32>], ) -> Result<Self>
Upload a slot mapping from host vectors.
groups[g][i] is the CNF variable id corresponding to label/slot i of group g.
Sourcepub fn num_groups(&self) -> u32
pub fn num_groups(&self) -> u32
Returns the number of neural-output groups as a GPU-sized count.
Sourcepub fn num_groups_usize(&self) -> usize
pub fn num_groups_usize(&self) -> usize
Returns the number of neural-output groups as a host index.
Sourcepub fn total_slots(&self) -> u32
pub fn total_slots(&self) -> u32
Returns the total number of mapped neural output slots.
Sourcepub fn group_offsets(&self) -> &TrackedCudaSlice<u32>
pub fn group_offsets(&self) -> &TrackedCudaSlice<u32>
Returns the device-resident CSR offsets for all groups.
Sourcepub fn slot_cnf_var(&self) -> &TrackedCudaSlice<u32>
pub fn slot_cnf_var(&self) -> &TrackedCudaSlice<u32>
Returns the device-resident CNF variable identifier for every slot.
Sourcepub fn group_slot_cnf_var(
&self,
group_idx: usize,
) -> Result<DeviceMemoryView<u32>>
pub fn group_slot_cnf_var( &self, group_idx: usize, ) -> Result<DeviceMemoryView<u32>>
Device view over slot_cnf_var for a single group.
Auto Trait Implementations§
impl Freeze for GpuWeightSlots
impl RefUnwindSafe for GpuWeightSlots
impl Send for GpuWeightSlots
impl Sync for GpuWeightSlots
impl Unpin for GpuWeightSlots
impl UnsafeUnpin for GpuWeightSlots
impl UnwindSafe for GpuWeightSlots
Blanket Implementations§
impl<T> Allocation for T
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