Skip to content

Documentation (& code) regarding determining temp_storage_bytes not very clear #847

@eyalroz

Description

@eyalroz

I would like to be able to determine my device-wide primitive's temp_storage_bytes before I have all of the primitive's arguments ready. The interface for obtaining it ostensibly requires everything to be ready for the actual run - and the documentation does not make it clear what arguments it actually needs and what it's going to do with them (e.g. will it look at the input at all, in any way? Probably not, but who knows)

Also, delving into the source (in my case: dispatch_select_if.cuh), I see:

if (d_temp_storage == NULL)
{
    // Return if the caller is simply requesting the size of the storage allocation
    break;
}

which is super-weird. What if I passed a pointer to a size_t containing 2^64-1? Would my code be led to believe it has to allocate that much? Hmm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cubFor all items related to CUBgood first issueGood for newcomers.

    Type

    No type

    Projects

    Status

    In Review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions