Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Fix segmented sort compilation in case of windows.h #423

Merged

Conversation

gevtushenko
Copy link
Collaborator

This PR fixes the issue related to device segmented sort compilation in the presence of windows.h header.

@@ -42,5 +42,6 @@
// projects build with NOMINMAX this doesn't seem to be high priority to fix.
//#define min(...) CUB_MACRO_CHECK('min', windows.h)
//#define max(...) CUB_MACRO_CHECK('max', windows.h)
#define small CUB_MACRO_CHECK('small', windows.h)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you push a PR to add this to Thrust, too?

Copy link
Collaborator Author

@gevtushenko gevtushenko Jan 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, here it is!

@alliepiper alliepiper added the P1: should have Necessary, but not critical. label Jan 19, 2022
@alliepiper alliepiper added this to the 1.16.0 milestone Jan 19, 2022
@alliepiper alliepiper force-pushed the fix-main/github/seg_sort_windows_h branch from 8426302 to c6e338d Compare January 19, 2022 20:14
@alliepiper
Copy link
Collaborator

Rebased to pull in CI fixes.

@alliepiper alliepiper assigned alliepiper and unassigned gevtushenko Jan 19, 2022
alliepiper added a commit to alliepiper/thrust that referenced this pull request Jan 19, 2022
@alliepiper alliepiper added testing: gpuCI in progress Started gpuCI testing. testing: internal ci in progress Currently testing on internal NVIDIA CI (DVS). labels Jan 19, 2022
@alliepiper
Copy link
Collaborator

gpuCI: NVIDIA/thrust#1594
DVS CL: 30893058

@JackBoosY
Copy link

Which CUDA version will incorporate this modification?

@alliepiper
Copy link
Collaborator

Which CUDA version will incorporate this modification?

The remaining CUDA 11.X releases will ship CUB 1.15.X. Regular updates of Thrust and CUB in CTK will resume after the next major version bump, so this patch (which landed in CUB 1.16) will be available in CTK 12.

@nietras
Copy link

nietras commented Jun 2, 2023

@senior-zero I am hitting this issue with CUDA 11.8 on Visual Studio 2022 (v143), how do I resolve this issue for that when apparently CUB 1.16 is only first available in CUDA 12.x? If I understand this correctly?

1>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(338): error : invalid combination of type specifiers
1>
1>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(338): error : expected an identifier
1>
1>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(379): error : expected a member name

@nietras
Copy link

nietras commented Jun 2, 2023

Including the following at top of file where this was causing the issue (or in stdafx.h) appears to resolve.

#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX
#include "Windows.h"
#endif

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1: should have Necessary, but not critical. testing: gpuCI in progress Started gpuCI testing. testing: internal ci in progress Currently testing on internal NVIDIA CI (DVS).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CUB 1.15.0 compilation errors if included after Windows.h
4 participants