Skip to content

[BUG]: BlockAdjacentDifference requests 2x the shared memory actually needed #3711

@pauleonix

Description

@pauleonix

Is this a duplicate?

Type of Bug

Performance

Component

CUB

Describe the bug

Looking at

struct _TempStorage
{
T first_items[BLOCK_THREADS];
T last_items[BLOCK_THREADS];
};
and the at all the member functions, it seems like none of them is using both first_items and last_items, i.e. a single array halo_items or similar would suffice. The unnecessary amount of requested shared memory can in practice result in reduced occupancy and therefore worse performance.

How to Reproduce

Not applicable.

Expected behavior

BlockAdjacentDifference should only request as much shared memory as it actually needs.

Reproduction link

No response

Operating System

No response

nvidia-smi output

No response

NVCC version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working right.

    Type

    No type

    Projects

    Status

    In Review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions