Remove compiler warnings. Move functionality to Bitset class.
This commit is contained in:
parent
ddd4451102
commit
d2cdbd66c0
@ -31,6 +31,14 @@ struct Bitset
|
||||
this->Mask = this->Mask | (static_cast<MaskType>(1) << bitIndex);
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT void set(vtkm::Id bitIndex, bool val)
|
||||
{
|
||||
if (val)
|
||||
this->set(bitIndex);
|
||||
else
|
||||
this->reset(bitIndex);
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT void reset(vtkm::Id bitIndex)
|
||||
{
|
||||
this->Mask = this->Mask & ~(static_cast<MaskType>(1) << bitIndex);
|
||||
|
@ -1,30 +0,0 @@
|
||||
//=============================================================================
|
||||
//
|
||||
// Copyright (c) Kitware, Inc.
|
||||
// All rights reserved.
|
||||
// See LICENSE.txt for details.
|
||||
//
|
||||
// This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
// PURPOSE. See the above copyright notice for more information.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef vtk_m_worklet_particleadvection_EvaluatorStatus_h
|
||||
#define vtk_m_worklet_particleadvection_EvaluatorStatus_h
|
||||
|
||||
#include <vtkm/Bitset.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace worklet
|
||||
{
|
||||
namespace particleadvection
|
||||
{
|
||||
|
||||
} //namespace particleadvection
|
||||
} //namespace worklet
|
||||
} //namespace vtkm
|
||||
|
||||
|
||||
#endif // vtk_m_worklet_particleadvection_EvaluatorStatus_h
|
@ -35,8 +35,15 @@ namespace particleadvection
|
||||
class EvaluatorStatus : public vtkm::Bitset<vtkm::UInt8>
|
||||
{
|
||||
public:
|
||||
VTKM_EXEC_CONT void SetOk() { this->set(SUCCESS_BIT); }
|
||||
VTKM_EXEC_CONT bool CheckOk() const { return this->test(SUCCESS_BIT); }
|
||||
VTKM_EXEC_CONT EvaluatorStatus(){};
|
||||
VTKM_EXEC_CONT EvaluatorStatus(bool ok, bool spatial, bool temporal)
|
||||
{
|
||||
this->set(SUCCESS_BIT, ok);
|
||||
this->set(SPATIAL_BOUNDS_BIT, spatial);
|
||||
this->set(TEMPORAL_BOUNDS_BIT, temporal);
|
||||
};
|
||||
VTKM_EXEC_CONT void SetOk() { this->set(this->SUCCESS_BIT); }
|
||||
VTKM_EXEC_CONT bool CheckOk() const { return this->test(this->SUCCESS_BIT); }
|
||||
|
||||
VTKM_EXEC_CONT void SetFail() { this->reset(SUCCESS_BIT); }
|
||||
VTKM_EXEC_CONT bool CheckFail() const { return !this->test(SUCCESS_BIT); }
|
||||
|
@ -34,23 +34,23 @@ namespace worklet
|
||||
namespace particleadvection
|
||||
{
|
||||
|
||||
class IntegratorStatus : public vtkm::Bitset<vtkm::UInt8>
|
||||
class VTKM_ALWAYS_EXPORT IntegratorStatus : public vtkm::Bitset<vtkm::UInt8>
|
||||
{
|
||||
public:
|
||||
VTKM_EXEC_CONT IntegratorStatus() {}
|
||||
|
||||
VTKM_EXEC_CONT IntegratorStatus(const bool& ok, const bool& spatial, const bool& temporal)
|
||||
{
|
||||
SetBit(0 /*SUCCESS_BIT*/, ok);
|
||||
SetBit(1 /*SPATIAL_BOUNDS_BIT*/, spatial);
|
||||
SetBit(2 /*TEMPORAL_BOUNDS_BIT*/, temporal);
|
||||
this->set(this->SUCCESS_BIT, ok);
|
||||
this->set(SPATIAL_BOUNDS_BIT, spatial);
|
||||
this->set(TEMPORAL_BOUNDS_BIT, temporal);
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT IntegratorStatus(const EvaluatorStatus& es)
|
||||
{
|
||||
SetBit(0 /*SUCCESS_BIT*/, es.CheckOk());
|
||||
SetBit(1 /*SPATIAL_BOUNDS_BIT*/, es.CheckSpatialBounds());
|
||||
SetBit(2 /*TEMPORAL_BOUNDS_BIT*/, es.CheckTemporalBounds());
|
||||
this->set(SUCCESS_BIT, es.CheckOk());
|
||||
this->set(SPATIAL_BOUNDS_BIT, es.CheckSpatialBounds());
|
||||
this->set(TEMPORAL_BOUNDS_BIT, es.CheckTemporalBounds());
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT void SetOk() { this->set(SUCCESS_BIT); }
|
||||
@ -66,16 +66,9 @@ public:
|
||||
VTKM_EXEC_CONT bool CheckTemporalBounds() const { return this->test(TEMPORAL_BOUNDS_BIT); }
|
||||
|
||||
private:
|
||||
VTKM_EXEC_CONT void SetBit(const vtkm::IdComponent& bit, bool val)
|
||||
{
|
||||
if (val)
|
||||
this->set(bit);
|
||||
else
|
||||
this->reset(bit);
|
||||
}
|
||||
const static vtkm::IdComponent SUCCESS_BIT = 0;
|
||||
const static vtkm::IdComponent SPATIAL_BOUNDS_BIT = 1;
|
||||
const static vtkm::IdComponent TEMPORAL_BOUNDS_BIT = 2;
|
||||
static constexpr vtkm::IdComponent SUCCESS_BIT = 0;
|
||||
static constexpr vtkm::IdComponent SPATIAL_BOUNDS_BIT = 1;
|
||||
static constexpr vtkm::IdComponent TEMPORAL_BOUNDS_BIT = 2;
|
||||
};
|
||||
|
||||
inline VTKM_EXEC_CONT std::ostream& operator<<(std::ostream& s, const IntegratorStatus& status)
|
||||
|
@ -143,12 +143,12 @@ public:
|
||||
//Status.Set(idx, Status.Get(idx) | static_cast<vtkm::Id>(b));
|
||||
}
|
||||
VTKM_EXEC
|
||||
void ClearBit(const vtkm::Id& idx, const ParticleStatus& b)
|
||||
void ClearBit(const vtkm::Id& /*idx*/, const ParticleStatus& /*b*/)
|
||||
{
|
||||
// Status.Set(idx, Status.Get(idx) & ~static_cast<vtkm::Id>(b));
|
||||
}
|
||||
VTKM_EXEC
|
||||
bool CheckBit(const vtkm::Id& idx, const ParticleStatus& b) const
|
||||
bool CheckBit(const vtkm::Id& /*idx*/, const ParticleStatus& /*b*/) const
|
||||
{
|
||||
return true; //return (Status.Get(idx) & static_cast<vtkm::Id>(b)) != 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user