Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating for windows x64 and CUDA 11.7 #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
4 changes: 4 additions & 0 deletions src/optixNSearch/helper_mortonCode.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

#include <stdio.h>

#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)
Expand Down
2 changes: 1 addition & 1 deletion src/optixNSearch/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/optixNSearch/optixNSearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

enum ParticleType
{
POINT = 0,
POINT_TYPE = 0,
QUERY = 1
};

Expand Down
7 changes: 4 additions & 3 deletions src/optixNSearch/sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <thrust/copy.h>
#include <thrust/sequence.h>
#include <thrust/gather.h>
#include <thrust/host_vector.h>

#include <algorithm>
#include <iomanip>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions src/optixNSearch/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TimingHelper> Timing::m_timingStack;
std::unordered_map<int, AverageTime> Timing::m_averageTimes;
2 changes: 2 additions & 0 deletions src/sutil/sutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
#include <vector>
#if !defined( _WIN32 )
#include <dirent.h>
#else
#include "windows.h"
#endif

namespace sutil
Expand Down