OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BoundingBoxIntersectKeyHandler Struct Reference

#include <HashJoinKeyHandlers.h>

+ Collaboration diagram for BoundingBoxIntersectKeyHandler:

Public Member Functions

 BoundingBoxIntersectKeyHandler (const size_t key_dims_count, const JoinColumn *join_column, const double *bucket_sizes_for_dimension)
 
template<typename T , typename KEY_BUFF_HANDLER >
DEVICE int operator() (JoinColumnIterator *join_column_iterators, T *key_scratch_buff, KEY_BUFF_HANDLER f) const
 
DEVICE size_t get_number_of_columns () const
 
DEVICE size_t get_key_component_count () const
 
DEVICE const JoinColumnget_join_columns () const
 
DEVICE const JoinColumnTypeInfoget_join_column_type_infos () const
 

Public Attributes

const size_t key_dims_count_
 
const JoinColumnjoin_column_
 
const double * bucket_sizes_for_dimension_
 

Detailed Description

Definition at line 133 of file HashJoinKeyHandlers.h.

Constructor & Destructor Documentation

BoundingBoxIntersectKeyHandler::BoundingBoxIntersectKeyHandler ( const size_t  key_dims_count,
const JoinColumn join_column,
const double *  bucket_sizes_for_dimension 
)
inline

Definition at line 134 of file HashJoinKeyHandlers.h.

137  : key_dims_count_(key_dims_count)
138  , join_column_(join_column)
139  , bucket_sizes_for_dimension_(bucket_sizes_for_dimension) {}

Member Function Documentation

DEVICE const JoinColumnTypeInfo* BoundingBoxIntersectKeyHandler::get_join_column_type_infos ( ) const
inline

Definition at line 180 of file HashJoinKeyHandlers.h.

180 { return nullptr; }
DEVICE const JoinColumn* BoundingBoxIntersectKeyHandler::get_join_columns ( ) const
inline

Definition at line 178 of file HashJoinKeyHandlers.h.

References join_column_.

178 { return join_column_; }
DEVICE size_t BoundingBoxIntersectKeyHandler::get_key_component_count ( ) const
inline

Definition at line 176 of file HashJoinKeyHandlers.h.

References key_dims_count_.

176 { return key_dims_count_; }
DEVICE size_t BoundingBoxIntersectKeyHandler::get_number_of_columns ( ) const
inline

Definition at line 174 of file HashJoinKeyHandlers.h.

174 { return 1; }
template<typename T , typename KEY_BUFF_HANDLER >
DEVICE int BoundingBoxIntersectKeyHandler::operator() ( JoinColumnIterator join_column_iterators,
T *  key_scratch_buff,
KEY_BUFF_HANDLER  f 
) const
inline

Definition at line 142 of file HashJoinKeyHandlers.h.

References bucket_sizes_for_dimension_, f(), fixed_width_double_decode_noinline(), key_dims_count_, JoinColumnIterator::ptr(), and SUFFIX.

144  {
145  // TODO(adb): hard-coding the 2D case w/ bounds for now. Should support n-dims with a
146  // check to ensure we are not exceeding maximum number of dims for coalesced keys
147  double bounds[4];
148  for (size_t j = 0; j < 2 * key_dims_count_; j++) {
149  bounds[j] =
150  SUFFIX(fixed_width_double_decode_noinline)(join_column_iterators->ptr(), j);
151  }
152 
153  const auto x_bucket_sz = bucket_sizes_for_dimension_[0];
154  const auto y_bucket_sz = bucket_sizes_for_dimension_[1];
155 
156  for (int64_t x = floor(bounds[0] * x_bucket_sz); x <= floor(bounds[2] * x_bucket_sz);
157  x++) {
158  for (int64_t y = floor(bounds[1] * y_bucket_sz);
159  y <= floor(bounds[3] * y_bucket_sz);
160  y++) {
161  key_scratch_buff[0] = x;
162  key_scratch_buff[1] = y;
163 
164  const auto err =
165  f(join_column_iterators[0].index, key_scratch_buff, key_dims_count_);
166  if (err) {
167  return err;
168  }
169  }
170  }
171  return 0;
172  }
#define SUFFIX(name)
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)
DEVICE NEVER_INLINE double SUFFIX() fixed_width_double_decode_noinline(const int8_t *byte_stream, const int64_t pos)
Definition: DecodersImpl.h:134
DEVICE FORCE_INLINE const int8_t * ptr() const

+ Here is the call graph for this function:

Member Data Documentation

const double* BoundingBoxIntersectKeyHandler::bucket_sizes_for_dimension_

Definition at line 184 of file HashJoinKeyHandlers.h.

Referenced by operator()().

const JoinColumn* BoundingBoxIntersectKeyHandler::join_column_

Definition at line 183 of file HashJoinKeyHandlers.h.

Referenced by get_join_columns().

const size_t BoundingBoxIntersectKeyHandler::key_dims_count_

Definition at line 182 of file HashJoinKeyHandlers.h.

Referenced by get_key_component_count(), and operator()().


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