OmniSciDB  04ee39c94c
anonymous_namespace{BumpAllocatorTest.cpp} Namespace Reference

Classes

struct  GpuInfo
 

Functions

bool skip_tests (const ExecutorDeviceType device_type)
 
std::shared_ptr< ResultSetrun_multiple_agg (const std::string &query_str, const ExecutorDeviceType device_type)
 
GpuInfo get_gpu_info ()
 
bool setup ()
 

Variables

size_t g_num_gpus {0}
 
bool g_keep_data {false}
 

Function Documentation

◆ get_gpu_info()

GpuInfo anonymous_namespace{BumpAllocatorTest.cpp}::get_gpu_info ( )

Definition at line 66 of file BumpAllocatorTest.cpp.

References CHECK, CHECK_GE, QueryRunner::QueryRunner::get(), and QueryRunner::QueryRunner::getCatalog().

Referenced by setup().

66  {
67  auto cat = QR::get()->getCatalog();
68  CHECK(cat);
69 
70  auto& data_mgr = cat->getDataMgr();
71  auto cuda_mgr = data_mgr.getCudaMgr();
72  CHECK(cuda_mgr);
73  const auto device_props_vec = cuda_mgr->getAllDeviceProperties();
74  CHECK_GE(device_props_vec.size(), size_t(1));
75  return GpuInfo{device_props_vec.front().globalMem, device_props_vec.size()};
76 }
#define CHECK_GE(x, y)
Definition: Logger.h:200
std::shared_ptr< Catalog_Namespace::Catalog > getCatalog() const
static QueryRunner * get()
Definition: QueryRunner.h:115
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run_multiple_agg()

std::shared_ptr<ResultSet> anonymous_namespace{BumpAllocatorTest.cpp}::run_multiple_agg ( const std::string &  query_str,
const ExecutorDeviceType  device_type 
)

Definition at line 55 of file BumpAllocatorTest.cpp.

References QueryRunner::QueryRunner::get(), and QueryRunner::QueryRunner::runSQL().

56  {
57  return QR::get()->runSQL(query_str, device_type, true, true);
58 }
virtual std::shared_ptr< ResultSet > runSQL(const std::string &query_str, const ExecutorDeviceType device_type, const bool hoist_literals=true, const bool allow_loop_joins=true)
static QueryRunner * get()
Definition: QueryRunner.h:115
+ Here is the call graph for this function:

◆ setup()

bool anonymous_namespace{BumpAllocatorTest.cpp}::setup ( )

Definition at line 78 of file BumpAllocatorTest.cpp.

References BASE_PATH, g_num_gpus, QueryRunner::QueryRunner::get(), get_gpu_info(), QueryRunner::QueryRunner::init(), LOG, and logger::WARNING.

Referenced by main().

78  {
79  // Only initialize the QueryRunner once. We will reset the system catalog using the
80  // resetWithParameters method as needed for each test.
81  QR::init(BASE_PATH, /*udf_filename=*/"", /*max_gpu_mem=*/1000000000);
82 
83  if (!QR::get()->gpusPresent()) {
84  LOG(WARNING) << "No GPUs detected. Skipping all Bump Allocator tests.";
85  return false;
86  }
87 
88  const auto gpu_info = get_gpu_info();
89  g_num_gpus = gpu_info.num_gpus; // Using the global to pass into tests
90  return true;
91 }
#define LOG(tag)
Definition: Logger.h:182
static QueryRunner * init(const char *db_path, const std::string &udf_filename="", const size_t max_gpu_mem=0, const int reserved_gpu_mem=256<< 20)
Definition: QueryRunner.h:70
#define BASE_PATH
static QueryRunner * get()
Definition: QueryRunner.h:115
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ skip_tests()

bool anonymous_namespace{BumpAllocatorTest.cpp}::skip_tests ( const ExecutorDeviceType  device_type)

Definition at line 42 of file BumpAllocatorTest.cpp.

References QueryRunner::QueryRunner::get(), GPU, and QueryRunner::QueryRunner::gpusPresent().

42  {
43 #ifdef HAVE_CUDA
44  return device_type == ExecutorDeviceType::GPU && !QR::get()->gpusPresent();
45 #else
46  return device_type == ExecutorDeviceType::GPU;
47 #endif
48 }
static QueryRunner * get()
Definition: QueryRunner.h:115
+ Here is the call graph for this function:

Variable Documentation

◆ g_keep_data

bool anonymous_namespace{BumpAllocatorTest.cpp}::g_keep_data {false}

◆ g_num_gpus

size_t anonymous_namespace{BumpAllocatorTest.cpp}::g_num_gpus {0}