PrevUpHomeNext

Class template extents

boost::compute::extents

Synopsis

// In header: <boost/compute/utility/extents.hpp>

template<size_t N> 
class extents {
public:
  // types
  typedef size_t size_type;

  // construct/copy/destruct
  extents();
  explicit extents(size_t);
  extents(std::initializer_list< size_t >);

  // public member functions
  size_type size() const;
  size_type linear() const;
  size_t * data();
  const size_t * data() const;
  size_t & operator[](size_t);
  const size_t & operator[](size_t) const;
  bool operator==(const extents &) const;
  bool operator!=(const extents &) const;

  // public data members
  static const size_type static_size;
};

Description

The extents class contains an array of n-dimensional extents.

See Also:

dim()

extents public construct/copy/destruct

  1. extents();

    Creates an extents object with each component set to zero.

    For example:

    extents<3> exts(); // (0, 0, 0)
    

  2. explicit extents(size_t value);

    Creates an extents object with each component set to value.

    For example:

    extents<3> exts(1); // (1, 1, 1)
    

  3. extents(std::initializer_list< size_t > values);
    Creates an extents object with values.

extents public member functions

  1. size_type size() const;
    Returns the size (i.e. dimensionality) of the extents array.
  2. size_type linear() const;

    Returns the linear size of the extents. This is equivalent to the product of each extent in each dimension.

  3. size_t * data();

    Returns a pointer to the extents data array.

    This is useful for passing the extents data to OpenCL APIs which expect an array of size_t.

  4. const size_t * data() const;

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  5. size_t & operator[](size_t index);
    Returns a reference to the extent at index.
  6. const size_t & operator[](size_t index) const;

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  7. bool operator==(const extents & other) const;
    Returns true if the extents in *this are the same as other.
  8. bool operator!=(const extents & other) const;
    Returns true if the extents in *this are not the same as other.

PrevUpHomeNext