From 1e64039f0164bbb07e5f68c610fb1bb49e22a1fa Mon Sep 17 00:00:00 2001 From: Prabindh Sundareson Date: Fri, 12 Aug 2022 09:45:30 +0530 Subject: [PATCH] updating for windows x64 --- src/optixNSearch/helper_mortonCode.h | 4 ++++ src/optixNSearch/main.cpp | 2 +- src/optixNSearch/optixNSearch.h | 2 +- src/optixNSearch/sort.cpp | 7 ++++--- src/optixNSearch/util.cpp | 6 ++++++ src/sutil/sutil.cpp | 2 ++ 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/optixNSearch/helper_mortonCode.h b/src/optixNSearch/helper_mortonCode.h index 6404d5d..794812b 100644 --- a/src/optixNSearch/helper_mortonCode.h +++ b/src/optixNSearch/helper_mortonCode.h @@ -3,6 +3,10 @@ #include +#ifdef _WIN32 +typedef unsigned int uint; +#endif + //https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/ // "Insert" a 0 bit after each of the 16 low bits of x __host__ __device__ inline uint Part1By1(uint x) diff --git a/src/optixNSearch/main.cpp b/src/optixNSearch/main.cpp index 03814e7..617bd85 100644 --- a/src/optixNSearch/main.cpp +++ b/src/optixNSearch/main.cpp @@ -95,7 +95,7 @@ int main( int argc, char* argv[] ) // samepq indicates same underlying data and sorting mode, in which case // queries have been sorted so no need to sort them again. - if (!state.samepq) sortParticles(state, POINT, state.pointSortMode); + if (!state.samepq) sortParticles(state, POINT_TYPE, state.pointSortMode); // early free done here too setupSearch(state); diff --git a/src/optixNSearch/optixNSearch.h b/src/optixNSearch/optixNSearch.h index 97e2a93..5e100a9 100644 --- a/src/optixNSearch/optixNSearch.h +++ b/src/optixNSearch/optixNSearch.h @@ -33,7 +33,7 @@ enum ParticleType { - POINT = 0, + POINT_TYPE = 0, QUERY = 1 }; diff --git a/src/optixNSearch/sort.cpp b/src/optixNSearch/sort.cpp index cade873..c9ad698 100644 --- a/src/optixNSearch/sort.cpp +++ b/src/optixNSearch/sort.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -519,7 +520,7 @@ void gridSort(RTNNState& state, unsigned int N, float3* particles, float3* h_par unsigned int threadsPerBlock = 64; unsigned int numOfBlocks = N / threadsPerBlock + 1; - if ((type == POINT) && state.partition) { + if ((type == POINT_TYPE) && state.partition) { // indicating that this is a point sort after the query partitioning, in // which case the two cellArrays are created in the query partitioning // process and we can reuse their space so no allocation. we still have to @@ -659,12 +660,12 @@ void sortParticles ( RTNNState& state, ParticleType type, int sortMode ) { // 3: 1D sort; doesn't do query partitioning if ((type == QUERY) && !state.partition && !sortMode) return; - else if ((type == POINT) && !sortMode) return; + else if ((type == POINT_TYPE) && !sortMode) return; unsigned int N; float3* particles; float3* h_particles; - if (type == POINT) { + if (type == POINT_TYPE) { N = state.numPoints; particles = state.params.points; h_particles = state.h_points; diff --git a/src/optixNSearch/util.cpp b/src/optixNSearch/util.cpp index 1c74d97..84d5756 100644 --- a/src/optixNSearch/util.cpp +++ b/src/optixNSearch/util.cpp @@ -714,3 +714,9 @@ bool isClose(float3 a, float3 b) { if (fabs(a.x - b.x) < 0.001 && fabs(a.y - b.y) < 0.001 && fabs(a.z - b.z) < 0.001) return true; else return false; } + +bool Timing::m_dontPrintTimes = false; +unsigned int Timing::m_startCounter = 0; +unsigned int Timing::m_stopCounter = 0; +std::stack Timing::m_timingStack; +std::unordered_map Timing::m_averageTimes; \ No newline at end of file diff --git a/src/sutil/sutil.cpp b/src/sutil/sutil.cpp index 7053b6a..a119d57 100644 --- a/src/sutil/sutil.cpp +++ b/src/sutil/sutil.cpp @@ -60,6 +60,8 @@ #include #if !defined( _WIN32 ) #include +#else +#include "windows.h" #endif namespace sutil