pub struct PartitionedRelation<T: DeviceCopy> {
    pub relation: Mem<T>,
    pub offsets: Mem<u64>,
    /* private fields */
}
Expand description

A radix-partitioned relation, optionally with padding in front of each partition.

The relation supports chunking on a single GPU. E.g. in the Chunked algorithm, there is a chunk per thread block. In this case, chunks should equal the grid size.

Invariants

  • len must match in PartitionOffsets
  • radix_bits must match in GpuRadixPartitioner.
  • max_chunks must equal the maximum number of chunks computed at runtime (e.g., the grid size).

Fields

relation: Mem<T>offsets: Mem<u64>

Implementations

Creates a new partitioned relation, and automatically includes the necessary padding and metadata.

Returns the total number of elements in the relation (excluding padding).

Returns the total number of elements in the relation including padding.

Returns the total number of bytes used to store the relation (including metadata).

Returns the number of elements allocated in memory (excluding padding).

The capacity includes unused elements, but excludes padding.

Resizes the PartitionedRelation in-place so that len is equal to new_len.

If new_len is greater than the allocated memory capacity, then the resize will abort and return Err.

Post-conditions
  • The resize invalidates all data contained in relation and the offsets.
  • However, an aborted resize leaves PartitionedRelation intact and unmodified.

Returs the number of chunks.

Returns the number of partitions.

Returns the number of radix bits.

Returns the length of the requested partition.

If the offsets are accessible by the CPU (i.e., in DerefMem), then the length is returned. Otherwise, the function returns an error.

Returns the number of padding elements per partition.

Returns the internal representation of the relation data as a slice.

This function is intended for unit testing. Use the methods provided by the Index trait or chunks_mut() instead if possible.

The function is unsafe because:

  • the internal representation may change
  • padding may contain uninitialized memory.

Returns the internal representation of the relation data as a mutable slice.

This function is intended for unit testing. Use the methods provided by the Index trait or chunks_mut() instead if possible.

The function is unsafe because:

  • the internal representation may change
  • padding may contain uninitialized memory.

Returns an iterator over the chunks contained inside the relation.

Chunks are non-overlapping and can safely be used for parallel processing.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the specified chunk and partition as a subslice of the relation.

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Returns the specified chunk and partition as a mutable subslice of the relation.

Performs the mutable indexing (container[index]) operation. Read more

Lock memory

Unlock memory

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.