Skip to content

Use cub::DeviceTransform::Transform in thrust::tabulate #5808

Closed

Activity

  1. changed the title [-]`tabulate`[/-] [+]Use `cub::DeviceTransform::Fill` in `thrust::tabulate` #5806[/+] on Sep 8, 2025
  2. changed the title [-]Use `cub::DeviceTransform::Fill` in `thrust::tabulate` #5806[/-] [+]Use `cub::DeviceTransform::Fill` in `thrust::tabulate`[/+] on Sep 8, 2025
  3. changed the title [-]Use `cub::DeviceTransform::Fill` in `thrust::tabulate`[/-] [+]Use `cub::DeviceTransform::Transform` in `thrust::tabulate`[/+] on Sep 8, 2025
  4. bernhardmgruber commented on Sep 8, 2025

    @bernhardmgruber
    ContributorAuthor

    So, this is a bit harder. We can express tabulate as a transformation of a counting iterator range to the output range. The counting iterator is not contiguous though, so we fall back to the prefetch algorithm. However, we want to use the vectorized storing from the vectorized algorithm.

    One way we can go forward is to allow non-contiguous iterators as input to the vectorized algorithm, where we would just load the data scalar by scalar. We may also want to combine the vectorized and prefetching algorithm, since the vectorized one already includes the prefetching one as a runtime fallback. However, the prefetching algorithm has the advantage of being runtime tuneable to achieve certain bytes in flight and thus a runtime number of elements per thread. Combining this may be difficult and time consuming.

  5. miscco commented on Sep 9, 2025

    @miscco
    Contributor

    Could we detect, whether the return value of iter is a reference and if not take the fast path anyway?

  6. bernhardmgruber commented on Sep 26, 2025

    @bernhardmgruber
    ContributorAuthor

    Could we detect, whether the return value of iter is a reference and if not take the fast path anyway?

    The check I chose is now whether the iterator is contiguous or not. I only regard contiguous iterators in inputs for whether we can vectorize loads or not. If the iterator is not contiguous, I just load it serially into a local array. Then I process serially and store vectors again if possible.

  7. moved this from Todo to In Review in CCCLon Sep 26, 2025
  8. moved this from In Review to Done in CCCLon Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions