Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the residency of initial values for all Thrust/CUB APIs #2593

Open
leofang opened this issue Oct 17, 2024 · 5 comments
Open

Clarify the residency of initial values for all Thrust/CUB APIs #2593

leofang opened this issue Oct 17, 2024 · 5 comments

Comments

@leofang
Copy link
Member

leofang commented Oct 17, 2024

xref: #2335 (comment)

some API does support initial value in device memory, but most (reduce included) do not.

@jrhemstad
Copy link
Collaborator

@leofang
Copy link
Member Author

leofang commented Oct 17, 2024

The quote was from @gevtushenko not me. Looking at the doc you link, I can't tell where init should reside (host or device or either).

@jrhemstad
Copy link
Collaborator

I understand Georgii's quote and I'm saying our docs already make it clear. For reduce, init is passed by value so it doesn't really make sense to talk about where it resides.

@leofang
Copy link
Member Author

leofang commented Oct 17, 2024

I am only more confused then. So if we say T init implies a host value should be used (for which I agree), are there APIs that allow a device value?

some API does support initial value in device memory

Perhaps the answer is simply: cub::Device always takes a host init value, and anything below (cub::Block etc) always takes a device init value? (Not sure about Thrust.)

@jrhemstad
Copy link
Collaborator

I think @gevtushenko was referring to the overload of DeviceScan that takes a FutureValue argument as the initial value which is unique in accepting a potentially device resident value.

https://nvidia.github.io/cccl/cub/api/structcub_1_1DeviceScan.html?highlight=future#_CPPv4I000000EN3cub10DeviceScan13ExclusiveScanE11cudaError_tPvR6size_t14InputIteratorT15OutputIteratorT7ScanOpT11FutureValueI10InitValueT14InitValueIterTE9NumItemsT12cudaStream_t

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants