Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions cuBQL/builder/cuda/builder_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<scalar_t>(lower[dim]);
else if (box_t::numDims==4) {
else if constexpr (box_t::numDims==4) {
return decode<scalar_t>(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<scalar_t>(dim>1
?lower[2]
:((dim )?lower[1]:lower[0]));
} else
} else {
return decode<scalar_t>(lower[dim]);
}
}
inline __device__ scalar_t get_upper(int dim) const {
if (box_t::numDims>4)
if constexpr (box_t::numDims>4)
return decode<scalar_t>(upper[dim]);
else if (box_t::numDims==4) {
else if constexpr (box_t::numDims==4) {
return decode<scalar_t>(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<scalar_t>(dim>1
?upper[2]
:((dim )?upper[1]:upper[0]));
else
} else {
return decode<scalar_t>(upper[dim]);
}
}

typename int_type_of<scalar_t>::type lower[box_t::numDims];
Expand Down
2 changes: 1 addition & 1 deletion cuBQL/builder/cuda/elh_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace cuBQL {
{
float bestCost = CUBQL_INF;

float rLengths[(int)elh.numBins];
float rLengths[(int)ELHBins<T,D>::numBins];
for (int d=0;d<D;d++) {
box_t<T,D> box; box.set_empty();
int rCount = 0;
Expand Down
2 changes: 1 addition & 1 deletion cuBQL/builder/cuda/radix.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ namespace cuBQL {
{
const int makeLeafThreshold
= (buildConfig.makeLeafThreshold > 0)
? min(buildConfig.makeLeafThreshold,buildConfig.maxAllowedLeafSize)
? std::min(buildConfig.makeLeafThreshold,buildConfig.maxAllowedLeafSize)
: 1;

// ==================================================================
Expand Down
2 changes: 1 addition & 1 deletion cuBQL/builder/cuda/rebinMortonBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

// ==================================================================
Expand Down
2 changes: 1 addition & 1 deletion cuBQL/builder/cuda/sah_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace cuBQL {
{
float bestCost = CUBQL_INF;

float rAreas[sah.numBins];
float rAreas[SAHBins<box_t>::numBins];
for (int d=0;d<3;d++) {
box_t box; box.set_empty();
int rCount = 0;
Expand Down
3 changes: 1 addition & 2 deletions cuBQL/math/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ namespace cuBQL {
# define CUBQL_INF std::numeric_limits<float>::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
Expand Down