pub struct PartitionOffsets<T: DeviceCopy> { /* private fields */ }
Expand description

Partition offsets for an array of chunked partitions.

The offsets describe a PartitionedRelation. The offsets reference partitions within an array. Optionally, each partition includes padding.

Layout

The layout looks as follows (C = chunk, P = partition):

C0.P0 | C0.P1 | ... | C0.PN | C1.P0 | C1.P1 | ... | C1.PN | ... | CM.PN

Note that no restrictions are placed on the data layout (i.e., offsets may be numerically unordered).

offsets vs. local_offsets

Chunked prefix sums inherently have local offsets for each chunk. In contrast, contiguous histograms only have one set of “global” offsets.

The partitioning operator requires a set of local offsets for each chunk. Thus, the contiguous prefix sum variants output local_offsets in addition to the normal offsets.

Invariants

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

Implementations

Creates a new partition offsets array.

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

If the prefix sum is not yet computed, then None is returned.

Returns the total number of bytes used to store the offsets.

Returs the number of chunks.

Returns an iterator over the chunks contained inside the offsets.

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

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.

Trait Implementations

Formats the value using the given formatter. 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.