OmniSciDB  04ee39c94c
udf_sample.cpp File Reference
#include <cstdint>
+ Include dependency graph for udf_sample.cpp:

Go to the source code of this file.

Macros

#define DEVICE
 
#define NEVER_INLINE   __attribute__((noinline))
 
#define ALWAYS_INLINE   __attribute__((always_inline))
 
#define EXTENSION_NOINLINE   extern "C" NEVER_INLINE DEVICE
 
#define EXTENSION_INLINE   extern "C" ALWAYS_INLINE DEVICE
 

Functions

EXTENSION_NOINLINE double udf_range (const double high_price, const double low_price)
 
EXTENSION_NOINLINE int64_t udf_range_int (const int64_t high_price, const int64_t low_price)
 
EXTENSION_NOINLINE double udf_truehigh (const double high_price, const double prev_close_price)
 
EXTENSION_NOINLINE double udf_truelow (const double low_price, const double prev_close_price)
 
EXTENSION_NOINLINE double udf_truerange (const double high_price, const double low_price, const double prev_close_price)
 

Macro Definition Documentation

◆ ALWAYS_INLINE

#define ALWAYS_INLINE   __attribute__((always_inline))

Definition at line 17 of file udf_sample.cpp.

◆ DEVICE

#define DEVICE

Definition at line 5 of file udf_sample.cpp.

◆ EXTENSION_INLINE

#define EXTENSION_INLINE   extern "C" ALWAYS_INLINE DEVICE

Definition at line 22 of file udf_sample.cpp.

◆ EXTENSION_NOINLINE

#define EXTENSION_NOINLINE   extern "C" NEVER_INLINE DEVICE

Definition at line 20 of file udf_sample.cpp.

Referenced by udf_range(), udf_range_int(), udf_truehigh(), and udf_truelow().

◆ NEVER_INLINE

#define NEVER_INLINE   __attribute__((noinline))

Definition at line 11 of file udf_sample.cpp.

Function Documentation

◆ udf_range()

EXTENSION_NOINLINE double udf_range ( const double  high_price,
const double  low_price 
)

Definition at line 25 of file udf_sample.cpp.

References EXTENSION_NOINLINE.

25  {
26  return high_price - low_price;
27 }

◆ udf_range_int()

EXTENSION_NOINLINE int64_t udf_range_int ( const int64_t  high_price,
const int64_t  low_price 
)

Definition at line 30 of file udf_sample.cpp.

References EXTENSION_NOINLINE.

30  {
31  return high_price - low_price;
32 }

◆ udf_truehigh()

EXTENSION_NOINLINE double udf_truehigh ( const double  high_price,
const double  prev_close_price 
)

Definition at line 35 of file udf_sample.cpp.

References EXTENSION_NOINLINE.

Referenced by udf_truerange().

35  {
36  return (high_price < prev_close_price) ? prev_close_price : high_price;
37 }
+ Here is the caller graph for this function:

◆ udf_truelow()

EXTENSION_NOINLINE double udf_truelow ( const double  low_price,
const double  prev_close_price 
)

Definition at line 40 of file udf_sample.cpp.

References EXTENSION_NOINLINE.

Referenced by udf_truerange().

40  {
41  return !(prev_close_price < low_price) ? low_price : prev_close_price;
42 }
+ Here is the caller graph for this function:

◆ udf_truerange()

EXTENSION_NOINLINE double udf_truerange ( const double  high_price,
const double  low_price,
const double  prev_close_price 
)

Definition at line 45 of file udf_sample.cpp.

References udf_truehigh(), and udf_truelow().

47  {
48  return (udf_truehigh(high_price, prev_close_price) -
49  udf_truelow(low_price, prev_close_price));
50 }
EXTENSION_NOINLINE double udf_truelow(const double low_price, const double prev_close_price)
Definition: udf_sample.cpp:40
EXTENSION_NOINLINE double udf_truehigh(const double high_price, const double prev_close_price)
Definition: udf_sample.cpp:35
+ Here is the call graph for this function: