OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler Struct Reference

Static Public Member Functions

static auto yieldGpuPtrFetcher ()
 
static auto yieldGpuDatumFetcher (Data_Namespace::DataMgr *data_mgr_ptr, const int device_id)
 
static auto yieldCpuDatumFetcher ()
 
template<typename... T>
static auto fetch (const ResultSet::GeoReturnType return_type, Data_Namespace::DataMgr *data_mgr, const bool fetch_data_from_gpu, const int device_id, T &&...vals)
 

Detailed Description

Definition at line 977 of file ResultSetIteration.cpp.

Member Function Documentation

template<typename... T>
static auto anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::fetch ( const ResultSet::GeoReturnType  return_type,
Data_Namespace::DataMgr data_mgr,
const bool  fetch_data_from_gpu,
const int  device_id,
T &&...  vals 
)
inlinestatic

Definition at line 999 of file ResultSetIteration.cpp.

References ResultSet::GeoTargetValueGpuPtr.

1003  {
1004  auto ad_arr_generator = [&](auto datum_fetcher) {
1005  constexpr int num_vals = sizeof...(vals);
1006  static_assert(
1007  num_vals % 2 == 0,
1008  "Must have consistent pointer/size pairs for lazy fetch of geo target values.");
1009  const auto vals_vector = std::vector<int64_t>{vals...};
1010 
1011  std::array<VarlenDatumPtr, num_vals / 2> ad_arr;
1012  size_t ctr = 0;
1013  for (size_t i = 0; i < vals_vector.size(); i += 2) {
1014  ad_arr[ctr++] = datum_fetcher(vals_vector[i], vals_vector[i + 1]);
1015  }
1016  return ad_arr;
1017  };
1018 
1019  if (fetch_data_from_gpu) {
1021  return ad_arr_generator(yieldGpuPtrFetcher());
1022  } else {
1023  return ad_arr_generator(yieldGpuDatumFetcher(data_mgr, device_id));
1024  }
1025  } else {
1026  return ad_arr_generator(yieldCpuDatumFetcher());
1027  }
1028  }
static auto yieldGpuDatumFetcher(Data_Namespace::DataMgr *data_mgr_ptr, const int device_id)
std::unique_ptr< VarlenDatum > VarlenDatumPtr
std::unique_ptr< ArrayDatum > fetch_data_from_gpu(int64_t varlen_ptr, const int64_t length, Data_Namespace::DataMgr *data_mgr, const int device_id)
static auto anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::yieldCpuDatumFetcher ( )
inlinestatic

Definition at line 992 of file ResultSetIteration.cpp.

992  {
993  return [](const int64_t ptr, const int64_t length) -> VarlenDatumPtr {
994  return std::make_unique<VarlenDatum>(length, reinterpret_cast<int8_t*>(ptr), false);
995  };
996  }
std::unique_ptr< VarlenDatum > VarlenDatumPtr
static auto anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::yieldGpuDatumFetcher ( Data_Namespace::DataMgr data_mgr_ptr,
const int  device_id 
)
inlinestatic

Definition at line 984 of file ResultSetIteration.cpp.

References anonymous_namespace{ResultSetIteration.cpp}::fetch_data_from_gpu().

985  {
986  return [data_mgr_ptr, device_id](const int64_t ptr,
987  const int64_t length) -> VarlenDatumPtr {
988  return fetch_data_from_gpu(ptr, length, data_mgr_ptr, device_id);
989  };
990  }
std::unique_ptr< VarlenDatum > VarlenDatumPtr
std::unique_ptr< ArrayDatum > fetch_data_from_gpu(int64_t varlen_ptr, const int64_t length, Data_Namespace::DataMgr *data_mgr, const int device_id)

+ Here is the call graph for this function:

static auto anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::yieldGpuPtrFetcher ( )
inlinestatic

Definition at line 978 of file ResultSetIteration.cpp.

978  {
979  return [](const int64_t ptr, const int64_t length) -> VarlenDatumPtr {
980  return std::make_unique<VarlenDatum>(length, reinterpret_cast<int8_t*>(ptr), false);
981  };
982  }
std::unique_ptr< VarlenDatum > VarlenDatumPtr

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