OmniSciDB  c07336695a
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 963 of file ResultSetIteration.cpp.

Member Function Documentation

◆ fetch()

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 985 of file ResultSetIteration.cpp.

References ResultSet::GeoTargetValueGpuPtr.

989  {
990  auto ad_arr_generator = [&](auto datum_fetcher) {
991  constexpr int num_vals = sizeof...(vals);
992  static_assert(
993  num_vals % 2 == 0,
994  "Must have consistent pointer/size pairs for lazy fetch of geo target values.");
995  const auto vals_vector = std::vector<int64_t>{vals...};
996 
997  std::array<VarlenDatumPtr, num_vals / 2> ad_arr;
998  size_t ctr = 0;
999  for (size_t i = 0; i < vals_vector.size(); i += 2) {
1000  ad_arr[ctr++] = datum_fetcher(vals_vector[i], vals_vector[i + 1]);
1001  }
1002  return ad_arr;
1003  };
1004 
1005  if (fetch_data_from_gpu) {
1007  return ad_arr_generator(yieldGpuPtrFetcher());
1008  } else {
1009  return ad_arr_generator(yieldGpuDatumFetcher(data_mgr, device_id));
1010  }
1011  } else {
1012  return ad_arr_generator(yieldCpuDatumFetcher());
1013  }
1014  }
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)

◆ yieldCpuDatumFetcher()

static auto anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::yieldCpuDatumFetcher ( )
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

◆ yieldGpuDatumFetcher()

static auto anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::yieldGpuDatumFetcher ( Data_Namespace::DataMgr data_mgr_ptr,
const int  device_id 
)
inlinestatic

Definition at line 970 of file ResultSetIteration.cpp.

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

971  {
972  return [data_mgr_ptr, device_id](const int64_t ptr,
973  const int64_t length) -> VarlenDatumPtr {
974  return fetch_data_from_gpu(ptr, length, data_mgr_ptr, device_id);
975  };
976  }
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:

◆ yieldGpuPtrFetcher()

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

Definition at line 964 of file ResultSetIteration.cpp.

964  {
965  return [](const int64_t ptr, const int64_t length) -> VarlenDatumPtr {
966  return std::make_unique<VarlenDatum>(length, reinterpret_cast<int8_t*>(ptr), false);
967  };
968  }
std::unique_ptr< VarlenDatum > VarlenDatumPtr

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