[Bf-blender-cvs] [6b26b0db213] geometry-nodes-simulation: Fix build issue with NanoVDB and HIP on Linux

Brecht Van Lommel noreply at git.blender.org
Mon Dec 19 19:05:21 CET 2022


Commit: 6b26b0db213e7ea7a2cd3197b7b877c18eaa4c3f
Author: Brecht Van Lommel
Date:   Thu Dec 15 15:10:09 2022 +0100
Branches: geometry-nodes-simulation
https://developer.blender.org/rB6b26b0db213e7ea7a2cd3197b7b877c18eaa4c3f

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.

===================================================================

M	build_files/build_environment/patches/openvdb.diff

===================================================================

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<unsigned long long int>(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<ValueIndex>
+     template <typename T = BuildType>
+-    __hostdev__ typename enable_if<is_same<T, ValueIndex>::value, uint64_t>::type valueCount() const {return DataType::mData1;}
++    __hostdev__ typename enable_if<is_same<T, ValueIndex>::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<const TreeT*>(this->treePtr()); }



More information about the Bf-blender-cvs mailing list