From 800c92a219121804009ddfc388ce7151ac5251d9 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Wed, 10 Nov 2021 12:34:45 -0500 Subject: [PATCH] Fix bad cast in util_device. Fixes #286. --- cub/util_device.cuh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cub/util_device.cuh b/cub/util_device.cuh index 3f738dd558..55ad22cafe 100644 --- a/cub/util_device.cuh +++ b/cub/util_device.cuh @@ -371,11 +371,9 @@ CUB_RUNTIME_FUNCTION inline cudaError_t PtxVersionUncached(int& ptx_version) #if CUB_INCLUDE_HOST_CODE cudaFuncAttributes empty_kernel_attrs; - do { - if (CubDebug(result = cudaFuncGetAttributes(&empty_kernel_attrs, empty_kernel))) - break; - } - while(0); + result = cudaFuncGetAttributes(&empty_kernel_attrs, + reinterpret_cast(empty_kernel)); + CubDebug(result); ptx_version = empty_kernel_attrs.ptxVersion * 10; #endif