Skip to content

Commit 90abe81

Browse files
committed
compile fixes for windows
1 parent a4359d4 commit 90abe81

8 files changed

Lines changed: 25 additions & 27 deletions

File tree

cuBQL/builder/cuda/wide_gpu_builder.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ namespace cuBQL {
137137
}
138138
while (numWritten < N) {
139139
target.children[numWritten].bounds.set_empty();
140-
// lower
141-
// = make_float3(+INFINITY,+INFINITY,+INFINITY);
142-
// target.children[numWritten].bounds.upper
143-
// = make_float3(-INFINITY,-INFINITY,-INFINITY);
144140
target.children[numWritten].offset = (uint32_t)-1;
145141
target.children[numWritten].count = (uint32_t)-1;
146142
target.children[numWritten].valid = 0;

cuBQL/math/conservativeDistances.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace cuBQL {
6262
inline __cubql_both float fSqrLength_rd(vec_t<T,D> v)
6363
{
6464
float sum = 0.f;
65-
#pragma unroll
65+
// #pragma unroll
6666
for (int i=0;i<D;i++)
6767
sum += fSquare_rd(v[i]);
6868
return sum;

cuBQL/math/math.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ namespace cuBQL {
2222
#endif
2323

2424
#ifdef __CUDA_ARCH__
25-
# define CUBQL_INF ::cuda::std::numeric_limits<float>::infinity()
25+
# define CUBQL_INF CUDART_INF_F
26+
// # define CUBQL_INF ::cuda::std::numeric_limits<float>::infinity()
2627
#else
2728
# define CUBQL_INF std::numeric_limits<float>::infinity()
2829
#endif

cuBQL/math/vec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ namespace cuBQL {
669669
inline __cubql_both bool operator==(const vec_t_data<T,D> &a,
670670
const vec_t_data<T,D> &b)
671671
{
672-
#pragma unroll
672+
CUBQL_PRAGMA_UNROLL
673673
for (int i=0;i<D;i++)
674674
if (a[i] != b[i]) return false;
675675
return true;

cuBQL/queries/triangleData/math/pointToTriangleDistance.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace cuBQL {
1515

1616
struct PointToTriangleTestResult {
1717
/*! (square!) distance between query point and closest point on triangle.*/
18-
float sqrDist = PosInfTy();
18+
float sqrDist = CUBQL_INF;//PosInfTy();
1919
/*! the actual 3D point that's closest on the triangle */
2020
vec3f P;
2121
};

cuBQL/traversal/rayQueries.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace cuBQL {
2626
template<typename Lambda, typename T>
2727
inline __cubql_both
2828
void forEachLeaf(const Lambda &lambdaToExecuteForEachCandidate,
29-
cuBQL::bvh_t<T, 3> bvh,
29+
cuBQL::BinaryBVH<T, 3> bvh,
3030
cuBQL::ray_t<T> ray,
3131
bool dbg=false);
3232

@@ -40,7 +40,7 @@ namespace cuBQL {
4040
template<typename Lambda, typename T>
4141
inline __cubql_both
4242
void forEachPrim(const Lambda &lambdaToExecuteForEachCandidate,
43-
bvh_t<T,3> bvh,
43+
BinaryBVH<T,3> bvh,
4444
cuBQL::ray_t<T> ray,
4545
bool dbg=false);
4646

@@ -89,7 +89,7 @@ namespace cuBQL {
8989
template<typename Lambda, typename T>
9090
inline __cubql_both
9191
float forEachLeaf(const Lambda &lambdaToCallOnEachLeaf,
92-
bvh_t<T, 3> bvh,
92+
BinaryBVH<T, 3> bvh,
9393
ray_t<T> ray,
9494
bool dbg=false);
9595

@@ -138,14 +138,14 @@ namespace cuBQL {
138138
template<typename EnterBlasLambda,
139139
typename LeaveBlasLambda,
140140
typename ProcessLeafLambda,
141-
typename bvh_t, typename ray_t>
141+
typename T>
142142
inline __cubql_both
143143
void forEachLeaf(const EnterBlasLambda &enterBlas,
144144
const LeaveBlasLambda &leaveBlas,
145145
const ProcessLeafLambda &processLeaf,
146-
bvh_t bvh,
146+
BinaryBVH<T,3> bvh,
147147
/*! REFERENCE to a ray, so 'enterBlas()' can modify it */
148-
ray_t &ray,
148+
ray_t<T> &ray,
149149
bool dbg=false);
150150

151151
/*! two-level BVH ray traversal, where the BVH is made up of a
@@ -163,14 +163,14 @@ namespace cuBQL {
163163
template<typename EnterBlasLambda,
164164
typename LeaveBlasLambda,
165165
typename IntersectPrimLambda,
166-
typename bvh_t, typename ray_t>
166+
typename T>
167167
inline __cubql_both
168168
void forEachPrim(const EnterBlasLambda &enterBlas,
169169
const LeaveBlasLambda &leaveBlas,
170170
const IntersectPrimLambda &intersectPrim,
171-
bvh_t bvh,
171+
BinaryBVH<T,3> bvh,
172172
/*! REFERENCE to a ray, so 'enterBlas()' can modify it */
173-
ray_t &ray,
173+
ray_t<T> &ray,
174174
bool dbg=false);
175175
}
176176

@@ -467,7 +467,7 @@ namespace cuBQL {
467467
template<typename Lambda, typename T>
468468
inline __cubql_both
469469
void fixedRayQuery::forEachPrim(const Lambda &lambdaToExecuteForEachCandidate,
470-
bvh_t<T,3> bvh,
470+
BinaryBVH<T,3> bvh,
471471
cuBQL::ray_t<T> ray,
472472
bool dbg)
473473
{
@@ -675,7 +675,7 @@ namespace cuBQL {
675675
template<typename Lambda, typename T>
676676
inline __cubql_both
677677
void shrinkingRayQuery::forEachPrim(const Lambda &lambdaToExecuteForEachCandidate,
678-
bvh_t<T,3> bvh,
678+
BinaryBVH<T,3> bvh,
679679
ray_t<T> &ray,
680680
bool dbg)
681681
{
@@ -903,15 +903,15 @@ namespace cuBQL {
903903
template<typename EnterBlasLambda,
904904
typename LeaveBlasLambda,
905905
typename IntersectPrimLambda,
906-
typename bvh_t, typename ray_t>
906+
typename T>
907907
inline __cubql_both
908908
void shrinkingRayQuery::twoLevel::
909909
forEachPrim(const EnterBlasLambda &enterBlas,
910910
const LeaveBlasLambda &leaveBlas,
911911
const IntersectPrimLambda &intersectPrim,
912-
bvh_t bvh,
912+
BinaryBVH<T,3> bvh,
913913
/*! REFERENCE to a ray, so 'enterBlas()' can modify it */
914-
ray_t &ray,
914+
ray_t<T> &ray,
915915
bool dbg)
916916
{
917917
auto perLeaf = [dbg,&bvh,&ray,

cuBQL/traversal/shrinkingRadiusQuery.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,9 @@ namespace cuBQL {
355355
template<int N>
356356
inline __cubql_both void sort(ChildOrder<N> &children)
357357
{
358-
#pragma unroll
358+
// #pragma unroll
359359
for (int i=N-1;i>0;--i) {
360-
#pragma unroll
360+
// #pragma unroll
361361
for (int j=0;j<i;j++) {
362362
uint64_t c0 = children.v[j+0];
363363
uint64_t c1 = children.v[j+1];
@@ -411,7 +411,7 @@ namespace cuBQL {
411411
break;
412412

413413
const typename WideBVH<float,3,W>::Node &node = bvh.nodes[nodeID];
414-
#pragma unroll
414+
// #pragma unroll
415415
for (int c=0;c<W;c++) {
416416
const auto child = node.children[c];
417417
if (!node.children[c].valid)
@@ -430,8 +430,8 @@ namespace cuBQL {
430430
}
431431
}
432432
sort(childOrder);
433-
#pragma unroll
434-
for (int c=W-1;c>0;--c) {
433+
// #pragma unroll
434+
for (int c=W-1;c>0;--c) {
435435
uint64_t coc = childOrder.v[c];
436436
if (coc != uint64_t(-1)) {
437437
*stackPtr++ = coc;

samples/s02_distanceToTriangleMesh/distanceToTriangleMesh.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define CUBQL_GPU_BUILDER_IMPLEMENTATION 1
2222
#define CUBQL_TRIANGLE_CPAT_IMPLEMENTATION 1
2323
#include "cuBQL/bvh.h"
24+
#include "cuBQL/queries/triangleData/math/pointToTriangleDistance.h"
2425
#include "cuBQL/queries/triangleData/closestPointOnAnyTriangle.h"
2526
#include "samples/common/loadOBJ.h"
2627

0 commit comments

Comments
 (0)