From accfbcba62b44d364774954805757fa1dc28760c Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Wed, 31 Aug 2022 15:57:58 -0700 Subject: [PATCH] Attempt to enable compute 5.2 for NVIDIA GPU support Issue #292. --- cmake/checkcuda.cu | 2 +- src/pbrt/util/float.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/checkcuda.cu b/cmake/checkcuda.cu index cc6463d..f12b790 100644 --- a/cmake/checkcuda.cu +++ b/cmake/checkcuda.cu @@ -5,7 +5,7 @@ int main(int argc, char **argv){ cudaDeviceProp dP; - float min_cc = 5.3; // We need half floats... + float min_cc = 5.2; int rc = cudaGetDeviceProperties(&dP, 0); if(rc != cudaSuccess) { diff --git a/src/pbrt/util/float.h b/src/pbrt/util/float.h index b318442..f0df1fb 100644 --- a/src/pbrt/util/float.h +++ b/src/pbrt/util/float.h @@ -499,7 +499,7 @@ class Half { PBRT_CPU_GPU bool operator==(const Half &v) const { -#ifdef PBRT_IS_GPU_CODE +#if defined(PBRT_IS_GPU_CODE) && __CUDA_ARCH__ >= 530 return __ushort_as_half(h) == __ushort_as_half(v.h); #else if (Bits() == v.Bits()) -- GitLab