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

Fix build error for RandomBits #299

Closed
wants to merge 1 commit into from
Closed

Conversation

zasdfgbnm
Copy link
Contributor

I am unable to build cub on my configuration:

/home/gaoxiang/cub/test/test_util.h(635): error #20011-D: calling a __host__ function("void  ::RandomBits<int> (T1 &, int, int, int)") from a __host__ __device__ function("InitValue<int, float> ") is not allowed

My configuration:

gaoxiang@sunnyvale ~/cub/build build-error $ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Mar_21_19:15:46_PDT_2021
Cuda compilation tools, release 11.3, V11.3.58
Build cuda_11.3.r11.3/compiler.29745058_0

gaoxiang@sunnyvale ~/cub/build build-error $ g++ --version
g++ (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@@ -1,3 +1,4 @@
.p4config
*~
\#*
/build
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel this helpful. If you don't like it, I will revert it.

InitValue(gen_mode, value.value, index);

// Assign corresponding flag with a likelihood of the last bit being set with entropy-reduction level 3
RandomBits(value.key, 3);
value.key = (value.key & 0x1);
#else
printf("This overload of InitValue is not implemented on device");
assert(false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will have no effect in non-debugging builds. cub::ThreadTrap would generate an appropriate error for all build configs here..

@alliepiper
Copy link
Collaborator

Hey @zasdfgbnm, we'll have to hold off on this. Aside from the assert vs. trap issue pointed out, we can no longer rely on __CUDA_ARCH__ in the next release.

I'll update #278 to include a similar fix using the new mechanism and close this PR.

@alliepiper alliepiper closed this May 11, 2021
@zasdfgbnm zasdfgbnm deleted the build-error branch May 11, 2021 16:25
alliepiper added a commit to alliepiper/cub that referenced this pull request May 11, 2021
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request May 27, 2021
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Jun 9, 2021
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Jun 30, 2021
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Jul 7, 2021
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Jul 20, 2021
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Jul 27, 2021
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Jul 28, 2021
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Nov 3, 2021
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Nov 5, 2021
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Nov 30, 2021
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Nov 30, 2021
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Jan 13, 2022
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Jan 24, 2022
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Jan 24, 2022
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Feb 4, 2022
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Mar 23, 2022
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Mar 24, 2022
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Apr 4, 2022
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request Apr 13, 2022
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request May 10, 2022
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request May 16, 2022
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
alliepiper added a commit to alliepiper/cub that referenced this pull request May 16, 2022
This fixes the issue reported in NVIDIA#299. There's no
clear reason why this should use `RandomBits` unconditionally.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants