From 170d0d1e74e1a8c7a76e87f98880a4c3b90c42bd Mon Sep 17 00:00:00 2001 From: Xiang Gao Date: Mon, 10 May 2021 16:04:33 -0700 Subject: [PATCH] Fix build error for RandomBits --- .gitignore | 1 + test/test_util.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index f3577e2d53..af85e526a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .p4config *~ \#* +/build diff --git a/test/test_util.h b/test/test_util.h index 98d10e786f..f8244e3496 100644 --- a/test/test_util.h +++ b/test/test_util.h @@ -628,11 +628,16 @@ __host__ __device__ __forceinline__ void InitValue( cub::KeyValuePair& value, int index = 0) { +#ifndef __CUDA_ARCH__ 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); +#endif }