A reusable transform program that retains a JIT-compiled kernel. More...
#include <cudf/transform.hpp>
Public Member Functions | |
| transform_program (std::string const &udf, udf_source_type source_type, null_aware is_null_aware, std::optional< void * > user_data, std::span< transform_input const > inputs, std::span< transform_output const > outputs, std::span< std::unique_ptr< column > const > string_offsets) | |
| Constructs a reusable program by deriving specifications from transform arguments. More... | |
| transform_program (std::string const &udf, udf_source_type source_type, null_aware is_null_aware, std::optional< void * > user_data, std::span< transform_input_spec const > inputs, std::span< transform_output_spec const > outputs) | |
| Constructs a reusable program from explicit input and output specifications. More... | |
| transform_program (table_view const &table, std::span< std::reference_wrapper< ast::expression const > const > expressions, cuda::stream_ref stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) | |
| Constructs a reusable program for an AST expression. More... | |
| transform_program (transform_program &&other) | |
| Move constructor for transform_program. More... | |
| transform_program & | operator= (transform_program &&other) |
| Move assignment operator for transform_program. More... | |
| transform_program (transform_program const &)=delete | |
| Deleted copy constructor. | |
| transform_program & | operator= (transform_program const &)=delete |
| Deleted copy assignment. | |
| ~transform_program () | |
| Destructor. | |
| std::unique_ptr< table > | run (std::span< transform_input const > inputs, std::span< transform_output const > outputs, std::vector< std::unique_ptr< column >> &&string_offsets, std::optional< size_type > row_size, cuda::stream_ref stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) |
| Runs the transform program on the given inputs and outputs. More... | |
| std::unique_ptr< table > | run (table_view const &table, cuda::stream_ref stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) |
| Evaluates the AST expressions used to construct this program on a table. More... | |
A reusable transform program that retains a JIT-compiled kernel.
Construction retrieves the kernel for the UDF and the supplied input and output specifications. Subsequent calls to run reuse that kernel. Runtime inputs and outputs must be compatible with the specifications used at construction.
Definition at line 125 of file transform.hpp.
| cudf::transform_program::transform_program | ( | std::string const & | udf, |
| udf_source_type | source_type, | ||
| null_aware | is_null_aware, | ||
| std::optional< void * > | user_data, | ||
| std::span< transform_input const > | inputs, | ||
| std::span< transform_output const > | outputs, | ||
| std::span< std::unique_ptr< column > const > | string_offsets | ||
| ) |
Constructs a reusable program by deriving specifications from transform arguments.
The UDF kernel is retrieved during construction and retained for subsequent calls to run. The input and output objects are inspected only to derive their specifications and are not retained.
| udf | The PTX or CUDA source for the transform UDF |
| source_type | The source type of udf |
| is_null_aware | Whether the UDF receives row inputs as optional values |
| user_data | User-defined device data, not owned by the program, retained and passed to the UDF by run |
| inputs | Inputs from which to derive the input specifications |
| outputs | Outputs from which to derive the output type and nullability specifications |
| string_offsets | Optional string offsets used to determine each string output representation |
| cudf::transform_program::transform_program | ( | std::string const & | udf, |
| udf_source_type | source_type, | ||
| null_aware | is_null_aware, | ||
| std::optional< void * > | user_data, | ||
| std::span< transform_input_spec const > | inputs, | ||
| std::span< transform_output_spec const > | outputs | ||
| ) |
Constructs a reusable program from explicit input and output specifications.
This overload enables composition without requiring concrete columns when the program is created. The UDF kernel is retrieved during construction and retained for subsequent calls to run.
| udf | The PTX or CUDA source for the transform UDF |
| source_type | The source type of udf |
| is_null_aware | Whether the UDF receives row inputs as optional values |
| user_data | User-defined device data, not owned by the program, retained and passed to the UDF by run |
| inputs | Specifications of the transform inputs |
| outputs | Specifications of the transform outputs |
| cudf::transform_program::transform_program | ( | table_view const & | table, |
| std::span< std::reference_wrapper< ast::expression const > const > | expressions, | ||
| cuda::stream_ref | stream = cudf::get_default_stream(), |
||
| rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
| ) |
Constructs a reusable program for an AST expression.
The expression is lowered and its kernel is retrieved during construction. Literal values are retained by the program, while column inputs are rebound to the table passed to run.
| table | A table whose schema is used to lower the expression and retrieve its kernel |
| expressions | The AST expressions to lower and construct the program from |
| stream | CUDA stream used for device memory operations during construction |
| mr | Device memory resource used for device memory allocations during construction |
| cudf::transform_program::transform_program | ( | transform_program && | other | ) |
Move constructor for transform_program.
| other | The transform_program to move from |
| transform_program& cudf::transform_program::operator= | ( | transform_program && | other | ) |
Move assignment operator for transform_program.
| other | The transform_program to move from |
| std::unique_ptr<table> cudf::transform_program::run | ( | std::span< transform_input const > | inputs, |
| std::span< transform_output const > | outputs, | ||
| std::vector< std::unique_ptr< column >> && | string_offsets, | ||
| std::optional< size_type > | row_size, | ||
| cuda::stream_ref | stream = cudf::get_default_stream(), |
||
| rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
| ) |
Runs the transform program on the given inputs and outputs.
| std::invalid_argument | if the inputs, outputs, or string offsets are not compatible with the specifications used to construct the program |
| inputs | The inputs to the transform program |
| outputs | The outputs of the transform program |
| string_offsets | For string output columns, the offsets can be pre-allocated and passed in to prevent overhead of compacting string views into run-end strings column. |
| row_size | The row size of the transform operation. If not provided, it will be inferred from the inputs. |
| stream | CUDA stream used for device memory operations and kernel launches |
| mr | Device memory resource used to allocate the returned column's device memory |
| std::unique_ptr<table> cudf::transform_program::run | ( | table_view const & | table, |
| cuda::stream_ref | stream = cudf::get_default_stream(), |
||
| rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
| ) |
Evaluates the AST expressions used to construct this program on a table.
| std::invalid_argument | if the table is not compatible with the specifications used to construct the program |
| table | The table used for expression evaluation |
| stream | CUDA stream used for device memory operations and kernel launches |
| mr | Device memory resource used to allocate the returned column device memory |