Skip to content

Commit

Permalink
Merge pull request #690 from LBL-EESA/fixes_for_gcc_11
Browse files Browse the repository at this point in the history
Fixes for gcc 11
burlen authored May 10, 2022
2 parents 8669d4c + ae8970c commit 83512cb
Showing 3 changed files with 24 additions and 18 deletions.
4 changes: 2 additions & 2 deletions alg/teca_normalize_coordinates.cxx
Original file line number Diff line number Diff line change
@@ -235,7 +235,7 @@ int internals::periodic_shift_x(p_teca_variant_array &x_out,
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtype-limits"
#if defined(__CUDACC__)
#pragma diag_suppress = unsigned_compare_with_zero
#pragma nv_diag_suppress = unsigned_compare_with_zero
#endif
unsigned long nx = x->size();
unsigned long x1 = nx - 1;
@@ -300,7 +300,7 @@ int internals::periodic_shift_x(p_teca_variant_array &x_out,
TECA_ERROR("Unsupported coordinate type " << x->get_class_name())
return -1;
#if defined(__CUDACC__)
#pragma diag_default = unsigned_compare_with_zero
#pragma nv_diag_default = unsigned_compare_with_zero
#endif
#pragma GCC diagnostic pop
}
1 change: 1 addition & 0 deletions core/teca_variant_array_impl.h
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
#include <type_traits>
#include <typeinfo>
#include <utility>
#include <limits>

#if defined(TECA_HAS_CUDA)
#include <thrust/device_ptr.h>
37 changes: 21 additions & 16 deletions io/teca_cf_time_axis_data.h
Original file line number Diff line number Diff line change
@@ -14,6 +14,10 @@
TECA_SHARED_OBJECT_FORWARD_DECL(teca_cf_time_axis_data)

/// A dataset used to read NetCDF CF2 time and metadata in parallel.
/** The dataset contains elements (one per file) of type:
* std::pair<p_teca_variant_array, teca_metadata> holding the time axis and
* associated NetCDF attributes.
*/
class TECA_EXPORT teca_cf_time_axis_data : public teca_dataset
{
public:
@@ -25,59 +29,60 @@ class TECA_EXPORT teca_cf_time_axis_data : public teca_dataset

using elem_t = std::pair<p_teca_variant_array, teca_metadata>;

// transfer the element associated with file to the dataset.
// after transfer the passed element is invalid in the calling context
/** transfer the element associated with file to the dataset.
* after transfer the passed element is invalid in the calling context
*/
void transfer(unsigned long file_id, elem_t &&data);

// access the file's element
/// access the file's element
elem_t &get(unsigned long file_id);
const elem_t &get(unsigned long file_id) const;

// given an element extract metadata
/// given an element extract metadata
static
teca_metadata &get_metadata(elem_t&elem)
{ return elem.second; }

/// given an element extract metadata
static
const teca_metadata &get_metadata(const elem_t &elem)
{ return elem.second; }

using teca_dataset::get_metadata;

// given an element extract the time axis
/// given an element extract the time axis
static
p_teca_variant_array get_variant_array(elem_t &elem)
{ return elem.first; }

/// given an element extract the time axis
static
const_p_teca_variant_array get_variant_array(const elem_t &elem)
{ return elem.first; }

// append the data from the other instance
/// append the data from the other instance
void append(const const_p_teca_dataset &other);
void shallow_append(const const_p_teca_dataset &other);

// return a unique string identifier
/// return a unique string identifier
std::string get_class_name() const override
{ return "teca_cf_time_axis_data"; }

// return an integer identifier uniquely naming the dataset type
/// return an integer identifier uniquely naming the dataset type
int get_type_code() const override;

// covert to boolean. true if the dataset is not empty.
// otherwise false.
/// covert to boolean. @returns true if the dataset is not empty, otherwise false.
explicit operator bool() const noexcept
{ return !this->empty(); }

// return true if the dataset is empty.
/// return true if the dataset is empty.
bool empty() const noexcept override;

// serialize the dataset to/from the given stream
// for I/O or communication
/// serialize the dataset to/from the given stream for I/O or communication
int to_stream(teca_binary_stream &) const override;
int from_stream(teca_binary_stream &) override;

// stream to/from human readable representation
/// stream to/from human readable representation
int to_stream(std::ostream &) const override;
int from_stream(std::istream &) override;

@@ -88,15 +93,15 @@ class TECA_EXPORT teca_cf_time_axis_data : public teca_dataset
/// @copydoc teca_dataset::shallow_copy(const p_teca_dataset &)
void shallow_copy(const p_teca_dataset &other) override;

// swap internals of the two objects
/// swap internals of the two objects
void swap(const p_teca_dataset &other) override;

#if defined(SWIG)
protected:
#else
public:
#endif
// NOTE: constructors are public to enable std::make_shared. do not use.
/// @note This constructor is public to enable std::make_shared. Do not use.
teca_cf_time_axis_data();

protected:

0 comments on commit 83512cb

Please sign in to comment.