From c6ff8eb837ae91d3fc0b9f9fc3646d6601f096fb Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 15 Dec 2022 15:10:09 +0100 Subject: [PATCH] Fix build issue with NanoVDB and HIP on Linux This patch was already accepted upstream, so this is temporary until we update to a new OpenVDB release that includes it. --- .../build_environment/patches/openvdb.diff | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build_files/build_environment/patches/openvdb.diff b/build_files/build_environment/patches/openvdb.diff index 9896460c26c..d3f19985815 100644 --- a/build_files/build_environment/patches/openvdb.diff +++ b/build_files/build_environment/patches/openvdb.diff @@ -90,3 +90,25 @@ diff -Naur orig/openvdb/openvdb/tree/ValueAccessor.h openvdb/openvdb/openvdb/tre CacheItem(TreeCacheT& parent) : mParent(&parent) +diff --git a/nanovdb/nanovdb/NanoVDB.h b/nanovdb/nanovdb/NanoVDB.h +index f7fc304..fde5c47 100644 +--- a/nanovdb/nanovdb/NanoVDB.h ++++ b/nanovdb/nanovdb/NanoVDB.h +@@ -1877,7 +1877,7 @@ __hostdev__ static inline uint32_t FindLowestOn(uint64_t v) + { + NANOVDB_ASSERT(v); + #if (defined(__CUDA_ARCH__) || defined(__HIP__)) && defined(NANOVDB_USE_INTRINSICS) +- return __ffsll(v); ++ return __ffsll(static_cast(v)); + #elif defined(_MSC_VER) && defined(NANOVDB_USE_INTRINSICS) + unsigned long index; + _BitScanForward64(&index, v); +@@ -2592,7 +2592,7 @@ public: + /// + /// @note This method is only defined for IndexGrid = NanoGrid + template +- __hostdev__ typename enable_if::value, uint64_t>::type valueCount() const {return DataType::mData1;} ++ __hostdev__ typename enable_if::value, const uint64_t&>::type valueCount() const {return DataType::mData1;} + + /// @brief Return a const reference to the tree + __hostdev__ const TreeT& tree() const { return *reinterpret_cast(this->treePtr()); }