OmniSciDB  bf83d84833
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{TableFunctionExecutionContext.cpp} Namespace Reference

Enumerations

enum  {
  ERROR_BUFFER, COL_BUFFERS, COL_SIZES, OUTPUT_BUFFERS,
  OUTPUT_ROW_COUNT, KERNEL_PARAM_COUNT
}
 

Functions

template<typename T >
const int8_t * create_literal_buffer (T literal, const ExecutorDeviceType device_type, std::vector< std::unique_ptr< char[]>> &literals_owner, CudaAllocator *gpu_allocator)
 
size_t get_output_row_count (const TableFunctionExecutionUnit &exe_unit, size_t input_element_count)
 

Enumeration Type Documentation

Function Documentation

template<typename T >
const int8_t* anonymous_namespace{TableFunctionExecutionContext.cpp}::create_literal_buffer ( literal,
const ExecutorDeviceType  device_type,
std::vector< std::unique_ptr< char[]>> &  literals_owner,
CudaAllocator gpu_allocator 
)

Definition at line 28 of file TableFunctionExecutionContext.cpp.

References CudaAllocator::alloc(), CHECK, CHECK_LE, CudaAllocator::copyToDevice(), CPU, GPU, omnisci.dtypes::T, and UNREACHABLE.

Referenced by TableFunctionExecutionContext::execute().

31  {
32  CHECK_LE(sizeof(T), sizeof(int64_t)); // pad to 8 bytes
33  switch (device_type) {
35  literals_owner.emplace_back(std::make_unique<char[]>(sizeof(int64_t)));
36  std::memcpy(literals_owner.back().get(), &literal, sizeof(T));
37  return reinterpret_cast<const int8_t*>(literals_owner.back().get());
38  }
40  CHECK(gpu_allocator);
41  const auto gpu_literal_buf_ptr = gpu_allocator->alloc(sizeof(int64_t));
42  gpu_allocator->copyToDevice(
43  gpu_literal_buf_ptr, reinterpret_cast<int8_t*>(&literal), sizeof(T));
44  return gpu_literal_buf_ptr;
45  }
46  }
47  UNREACHABLE();
48  return nullptr;
49 }
void copyToDevice(int8_t *device_dst, const int8_t *host_src, const size_t num_bytes) const override
#define UNREACHABLE()
Definition: Logger.h:241
int8_t * alloc(const size_t num_bytes) override
#define CHECK_LE(x, y)
Definition: Logger.h:208
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t anonymous_namespace{TableFunctionExecutionContext.cpp}::get_output_row_count ( const TableFunctionExecutionUnit exe_unit,
size_t  input_element_count 
)

Definition at line 51 of file TableFunctionExecutionContext.cpp.

References table_functions::TableFunction::getOutputRowSizeType(), table_functions::kConstant, table_functions::kUserSpecifiedConstantParameter, table_functions::kUserSpecifiedRowMultiplier, TableFunctionExecutionUnit::output_buffer_size_param, TableFunctionExecutionUnit::table_func, and UNREACHABLE.

Referenced by TableFunctionExecutionContext::launchCpuCode(), and TableFunctionExecutionContext::launchGpuCode().

52  {
53  size_t allocated_output_row_count = 0;
54  switch (exe_unit.table_func.getOutputRowSizeType()) {
57  allocated_output_row_count = exe_unit.output_buffer_size_param;
58  break;
59  }
61  allocated_output_row_count =
62  exe_unit.output_buffer_size_param * input_element_count;
63  break;
64  }
65  default: {
66  UNREACHABLE();
67  }
68  }
69  return allocated_output_row_count;
70 }
const table_functions::TableFunction table_func
#define UNREACHABLE()
Definition: Logger.h:241
OutputBufferSizeType getOutputRowSizeType() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function: