Skip to content

DeviceSegmentedRadixSortKernel uses volatile temporary storage #7846

@bernhardmgruber

Description

@bernhardmgruber

DeviceSegmentedRadixSortKernel uses volatile temporary storage:

__shared__ union
{
typename BlockUpsweepT::TempStorage upsweep;
typename BlockDownsweepT::TempStorage downsweep;
struct
{
volatile SegmentSizeT reverse_counts_in[RADIX_DIGITS];
volatile SegmentSizeT reverse_counts_out[RADIX_DIGITS];
typename DigitScanT::TempStorage scan;
};

This is at best a code smell, but probably either buggy and inefficient (disabled optimizations). The use of volatile should be replaced by proper loads and stores, atomic or regular, as needed and in accordance with the memory model.

Metadata

Metadata

Assignees

No one assigned

    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