Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

ResultSet refactoring and clean-up [04/N] #216

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions omniscidb/QueryEngine/CompilationOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
#include "QueryEngine/CompilationOptions.h"
#include <ostream>

std::string deviceToString(const ExecutorDeviceType& dt) {
return (dt == ExecutorDeviceType::CPU ? "CPU" : "GPU");
}

#ifndef __CUDACC__
std::ostream& operator<<(std::ostream& os, const ExecutionOptions& eo) {
os << "output_columnar_hint=" << eo.output_columnar_hint << "\n"
Expand Down
15 changes: 1 addition & 14 deletions omniscidb/QueryEngine/CompilationOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,15 @@
#include <ostream>
#include <vector>

#ifndef __CUDACC__
#include <ostream>
#endif

#include "Shared/Config.h"

enum class ExecutorDeviceType { CPU = 0, GPU };
#ifndef __CUDACC__
inline std::ostream& operator<<(std::ostream& os, ExecutorDeviceType const dt) {
constexpr char const* strings[]{"CPU", "GPU"};
return os << strings[static_cast<int>(dt)];
}
#endif
#include "Shared/DeviceType.h"

enum class ExecutorOptLevel { Default, ReductionJIT };

enum class ExecutorExplainType { Default, Optimized };

enum class ExecutorDispatchMode { KernelPerFragment, MultifragmentKernel };

std::string deviceToString(const ExecutorDeviceType& dt);

struct CompilationOptions {
ExecutorDeviceType device_type;
bool hoist_literals;
Expand Down
5 changes: 3 additions & 2 deletions omniscidb/QueryEngine/Descriptors/QueryMemoryDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@
#include <unordered_map>
#include <vector>

#include <Shared/SqlTypesLayout.h>
#include <Shared/TargetInfo.h>
#include "Shared/DeviceType.h"
#include "Shared/SqlTypesLayout.h"
#include "Shared/TargetInfo.h"

class Executor;
class QueryExecutionContext;
Expand Down
27 changes: 27 additions & 0 deletions omniscidb/Shared/DeviceType.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright 2022 OmniSci, Inc.
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include <string>

#ifndef __CUDACC__
#include <ostream>
#endif

enum class ExecutorDeviceType { CPU = 0, GPU };

#ifndef __CUDACC__
inline std::ostream& operator<<(std::ostream& os, ExecutorDeviceType dt) {
constexpr char const* strings[]{"CPU", "GPU"};
return os << strings[static_cast<int>(dt)];
}
#endif

inline std::string deviceToString(ExecutorDeviceType dt) {
return (dt == ExecutorDeviceType::CPU ? "CPU" : "GPU");
}