diff --git a/cuBQL/builder/cuda/builder_common.h b/cuBQL/builder/cuda/builder_common.h index 47e0ea4..27d50df 100644 --- a/cuBQL/builder/cuda/builder_common.h +++ b/cuBQL/builder/cuda/builder_common.h @@ -159,32 +159,34 @@ namespace cuBQL { inline __device__ box_t make_box() const; inline __device__ scalar_t get_lower(int dim) const { - if (box_t::numDims>4) + if constexpr (box_t::numDims>4) return decode(lower[dim]); - else if (box_t::numDims==4) { + else if constexpr (box_t::numDims==4) { return decode(dim>1 ?((dim>2)?lower[3]:lower[2]) :((dim )?lower[1]:lower[0])); - } else if (box_t::numDims==3) { + } else if constexpr (box_t::numDims==3) { return decode(dim>1 ?lower[2] :((dim )?lower[1]:lower[0])); - } else + } else { return decode(lower[dim]); + } } inline __device__ scalar_t get_upper(int dim) const { - if (box_t::numDims>4) + if constexpr (box_t::numDims>4) return decode(upper[dim]); - else if (box_t::numDims==4) { + else if constexpr (box_t::numDims==4) { return decode(dim>1 ?((dim>2)?upper[3]:upper[2]) :((dim )?upper[1]:upper[0])); - } else if (box_t::numDims==3) + } else if constexpr (box_t::numDims==3) { return decode(dim>1 ?upper[2] :((dim )?upper[1]:upper[0])); - else + } else { return decode(upper[dim]); + } } typename int_type_of::type lower[box_t::numDims]; diff --git a/cuBQL/builder/cuda/elh_builder.h b/cuBQL/builder/cuda/elh_builder.h index caa1d07..7dc44db 100644 --- a/cuBQL/builder/cuda/elh_builder.h +++ b/cuBQL/builder/cuda/elh_builder.h @@ -85,7 +85,7 @@ namespace cuBQL { { float bestCost = CUBQL_INF; - float rLengths[(int)elh.numBins]; + float rLengths[(int)ELHBins::numBins]; for (int d=0;d box; box.set_empty(); int rCount = 0; diff --git a/cuBQL/builder/cuda/radix.h b/cuBQL/builder/cuda/radix.h index 825af91..1a4c74a 100644 --- a/cuBQL/builder/cuda/radix.h +++ b/cuBQL/builder/cuda/radix.h @@ -585,7 +585,7 @@ namespace cuBQL { { const int makeLeafThreshold = (buildConfig.makeLeafThreshold > 0) - ? min(buildConfig.makeLeafThreshold,buildConfig.maxAllowedLeafSize) + ? std::min(buildConfig.makeLeafThreshold,buildConfig.maxAllowedLeafSize) : 1; // ================================================================== diff --git a/cuBQL/builder/cuda/rebinMortonBuilder.h b/cuBQL/builder/cuda/rebinMortonBuilder.h index 00fc6c2..424cec6 100644 --- a/cuBQL/builder/cuda/rebinMortonBuilder.h +++ b/cuBQL/builder/cuda/rebinMortonBuilder.h @@ -1161,7 +1161,7 @@ namespace cuBQL { using atomic_box_t = typename ctx_t::atomic_box_t; const int makeLeafThreshold = (buildConfig.makeLeafThreshold > 0) - ? min(buildConfig.makeLeafThreshold,buildConfig.maxAllowedLeafSize) + ? std::min(buildConfig.makeLeafThreshold,buildConfig.maxAllowedLeafSize) : 1; // ================================================================== diff --git a/cuBQL/builder/cuda/sah_builder.h b/cuBQL/builder/cuda/sah_builder.h index 5374615..423d6fb 100644 --- a/cuBQL/builder/cuda/sah_builder.h +++ b/cuBQL/builder/cuda/sah_builder.h @@ -65,7 +65,7 @@ namespace cuBQL { { float bestCost = CUBQL_INF; - float rAreas[sah.numBins]; + float rAreas[SAHBins::numBins]; for (int d=0;d<3;d++) { box_t box; box.set_empty(); int rCount = 0; diff --git a/cuBQL/math/math.h b/cuBQL/math/math.h index 27a7d5b..aee372e 100644 --- a/cuBQL/math/math.h +++ b/cuBQL/math/math.h @@ -28,8 +28,7 @@ namespace cuBQL { # define CUBQL_INF std::numeric_limits::infinity() #endif -#ifdef __CUDA_ARCH__ -#else +#if !defined(__CUDACC__) inline float __int_as_float(int i) { return (const float &)i; } inline int __float_as_int(float f) { return (const int &)f; } #endif