OmniSciDB  d2f719934e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Column< T > Struct Template Reference

#include <OmniSciTypes.h>

Public Member Functions

DEVICE T & operator[] (const unsigned int index) const
 
DEVICE int64_t size () const
 
DEVICE bool isNull (int64_t index) const
 
DEVICE void setNull (int64_t index)
 
DEVICE Column< T > & operator= (const Column< T > &other)
 
template<>
DEVICE bool isNull (int64_t index) const
 
template<>
DEVICE void setNull (int64_t index)
 

Public Attributes

T * ptr_
 
int64_t size_
 

Detailed Description

template<typename T>
struct Column< T >

Definition at line 218 of file OmniSciTypes.h.

Member Function Documentation

template<typename T>
DEVICE bool Column< T >::isNull ( int64_t  index) const
inline

Definition at line 240 of file OmniSciTypes.h.

References is_null(), and Column< T >::ptr_.

Referenced by ct_binding_scalar_multiply__cpu_template(), and row_adder().

240 { return is_null(ptr_[index]); }
T * ptr_
Definition: OmniSciTypes.h:219
CONSTEXPR DEVICE bool is_null(const T &value)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<>
DEVICE bool Column< TextEncodingDict >::isNull ( int64_t  index) const
inline

Definition at line 270 of file OmniSciTypes.h.

References is_null().

270  {
271  return is_null(ptr_[index].value);
272 }
T * ptr_
Definition: OmniSciTypes.h:219
CONSTEXPR DEVICE bool is_null(const T &value)

+ Here is the call graph for this function:

template<typename T>
DEVICE Column<T>& Column< T >::operator= ( const Column< T > &  other)
inline

Definition at line 242 of file OmniSciTypes.h.

References i, Column< T >::ptr_, Column< T >::size(), and omnisci.dtypes::T.

242  {
243 #ifndef __CUDACC__
244  if (size() == other.size()) {
245  memcpy(ptr_, &other[0], other.size() * sizeof(T));
246  } else {
247  throw std::runtime_error("cannot copy assign columns with different sizes");
248  }
249 #else
250  if (size() == other.size()) {
251  for (unsigned int i = 0; i < size(); i++) {
252  ptr_[i] = other[i];
253  }
254  } else {
255  // TODO: set error
256  }
257 #endif
258  return *this;
259  }
DEVICE int64_t size() const
Definition: OmniSciTypes.h:238
T * ptr_
Definition: OmniSciTypes.h:219

+ Here is the call graph for this function:

template<typename T>
DEVICE T& Column< T >::operator[] ( const unsigned int  index) const
inline

Definition at line 222 of file OmniSciTypes.h.

References DEVICE, Column< T >::ptr_, set_null(), Column< T >::size_, and omnisci.dtypes::T.

222  {
223  if (index >= size_) {
224 #ifndef __CUDACC__
225  throw std::runtime_error("column buffer index is out of range");
226 #else
227  static DEVICE T null_value;
228  if constexpr (std::is_same_v<T, TextEncodingDict>) {
229  set_null(null_value.value);
230  } else {
231  set_null(null_value);
232  }
233  return null_value;
234 #endif
235  }
236  return ptr_[index];
237  }
T * ptr_
Definition: OmniSciTypes.h:219
#define DEVICE
CONSTEXPR DEVICE void set_null(T &value)
int64_t size_
Definition: OmniSciTypes.h:220

+ Here is the call graph for this function:

template<typename T>
DEVICE void Column< T >::setNull ( int64_t  index)
inline

Definition at line 241 of file OmniSciTypes.h.

References Column< T >::ptr_, and set_null().

Referenced by ct_binding_scalar_multiply__cpu_template(), ct_test_nullable(), ct_union_pushdown_projection__cpu_template(), ct_union_pushdown_stats__cpu_template(), and row_adder().

241 { set_null(ptr_[index]); }
T * ptr_
Definition: OmniSciTypes.h:219
CONSTEXPR DEVICE void set_null(T &value)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<>
DEVICE void Column< TextEncodingDict >::setNull ( int64_t  index)
inline

Definition at line 275 of file OmniSciTypes.h.

References set_null().

275  {
276  set_null(ptr_[index].value);
277 }
T * ptr_
Definition: OmniSciTypes.h:219
CONSTEXPR DEVICE void set_null(T &value)

+ Here is the call graph for this function:

Member Data Documentation

template<typename T>
int64_t Column< T >::size_

Definition at line 220 of file OmniSciTypes.h.

Referenced by Column< T >::operator[](), and Column< T >::size().


The documentation for this struct was generated from the following file: