OmniSciDB  04ee39c94c
LowGpuBufferMemoryCpuRetry Class Reference
+ Inheritance diagram for LowGpuBufferMemoryCpuRetry:
+ Collaboration diagram for LowGpuBufferMemoryCpuRetry:

Public Member Functions

void SetUp () override
 
void TearDown () override
 

Private Attributes

size_t min_mem_allocation_state_
 
bool allow_cpu_retry_state_
 

Detailed Description

Definition at line 157 of file BumpAllocatorTest.cpp.

Member Function Documentation

◆ SetUp()

void LowGpuBufferMemoryCpuRetry::SetUp ( )
inlineoverride

Definition at line 159 of file BumpAllocatorTest.cpp.

References CPU, g_allow_cpu_retry, g_min_memory_allocation_size, anonymous_namespace{BumpAllocatorTest.cpp}::g_num_gpus, QueryRunner::QueryRunner::get(), row_count_per_gpu, run_multiple_agg(), QueryRunner::QueryRunner::runDDLStatement(), and to_string().

159  {
160  const std::string drop_table_stmt{"DROP TABLE IF EXISTS test;"};
161  QR::get()->runDDLStatement(drop_table_stmt);
162  const std::string create_table_stmt{
163  "CREATE TABLE test (x INT, y BIGINT) WITH (FRAGMENT_SIZE=32);"};
164  QR::get()->runDDLStatement(create_table_stmt);
165 
166  // Insert enough data to exceed the max buffer entry guess and force a pre-flight CPU
167  // count
168  for (size_t i = 0; i < row_count_per_gpu * g_num_gpus; i++) {
169  const std::string insert_stmt{"INSERT INTO test VALUES (" + std::to_string(i) +
170  ", " + std::to_string(i) + ");"};
172  }
173 
174  // Min memory allocation size set to 2GB to guarantee OOM during allocation
176  g_min_memory_allocation_size = 2000000000;
177 
178  // allow CPU retry on
180  g_allow_cpu_retry = true;
181  }
size_t g_min_memory_allocation_size
Definition: Execute.cpp:93
bool g_allow_cpu_retry
Definition: Execute.cpp:72
constexpr size_t row_count_per_gpu
std::string to_string(char const *&&v)
virtual void runDDLStatement(const std::string &)
static QueryRunner * get()
Definition: QueryRunner.h:115
TQueryResult run_multiple_agg(std::string sql)
+ Here is the call graph for this function:

◆ TearDown()

void LowGpuBufferMemoryCpuRetry::TearDown ( )
inlineoverride

Definition at line 183 of file BumpAllocatorTest.cpp.

References g_allow_cpu_retry, anonymous_namespace{BumpAllocatorTest.cpp}::g_keep_data, g_min_memory_allocation_size, QueryRunner::QueryRunner::get(), and QueryRunner::QueryRunner::runDDLStatement().

183  {
184  if (!g_keep_data) {
185  const std::string drop_table_stmt{"DROP TABLE IF EXISTS test;"};
186  QR::get()->runDDLStatement(drop_table_stmt);
187  }
188 
191  }
size_t g_min_memory_allocation_size
Definition: Execute.cpp:93
bool g_allow_cpu_retry
Definition: Execute.cpp:72
virtual void runDDLStatement(const std::string &)
static QueryRunner * get()
Definition: QueryRunner.h:115
+ Here is the call graph for this function:

Member Data Documentation

◆ allow_cpu_retry_state_

bool LowGpuBufferMemoryCpuRetry::allow_cpu_retry_state_
private

Definition at line 195 of file BumpAllocatorTest.cpp.

◆ min_mem_allocation_state_

size_t LowGpuBufferMemoryCpuRetry::min_mem_allocation_state_
private

Definition at line 194 of file BumpAllocatorTest.cpp.


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