Skip to content

Detect address stability in thrust::transform for generic known function objects #2799

Closed as not planned

Description

@bernhardmgruber

thrust::transform can take a better code path if it knows that the transformation function is not relying on the address of its arguments. We can detect this for generic/transparent function objects (e.g. thrust::plus<void>) by detecting that:

  1. the function object is a known generic/transparent function object. We thus know it's behavior and the signature of operator().
  2. the argument types (which we can infer from the iterator value types) cannot have an operator+() etc. that could rely on the address. this holds for built-in and known types like float or thrust::complex<float>.

Activity

  1. changed the title [-]Detect address stability for transparent known function objects[/-] [+]Detect address stability in `thrust::transform` for transparent known function objects[/+] on Nov 13, 2024
  2. changed the title [-]Detect address stability in `thrust::transform` for transparent known function objects[/-] [+]Detect address stability in `thrust::transform` for generic known function objects[/+] on Nov 13, 2024
  3. bernhardmgruber commented on Jan 16, 2026

    @bernhardmgruber
    ContributorAuthor

    This will become irrelevant once we provide cuda::std::transform which does not promise address stability. If time permits, we could implement better detection here, but I guess our time is better spent elsewhere.

    I'll leave the issue open until we have cuda::std::transform.

  4. bernhardmgruber commented on Feb 27, 2026

    @bernhardmgruber
    ContributorAuthor

    Made irrelevant by cuda::std::transform.

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
    Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions