OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FixedWidthSmallDate Class Reference

#include <Codec.h>

+ Inheritance diagram for FixedWidthSmallDate:
+ Collaboration diagram for FixedWidthSmallDate:

Public Member Functions

 FixedWidthSmallDate (const size_t byte_width)
 
llvm::Instruction * codegenDecode (llvm::Value *byte_stream, llvm::Value *pos, llvm::Module *llvm_module) const override
 
- Public Member Functions inherited from Decoder
virtual ~Decoder ()
 

Private Attributes

const size_t byte_width_
 
const int32_t null_val_
 

Static Private Attributes

static constexpr int64_t ret_null_val_ = NULL_BIGINT
 

Detailed Description

Definition at line 79 of file Codec.h.

Constructor & Destructor Documentation

FixedWidthSmallDate::FixedWidthSmallDate ( const size_t  byte_width)

Definition at line 86 of file Codec.cpp.

87  : byte_width_{byte_width}, null_val_{byte_width == 4 ? NULL_INT : NULL_SMALLINT} {}
#define NULL_INT
const int32_t null_val_
Definition: Codec.h:88
#define NULL_SMALLINT
const size_t byte_width_
Definition: Codec.h:87

Member Function Documentation

llvm::Instruction * FixedWidthSmallDate::codegenDecode ( llvm::Value *  byte_stream,
llvm::Value *  pos,
llvm::Module *  llvm_module 
) const
overridevirtual

Implements Decoder.

Definition at line 89 of file Codec.cpp.

References run_benchmark_import::args, byte_width_, CHECK, f(), null_val_, and ret_null_val_.

91  {
92  auto& context = llvm_module->getContext();
93  auto f = llvm_module->getFunction("fixed_width_small_date_decode");
94  CHECK(f);
95  llvm::Value* args[] = {
96  byte_stream,
97  llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), byte_width_),
98  llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), null_val_),
99  llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), ret_null_val_),
100  pos};
101  return llvm::CallInst::Create(f, args);
102 }
const int32_t null_val_
Definition: Codec.h:88
static constexpr int64_t ret_null_val_
Definition: Codec.h:89
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)
#define CHECK(condition)
Definition: Logger.h:291
const size_t byte_width_
Definition: Codec.h:87

+ Here is the call graph for this function:

Member Data Documentation

const size_t FixedWidthSmallDate::byte_width_
private

Definition at line 87 of file Codec.h.

Referenced by codegenDecode().

const int32_t FixedWidthSmallDate::null_val_
private

Definition at line 88 of file Codec.h.

Referenced by codegenDecode().

constexpr int64_t FixedWidthSmallDate::ret_null_val_ = NULL_BIGINT
staticprivate

Definition at line 89 of file Codec.h.

Referenced by codegenDecode().


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