mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 10:35:42 +00:00
More corrections needed to suppress false positive host / device warnings.
This commit is contained in:
parent
1f0b37fc03
commit
76cd2ac4da
@ -36,6 +36,7 @@ class ArrayPortalPermutationExec
|
|||||||
public:
|
public:
|
||||||
typedef typename ValuePortalType::ValueType ValueType;
|
typedef typename ValuePortalType::ValueType ValueType;
|
||||||
|
|
||||||
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||||
VTKM_EXEC_CONT_EXPORT
|
VTKM_EXEC_CONT_EXPORT
|
||||||
ArrayPortalPermutationExec( )
|
ArrayPortalPermutationExec( )
|
||||||
: IndexPortal(), ValuePortal() { }
|
: IndexPortal(), ValuePortal() { }
|
||||||
@ -63,12 +64,14 @@ public:
|
|||||||
return this->IndexPortal.GetNumberOfValues();
|
return this->IndexPortal.GetNumberOfValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||||
VTKM_EXEC_EXPORT
|
VTKM_EXEC_EXPORT
|
||||||
ValueType Get(vtkm::Id index) const {
|
ValueType Get(vtkm::Id index) const {
|
||||||
vtkm::Id permutedIndex = this->IndexPortal.Get(index);
|
vtkm::Id permutedIndex = this->IndexPortal.Get(index);
|
||||||
return this->ValuePortal.Get(permutedIndex);
|
return this->ValuePortal.Get(permutedIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||||
VTKM_EXEC_EXPORT
|
VTKM_EXEC_EXPORT
|
||||||
void Set(vtkm::Id index, const ValueType &value) const {
|
void Set(vtkm::Id index, const ValueType &value) const {
|
||||||
vtkm::Id permutedIndex = this->IndexPortal.Get(index);
|
vtkm::Id permutedIndex = this->IndexPortal.Get(index);
|
||||||
|
@ -41,12 +41,14 @@ namespace internal {
|
|||||||
struct RangeMin
|
struct RangeMin
|
||||||
{
|
{
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
VTKM_EXEC_EXPORT
|
||||||
T operator()(const T& a, const T& b)const { return vtkm::Min(a,b); }
|
T operator()(const T& a, const T& b)const { return vtkm::Min(a,b); }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RangeMax
|
struct RangeMax
|
||||||
{
|
{
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
VTKM_EXEC_EXPORT
|
||||||
T operator()(const T& a, const T& b)const { return vtkm::Max(a,b); }
|
T operator()(const T& a, const T& b)const { return vtkm::Max(a,b); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ public:
|
|||||||
typedef typename ConnectivityType::IndicesType IndicesFromType;
|
typedef typename ConnectivityType::IndicesType IndicesFromType;
|
||||||
typedef typename ConnectivityType::CellShapeTag CellShapeTag;
|
typedef typename ConnectivityType::CellShapeTag CellShapeTag;
|
||||||
|
|
||||||
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||||
template<typename OutToInArrayType, typename VisitArrayType>
|
template<typename OutToInArrayType, typename VisitArrayType>
|
||||||
VTKM_EXEC_EXPORT
|
VTKM_EXEC_EXPORT
|
||||||
ThreadIndicesTopologyMap(vtkm::Id threadIndex,
|
ThreadIndicesTopologyMap(vtkm::Id threadIndex,
|
||||||
|
@ -67,6 +67,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||||
VTKM_EXEC_EXPORT
|
VTKM_EXEC_EXPORT
|
||||||
ComponentType operator[](vtkm::IdComponent index) const
|
ComponentType operator[](vtkm::IdComponent index) const
|
||||||
{
|
{
|
||||||
|
@ -65,6 +65,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||||
VTKM_EXEC_EXPORT
|
VTKM_EXEC_EXPORT
|
||||||
ComponentType operator[](vtkm::IdComponent index) const
|
ComponentType operator[](vtkm::IdComponent index) const
|
||||||
{
|
{
|
||||||
|
@ -44,16 +44,14 @@
|
|||||||
} while (false) /* do-while prevents extra semicolon warnings */
|
} while (false) /* do-while prevents extra semicolon warnings */
|
||||||
|
|
||||||
// VTKM_ASSUME_IMPL is compiler-specific:
|
// VTKM_ASSUME_IMPL is compiler-specific:
|
||||||
#if defined(VTKM_MSVC)
|
|
||||||
//Currently NVCC/VS can generate invalid PTX code when it encounters __assume.
|
|
||||||
//So while this issue is being resolved we will disable VTKM_ASSUME when inside
|
|
||||||
//CUDA code being built by Visual Studio
|
|
||||||
#if defined(__CUDA_ARCH__)
|
#if defined(__CUDA_ARCH__)
|
||||||
|
//For all versions of CUDA this is a no-op while we look
|
||||||
|
//for a CUDA asm snippet that replicates this kind of behavior
|
||||||
#define VTKM_ASSUME_IMPL(cond) do {} while (false) /* no-op */
|
#define VTKM_ASSUME_IMPL(cond) do {} while (false) /* no-op */
|
||||||
#else
|
#else
|
||||||
# define VTKM_ASSUME_IMPL(cond) __assume(cond)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
|
#if defined(VTKM_MSVC)
|
||||||
|
# define VTKM_ASSUME_IMPL(cond) __assume(cond)
|
||||||
#elif defined(VTKM_ICC)
|
#elif defined(VTKM_ICC)
|
||||||
# define VTKM_ASSUME_IMPL(cond) __assume(cond)
|
# define VTKM_ASSUME_IMPL(cond) __assume(cond)
|
||||||
#elif defined(VTKM_GCC) && ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) )
|
#elif defined(VTKM_GCC) && ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) )
|
||||||
@ -65,4 +63,6 @@
|
|||||||
# define VTKM_ASSUME_IMPL(cond) do {} while (false) /* no-op */
|
# define VTKM_ASSUME_IMPL(cond) do {} while (false) /* no-op */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // vtk_m_internal_Assume_h
|
#endif // vtk_m_internal_Assume_h
|
||||||
|
@ -29,9 +29,11 @@
|
|||||||
#ifdef VTKM_CUDA
|
#ifdef VTKM_CUDA
|
||||||
#define VTKM_EXEC_EXPORT inline __device__ __host__
|
#define VTKM_EXEC_EXPORT inline __device__ __host__
|
||||||
#define VTKM_EXEC_CONT_EXPORT inline __device__ __host__
|
#define VTKM_EXEC_CONT_EXPORT inline __device__ __host__
|
||||||
#define VTKM_SUPPRESS_EXEC_WARNINGS \
|
#if __CUDAVER__ >= 75000
|
||||||
#pragma hd_warning_disable \
|
# define VTKM_SUPPRESS_EXEC_WARNINGS #pragma nv_exec_check_disable
|
||||||
#pragma nv_exec_check_disable
|
#else
|
||||||
|
# define VTKM_SUPPRESS_EXEC_WARNINGS #pragma hd_warning_disable
|
||||||
|
#endif
|
||||||
#define VTKM_EXEC_CONSTANT_EXPORT __device__ __constant__
|
#define VTKM_EXEC_CONSTANT_EXPORT __device__ __constant__
|
||||||
#else
|
#else
|
||||||
#define VTKM_EXEC_EXPORT inline
|
#define VTKM_EXEC_EXPORT inline
|
||||||
|
@ -123,6 +123,7 @@ public:
|
|||||||
|
|
||||||
/// Topology map worklets use topology map indices.
|
/// Topology map worklets use topology map indices.
|
||||||
///
|
///
|
||||||
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||||
template<typename T, typename OutToInArrayType, typename VisitArrayType, typename InputDomainType>
|
template<typename T, typename OutToInArrayType, typename VisitArrayType, typename InputDomainType>
|
||||||
VTKM_EXEC_EXPORT
|
VTKM_EXEC_EXPORT
|
||||||
vtkm::exec::arg::ThreadIndicesTopologyMap<InputDomainType>
|
vtkm::exec::arg::ThreadIndicesTopologyMap<InputDomainType>
|
||||||
|
@ -282,6 +282,7 @@ public:
|
|||||||
/// Worklet types can add additional indices by returning different object
|
/// Worklet types can add additional indices by returning different object
|
||||||
/// types.
|
/// types.
|
||||||
///
|
///
|
||||||
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||||
template<typename T, typename OutToInArrayType, typename VisitArrayType, typename InputDomainType>
|
template<typename T, typename OutToInArrayType, typename VisitArrayType, typename InputDomainType>
|
||||||
VTKM_EXEC_EXPORT
|
VTKM_EXEC_EXPORT
|
||||||
vtkm::exec::arg::ThreadIndicesBasic
|
vtkm::exec::arg::ThreadIndicesBasic
|
||||||
|
Loading…
Reference in New Issue
Block a user