OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExampleTableFunctions.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
20 
21 #ifndef __CUDACC__
22 
23 // clang-format off
24 /*
25  UDTF: tf_mandelbrot__cpu_(TableFunctionManager, int32_t x_pixels | require="x_pixels > 0",
26  int32_t y_pixels | require="y_pixels > 0" | require="x_pixels * y_pixels <= 67108864",
27  double x_min, double x_max | require="x_max > x_min", double y_min, double y_max | require="y_max > y_min",
28  int32_t max_iterations | require="max_iterations > 0 && max_iterations <= 16384") ->
29  Column<double> x, Column<double> y, Column<int32_t> num_iterations
30 */
31 // clang-format on
32 
35  const int32_t x_pixels,
36  const int32_t y_pixels,
37  const double x_min,
38  const double x_max,
39  const double y_min,
40  const double y_max,
41  const int32_t max_iterations,
42  Column<double>& output_x,
43  Column<double>& output_y,
44  Column<int32_t>& output_num_iterations);
45 
46 // clang-format off
47 /*
48  UDTF: tf_mandelbrot_float__cpu_(TableFunctionManager, int32_t x_pixels | require="x_pixels > 0",
49  int32_t y_pixels | require="y_pixels > 0" | require="x_pixels * y_pixels <= 67108864",
50  float x_min, float x_max | require="x_max > x_min", float y_min, float y_max | require="y_max > y_min",
51  int32_t max_iterations | require="max_iterations > 0 && max_iterations <= 16384") ->
52  Column<float> x, Column<float> y, Column<int32_t> num_iterations
53 */
54 // clang-format on
55 
58  const int32_t x_pixels,
59  const int32_t y_pixels,
60  const float x_min,
61  const float x_max,
62  const float y_min,
63  const float y_max,
64  const int32_t max_iterations,
65  Column<float>& output_x,
66  Column<float>& output_y,
67  Column<int32_t>& output_num_iterations);
68 
69 #else // #ifndef __CUDACC__
70 
71 // clang-format off
72 /*
73  UDTF: tf_mandelbrot_cuda__gpu_(int32_t x_pixels | require="x_pixels > 0",
74  int32_t y_pixels | require="y_pixels > 0" | require="x_pixels * y_pixels <= 67108864",
75  double x_min, double x_max | require="x_max > x_min", double y_min, double y_max | require="y_max > y_min",
76  int32_t max_iterations | require="max_iterations > 0 && max_iterations <= 16384") ->
77  Column<double> x, Column<double> y, Column<int32_t> num_iterations | output_row_size="x_pixels * y_pixels"
78 */
79 // clang-format on
80 
82 int32_t tf_mandelbrot_cuda__gpu_(const int32_t x_pixels,
83  const int32_t y_pixels,
84  const double x_min,
85  const double x_max,
86  const double y_min,
87  const double y_max,
88  const int32_t max_iterations,
89  Column<double>& output_x,
90  Column<double>& output_y,
91  Column<int32_t>& output_num_iterations);
92 
93 // clang-format off
94 /*
95  UDTF: tf_mandelbrot_cuda_float__gpu_(int32_t x_pixels | require="x_pixels > 0",
96  int32_t y_pixels | require="y_pixels > 0" | require="x_pixels * y_pixels <= 67108864",
97  float x_min, float x_max | require="x_max > x_min", float y_min, float y_max | require="y_max > y_min",
98  int32_t max_iterations | require="max_iterations > 0 && max_iterations <= 16384") ->
99  Column<float> x, Column<float> y, Column<int32_t> num_iterations | output_row_size="x_pixels * y_pixels"
100 */
101 // clang-format on
102 
104 int32_t tf_mandelbrot_cuda_float__gpu_(const int32_t x_pixels,
105  const int32_t y_pixels,
106  const float x_min,
107  const float x_max,
108  const float y_min,
109  const float y_max,
110  const int32_t max_iterations,
111  Column<float>& output_x,
112  Column<float>& output_y,
113  Column<int32_t>& output_num_iterations);
114 
115 #endif // __CUDACC__
#define EXTENSION_NOINLINE
Definition: heavydbTypes.h:58
EXTENSION_NOINLINE int32_t tf_mandelbrot__cpu_(TableFunctionManager &mgr, const int32_t x_pixels, const int32_t y_pixels, const double x_min, const double x_max, const double y_min, const double y_max, const int32_t max_iterations, Column< double > &output_x, Column< double > &output_y, Column< int32_t > &output_num_iterations)
EXTENSION_NOINLINE int32_t tf_mandelbrot_float__cpu_(TableFunctionManager &mgr, const int32_t x_pixels, const int32_t y_pixels, const float x_min, const float x_max, const float y_min, const float y_max, const int32_t max_iterations, Column< float > &output_x, Column< float > &output_y, Column< int32_t > &output_num_iterations)