OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TableFunctions.hpp File Reference
+ Include dependency graph for TableFunctions.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EXTENSION_INLINE   extern "C" ALWAYS_INLINE DEVICE
 
#define EXTENSION_NOINLINE   extern "C" NEVER_INLINE DEVICE
 

Functions

EXTENSION_NOINLINE int32_t row_copier (Column< double > input_col, int copy_multiplier, Column< double > output_col)
 

Macro Definition Documentation

#define EXTENSION_INLINE   extern "C" ALWAYS_INLINE DEVICE

Definition at line 20 of file TableFunctions.hpp.

#define EXTENSION_NOINLINE   extern "C" NEVER_INLINE DEVICE

Definition at line 21 of file TableFunctions.hpp.

Function Documentation

EXTENSION_NOINLINE int32_t row_copier ( Column< double >  input_col,
int  copy_multiplier,
Column< double >  output_col 
)

Definition at line 23 of file TableFunctions.hpp.

References Column< T >::ptr, and Column< T >::sz.

25  {
26  int32_t output_row_count = copy_multiplier * input_col.sz;
27  if (output_row_count > 100) {
28  // Test failure propagation.
29  return -1;
30  }
31  // Set the output columne size for consistency. The output column
32  // size will be effective only here, it will not propagate back to
33  // the caller because the output_col is passed in by value.
34  output_col.sz = output_row_count;
35 
36 #ifdef __CUDACC__
37  int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
38  int32_t stop = static_cast<int32_t>(input_col.sz);
39  int32_t step = blockDim.x * gridDim.x;
40 #else
41  auto start = 0;
42  auto stop = input_col.sz;
43  auto step = 1;
44 #endif
45 
46  for (auto i = start; i < stop; i += step) {
47  for (int c = 0; c < copy_multiplier; c++) {
48  output_col.ptr[i + (c * input_col.sz)] = input_col.ptr[i];
49  }
50  }
51 
52  return output_row_count;
53 }
int64_t sz
Definition: OmniSciTypes.h:149