From bbb303f25398683fdfc71bb05f72ed8158c39e82 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Tue, 11 May 2021 17:05:46 -0400 Subject: [PATCH] Don't use host-only functions in host-device contexts. This fixes the issue reported in NVIDIA/CUB#299. There's no clear reason why this should use `RandomBits` unconditionally. --- test/test_util.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/test_util.h b/test/test_util.h index df4078bff9..201a541b6a 100644 --- a/test/test_util.h +++ b/test/test_util.h @@ -602,7 +602,6 @@ void InitValue(GenMode gen_mode, T &value, int index = 0) __host__ __device__ __forceinline__ void InitValue(GenMode gen_mode, bool &value, int index = 0) { - NV_IF_TARGET( NV_IS_HOST, ( @@ -657,10 +656,8 @@ __host__ __device__ __forceinline__ void InitValue( cub::KeyValuePair& value, int index = 0) { + InitValue(gen_mode, value.key, index); 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); }