提交 74f04523 编写于 作者: M Marius Muja

Fixed for CUDA compilation on Windows

上级 3a148fba
......@@ -320,7 +320,7 @@ private:
private:
class GpuHelper;
struct GpuHelper;
GpuHelper* gpu_helper_;
......
......@@ -144,8 +144,9 @@ base_any_policy* get_policy()
}
} // namespace anyimpl
struct any
class any
{
typedef any any_t;
private:
// fields
anyimpl::base_any_policy* policy;
......@@ -196,7 +197,7 @@ public:
/// Assignment function.
template <typename T>
any& assign(const T& x)
any_t& assign(const T& x)
{
reset();
policy = anyimpl::get_policy<T>();
......@@ -206,7 +207,7 @@ public:
/// Assignment operator.
template<typename T>
any& operator=(const T& x)
any_t& operator=(const T& x)
{
return assign(x);
}
......
......@@ -32,8 +32,14 @@
#include <flann/util/cuda/heap.h>
#include <limits>
__device__ __forceinline__
float infinity()
{
return __int_as_float(0x7f800000);
}
#ifndef INFINITY
#define INFINITY __int_as_float(0x7f800000)
#define INFINITY infinity()
#endif
namespace flann
......@@ -48,7 +54,7 @@ struct SingleResultSet
DistanceType bestDist;
const DistanceType epsError;
__host__ __device__
__device__
SingleResultSet( DistanceType eps ) : bestIndex(-1),bestDist(INFINITY), epsError(eps){ }
__host__ __device__
......@@ -71,7 +77,7 @@ struct SingleResultSet
DistanceType* resultDist;
int* resultIndex;
__host__ __device__
__device__
inline void
setResultLocation( DistanceType* dists, int* index, int thread, int stride )
{
......@@ -123,7 +129,7 @@ struct KnnResultSet
const DistanceType epsError;
__host__ __device__
__device__
KnnResultSet(int knn, bool sortResults, DistanceType eps) : foundNeighbors(0),largestHeapDist(INFINITY),k(knn), sorted(sortResults), epsError(eps){ }
// __host__ __device__
......@@ -187,7 +193,7 @@ struct KnnResultSet
float* resultDist;
int* resultIndex;
__host__ __device__
__device__
inline void
setResultLocation( DistanceType* dists, int* index, int thread, int stride )
{
......@@ -438,7 +444,7 @@ struct KnnRadiusResultSet
DistanceType* resultDist;
int* resultIndex;
__host__ __device__
__device__
inline void
setResultLocation( DistanceType* dists, int* index, int thread, int stride )
{
......@@ -527,4 +533,4 @@ struct RadiusResultSet
}
}
#endif
\ No newline at end of file
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册