Classes | Namespaces | Enumerations | Functions
expressions.hpp File Reference

Class definitions for building and evaluating abstract syntax tree expressions. More...

#include <cudf/ast/ast_operator.hpp>
#include <cudf/fixed_point/fixed_point.hpp>
#include <cudf/scalar/scalar.hpp>
#include <cudf/scalar/scalar_device_view.cuh>
#include <cudf/table/table_view.hpp>
#include <cudf/types.hpp>
#include <cudf/utilities/error.hpp>
#include <cstdint>
#include <functional>
#include <initializer_list>
#include <memory>
#include <optional>
#include <vector>

Go to the source code of this file.

Classes

struct  cudf::ast::expression
 A generic expression that can be evaluated to return a value. More...
 
class  cudf::ast::generic_scalar_device_view
 A type-erased scalar_device_view where the value is a fixed width type or a string. More...
 
class  cudf::ast::literal
 A literal value used in an abstract syntax tree. More...
 
class  cudf::ast::column_reference
 A expression referring to data from a column in a table. More...
 
class  cudf::ast::operation
 An operation expression holds an operator and zero or more operands. More...
 
class  cudf::ast::detail::predicate
 An expression that represents a predicate. More...
 
class  cudf::ast::column_name_reference
 A expression referring to data from a column in a table. More...
 
class  cudf::ast::tree
 An AST expression tree. It owns and contains multiple dependent expressions. All the expressions are destroyed when the tree is destroyed. More...
 

Namespaces

 cudf
 cuDF interfaces
 

Enumerations

enum class  cudf::ast::table_reference { LEFT , RIGHT , OUTPUT }
 Enum of table references. More...
 
enum class  cudf::ast::jit::op : uint8_t {
  IDENTITY , IS_NULL , COALESCE , PREDICATE ,
  ADD , SUB , MUL , DIV ,
  NEG , ABS , MOD , PYMOD ,
  TRUE_DIV , FLOOR_DIV , ADD_OVERFLOW , SUB_OVERFLOW ,
  MUL_OVERFLOW , DIV_OVERFLOW , NEG_OVERFLOW , ABS_OVERFLOW ,
  MOD_OVERFLOW , CHECK_PRECISION , BITWISE_AND , BITWISE_INVERT ,
  BITWISE_OR , BITWISE_XOR , BITWISE_SHIFT_LEFT , BITWISE_SHIFT_RIGHT ,
  CAST_TO_BOOL8 , CAST_TO_INT8 , CAST_TO_INT16 , CAST_TO_INT32 ,
  CAST_TO_INT64 , CAST_TO_UINT8 , CAST_TO_UINT16 , CAST_TO_UINT32 ,
  CAST_TO_UINT64 , CAST_TO_FLOAT32 , CAST_TO_FLOAT64 , CAST_TO_DECIMAL32 ,
  CAST_TO_DECIMAL64 , CAST_TO_DECIMAL128 , RESCALE , EQUAL ,
  NOT_EQUAL , GREATER , GREATER_EQUAL , LESS ,
  LESS_EQUAL , NULL_EQUAL , NULL_LOGICAL_AND , NULL_LOGICAL_OR ,
  LOGICAL_AND , LOGICAL_OR , LOGICAL_NOT , IF_ELSE ,
  CBRT , CEIL , FLOOR , RINT ,
  SQRT , POW , EXP , LOG ,
  ARCCOS , ARCCOSH , ARCSIN , ARCSINH ,
  ARCTAN , ARCTANH , COS , COSH ,
  SIN , SINH , TAN , TANH
}
 JIT operation kinds for cudf::ast::jit::operation. More...
 

Functions

expression const & cudf::ast::jit::operation (ast::tree &tree, op operator_id, std::vector< std::reference_wrapper< expression const >> const &args, cudf::error_policy error_policy=cudf::error_policy::PROPAGATE, std::optional< int32_t > target_scale=std::nullopt)
 Creates a JIT expression operation from an opcode and argument list. More...
 
expression const & cudf::ast::jit::operation (ast::tree &tree, op operator_id, std::initializer_list< std::reference_wrapper< expression const >> args, cudf::error_policy error_policy=cudf::error_policy::PROPAGATE, std::optional< int32_t > target_scale=std::nullopt)
 Creates a JIT expression operation from an opcode and argument list. More...
 

Detailed Description

Class definitions for building and evaluating abstract syntax tree expressions.

Definition in file expressions.hpp.

Enumeration Type Documentation

◆ op

enum cudf::ast::jit::op : uint8_t
strong

JIT operation kinds for cudf::ast::jit::operation.

Enumerator
ADD 

Arithmetic operators.

ADD_OVERFLOW 

Overflow-checking Arithmetic functions. raise errors on overflow, division by zero, etc.

BITWISE_AND 

Bitwise operators.

CAST_TO_BOOL8 

Type conversion/scaling operators.

EQUAL 

Comparison & Logic operators.

CBRT 

Mathematical operators.

ARCCOS 

Trigonometric operators.

Definition at line 698 of file expressions.hpp.

Function Documentation

◆ operation() [1/2]

expression const& cudf::ast::jit::operation ( ast::tree tree,
op  operator_id,
std::initializer_list< std::reference_wrapper< expression const >>  args,
cudf::error_policy  error_policy = cudf::error_policy::PROPAGATE,
std::optional< int32_t >  target_scale = std::nullopt 
)

Creates a JIT expression operation from an opcode and argument list.

Parameters
treeThe expression tree to which this expression will be added.
operator_idThe JIT operation kind.
argsOperation arguments.
error_policySpecifies how fallible operations handle errors.
target_scaleRequired only for op::RESCALE.
Returns
A reference to the created operation expression.

◆ operation() [2/2]

expression const& cudf::ast::jit::operation ( ast::tree tree,
op  operator_id,
std::vector< std::reference_wrapper< expression const >> const &  args,
cudf::error_policy  error_policy = cudf::error_policy::PROPAGATE,
std::optional< int32_t >  target_scale = std::nullopt 
)

Creates a JIT expression operation from an opcode and argument list.

Parameters
treeThe expression tree to which this expression will be added.
operator_idThe JIT operation kind.
argsOperation arguments.
error_policySpecifies how fallible operations handle errors.
target_scaleRequired only for op::RESCALE.
Returns
A reference to the created operation expression.