OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExtensionFunctionsArrayTesting.hpp File Reference
#include "heavydbTypes.h"
+ Include dependency graph for ExtensionFunctionsArrayTesting.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

EXTENSION_NOINLINE int64_t raw_array_as_scalar_same_type (const int64_t *in_arr, const int64_t val)
 
EXTENSION_NOINLINE int32_t raw_array_as_scalar_diff_type (const int64_t *in_arr, const int64_t val)
 
EXTENSION_NOINLINE Array< int64_t > raw_array_as_array_same_type (const int64_t *in_arr, const int64_t val)
 
EXTENSION_NOINLINE Array< int32_t > raw_array_as_array_diff_type (const int64_t *in_arr, const int64_t val)
 

Function Documentation

EXTENSION_NOINLINE Array<int32_t> raw_array_as_array_diff_type ( const int64_t *  in_arr,
const int64_t  val 
)

Definition at line 42 of file ExtensionFunctionsArrayTesting.hpp.

References Array< T >::data().

43  {
44  // return array with val appended as array
45  auto array = Array<int32_t>(val + 1, false);
46  auto* data = array.data();
47  for (int64_t i = 0; i < val; i++) {
48  data[i] = static_cast<int32_t>(in_arr[i]);
49  }
50  data[val] = static_cast<int32_t>(val);
51  return array;
52 }
DEVICE ALWAYS_INLINE T * data() const
Definition: heavydbTypes.h:516

+ Here is the call graph for this function:

EXTENSION_NOINLINE Array<int64_t> raw_array_as_array_same_type ( const int64_t *  in_arr,
const int64_t  val 
)

Definition at line 30 of file ExtensionFunctionsArrayTesting.hpp.

References Array< T >::data().

31  {
32  // return array with val appended as array
33  auto array = Array<int64_t>(val + 1, false);
34  auto* data = array.data();
35  for (int64_t i = 0; i < val; i++) {
36  data[i] = in_arr[i];
37  }
38  data[val] = val;
39  return array;
40 }
DEVICE ALWAYS_INLINE T * data() const
Definition: heavydbTypes.h:516

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t raw_array_as_scalar_diff_type ( const int64_t *  in_arr,
const int64_t  val 
)

Definition at line 19 of file ExtensionFunctionsArrayTesting.hpp.

20  {
21  // return sum of array and val as array
22  int32_t scalar{};
23  for (int64_t i = 0; i < val; i++) {
24  scalar += static_cast<int32_t>(in_arr[i]);
25  }
26  scalar += static_cast<int32_t>(val);
27  return scalar;
28 }
EXTENSION_NOINLINE int64_t raw_array_as_scalar_same_type ( const int64_t *  in_arr,
const int64_t  val 
)

Definition at line 8 of file ExtensionFunctionsArrayTesting.hpp.

9  {
10  // return sum of array and val as array
11  int64_t scalar{};
12  for (int64_t i = 0; i < val; i++) {
13  scalar += in_arr[i];
14  }
15  scalar += val;
16  return scalar;
17 }