Skip to content

GCC 13 compilation error for parallel LSD radix sort #1

@gtkramer

Description

@gtkramer

I am using GCC 13.2 with oneTBB 2021.11.0 on Linux to build this code, which looks like it meets the requirements of having a C++ 20-compliant compiler and a current version of oneTBB. When I do this, however, I'm getting the following compilation error:

In file included from /ParallelAlgorithms/ParallelMergeSort.h:29,
                 from /ParallelAlgorithms/RadixSortLSD.h:11,
                 from /ParallelAlgorithms/RadixSortLsdBenchmark.cpp:11:
/ParallelAlgorithms/RadixSortLsdParallel.h: In instantiation of ‘void ParallelAlgorithms::_RadixSortLSD_StableUnsigned_PowerOf2RadixParallel_TwoPhase_DeRandomize(unsigned int*, unsigned int*, size_t, unsigned int, unsigned int, bool) [with long unsigned int PowerOfTwoRadix = 256; long unsigned int Log2ofPowerOfTwoRadix = 8; long int Threshold = 100; size_t = long unsigned int]’:
/ParallelAlgorithms/RadixSortLsdParallel.h:500:128:   required from here
/ParallelAlgorithms/RadixSortLsdParallel.h:469:153: error: ‘_RadixSortLSD_StableUnsigned_PowerOf2Radix_PermuteDerandomized’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  469 |                         _RadixSortLSD_StableUnsigned_PowerOf2Radix_PermuteDerandomized< PowerOfTwoRadix, Log2ofPowerOfTwoRadix, Threshold, bufferDepth >(
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  470 |                                 _input_array, _output_array, 0, last, bitMask, shiftRightAmount, endOfBin, bufferIndex, bufferDerandomize);
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~               
/ParallelAlgorithms/RadixSortLSD.h:135:13: note: ‘template<long unsigned int PowerOfTwoRadix, long unsigned int Log2ofPowerOfTwoRadix, long int Threshold, long unsigned int BufferDepth> void _RadixSortLSD_StableUnsigned_PowerOf2Radix_PermuteDerandomized(unsigned int*, unsigned int*, size_t, size_t, unsigned int, long unsigned int, size_t*, size_t*, unsigned int (*)[BufferDepth])’ declared here, later in the translation unit
  135 | inline void _RadixSortLSD_StableUnsigned_PowerOf2Radix_PermuteDerandomized(unsigned* input_array, unsigned* output_array, size_t startIndex, size_t endIndex, unsigned bitMask, unsigned long shiftRightAmount,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This looks like an error related to the order of declaration and the point of instantiation for _RadixSortLSD_StableUnsigned_PowerOf2Radix_PermuteDerandomized. However, I can't quite put my finger on this one as to what the issue is because the RadixSortLSD.h header is already included in RadixSortLsdParallel.h.

I wonder if it has something to do with RadixSortLsdBenchmark.cpp needing RadixSortLSD.h needing ParallelMergeSort.h needing RadixSortLsdParallel.h needing the RadixSortLSD.h header again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions