diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a3c697ae0ab..3dbb6a6b4b79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ ## Improvements - PR #730 Improve performance of `gdf_table` constructor +- PR #561 Add Doxygen style comments to Join CUDA functions - PR #813 unified libcudf API functions by replacing gpu_ with gdf_ - PR #822 Add support for `__cuda_array_interface__` for ingest - PR #756 Consolidate common helper functions from unordered map and multimap diff --git a/cpp/include/cudf/functions.h b/cpp/include/cudf/functions.h index 0fb68030681c..4959ac1d2100 100644 --- a/cpp/include/cudf/functions.h +++ b/cpp/include/cudf/functions.h @@ -1,6 +1,5 @@ #pragma once -/* --------------------------------------------------------------------------*/ /** * @brief Start a NVTX range with predefined color. * @@ -9,18 +8,13 @@ * color that will show up in the timeline view of nvvp/Nsight Systems. Can be * nested within other ranges. * - * @param name The name of the NVTX range - * @param color The predefined gdf_color enum to use to color this range + * @param[in] name The name of the NVTX range + * @param[in] color The predefined gdf_color enum to use to color this range * * @returns */ -/* ----------------------------------------------------------------------------*/ gdf_error gdf_nvtx_range_push(char const * const name, gdf_color color ); - - - -/* --------------------------------------------------------------------------*/ /** * @brief Start a NVTX range with a custom ARGB color code. * @@ -29,16 +23,13 @@ gdf_error gdf_nvtx_range_push(char const * const name, gdf_color color ); * color that will show up in the timeline view of nvvp/Nsight Systems. Can be * nested within other ranges. * - * @param name The name of the NVTX range - * @param color The ARGB hex color code to use to color this range (e.g., 0xFF00FF00) + * @param[in] name The name of the NVTX range + * @param[in] color The ARGB hex color code to use to color this range (e.g., 0xFF00FF00) * * @returns */ -/* ----------------------------------------------------------------------------*/ gdf_error gdf_nvtx_range_push_hex(char const * const name, unsigned int color ); - -/* --------------------------------------------------------------------------*/ /** * @brief Ends the inner-most NVTX range. * @@ -48,10 +39,8 @@ gdf_error gdf_nvtx_range_push_hex(char const * const name, unsigned int color ); * * @returns */ -/* ----------------------------------------------------------------------------*/ gdf_error gdf_nvtx_range_pop(); -/* --------------------------------------------------------------------------*/ /** * @brief Counts the number of valid bits in the mask that corresponds to * the specified number of rows. @@ -63,137 +52,495 @@ gdf_error gdf_nvtx_range_pop(); * * @returns GDF_SUCCESS upon successful completion. */ -/* ----------------------------------------------------------------------------*/ gdf_error gdf_count_nonzero_mask(gdf_valid_type const *masks, gdf_size_type num_rows, gdf_size_type *count); + /* column operations */ +/** + * @brief Return the size of the gdf_column data type. + * + * @returns gdf_size_type Size of the gdf_column data type. + */ gdf_size_type gdf_column_sizeof(); +/** + * @brief Create a GDF column given data and validity bitmask pointers, size, and + * datatype + * + * @param[out] column The output column. + * @param[in] data Pointer to data. + * @param[in] valid Pointer to validity bitmask for the data. + * @param[in] size Number of rows in the column. + * @param[in] dtype Data type of the column. + * + * @returns gdf_error returns GDF_SUCCESS upon successful creation. + */ gdf_error gdf_column_view(gdf_column *column, void *data, gdf_valid_type *valid, gdf_size_type size, gdf_dtype dtype); +/** + * @brief Create a GDF column given data and validity bitmask pointers, size, and + * datatype, and count of null (non-valid) elements + * + * @param[out] column The output column. + * @param[in] data Pointer to data. + * @param[in] valid Pointer to validity bitmask for the data. + * @param[in] size Number of rows in the column. + * @param[in] dtype Data type of the column. + * @param[in] null_count The number of non-valid elements in the validity bitmask + * + * @returns gdf_error returns GDF_SUCCESS upon successful creation. + */ gdf_error gdf_column_view_augmented(gdf_column *column, void *data, gdf_valid_type *valid, gdf_size_type size, gdf_dtype dtype, gdf_size_type null_count, gdf_dtype_extra_info extra_info); +/** + * @brief Free the CUDA device memory of a gdf_column + * + * @param[in,out] column Data and validity bitmask pointers of this column will be freed + * + * @returns gdf_error GDF_SUCCESS or GDF_ERROR if there is an error freeing the data + */ gdf_error gdf_column_free(gdf_column *column); -/* --------------------------------------------------------------------------*/ /** * @brief Concatenates the gdf_columns into a single, contiguous column, * including the validity bitmasks * * @param[out] output A column whose buffers are already allocated that will + * contain the concatenation of the input columns * @param[in] columns_to_conat[] The columns to concatenate * @param[in] num_columns The number of columns to concatenate - * contain the concatenation of the input columns * * @returns GDF_SUCCESS upon successful completion */ -/* ----------------------------------------------------------------------------*/ gdf_error gdf_column_concat(gdf_column *output, gdf_column *columns_to_concat[], int num_columns); + /* context operations */ +/** + * @brief Constructor for the gdf_context struct + * + * @param[out] gdf_context being constructed + * @param[in] Indicates if the input data is sorted. 0 = No, 1 = yes + * @param[in] the method to be used for the operation (e.g., sort vs hash) + * @param[in] for COUNT: DISTINCT = 1, else = 0 + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_context_view(gdf_context *context, int flag_sorted, gdf_method flag_method, int flag_distinct, int flag_sort_result, int flag_sort_inplace); + /* error handling */ +/** + * @brief Converts a gdf_error error code into a string + * + * @param[in] gdf_error + * + * @returns name of the error + */ const char * gdf_error_get_name(gdf_error errcode); +/** + * @brief returns the last error from a runtime call. + * + * @returns last error from a runtime call. + */ int gdf_cuda_last_error(); + +/** + * @brief returns the description string for an error code. + * + * @param[in] cuda error code + * + * @returns description string for an error code. + */ const char * gdf_cuda_error_string(int cuda_error); + +/** + * @brief returns the string representation of an error code enum name. + * + * @param[in] cuda error code + * + * @returns string representation of an error code enum name. + */ const char * gdf_cuda_error_name(int cuda_error); + /* ipc */ +/** + * @brief Opens a parser from a pyarrow RecordBatch schema + * + * @param[in] Pointer to a byte array containing the pyarrow RecordBatch schema + * @param[in] Size of the byte array + * + * @returns Pointer to a parsing struct gdf_ipc_parser_type + */ gdf_ipc_parser_type* gdf_ipc_parser_open(const uint8_t *schema, size_t length); + +/** + * @brief Opens a pyarrow RecordBatch bytearray + * + * @param[in] Pointer to a parsing struct gdf_ipc_parser_type + * @param[in] Pointer to a pyarrow RecordBatch bytearray + * @param[in] Size of the byte array + * + * @returns + */ void gdf_ipc_parser_open_recordbatches(gdf_ipc_parser_type *handle, const uint8_t *recordbatches, size_t length); +/** + * @brief Closes a parser from a pyarrow RecordBatch schema + * + * @param[in] Pointer to a parsing struct gdf_ipc_parser_type + * + * @returns void + */ void gdf_ipc_parser_close(gdf_ipc_parser_type *handle); + +/** + * @brief Checks for a failure in the parser + * + * @param[in] Pointer to a parsing struct gdf_ipc_parser_type + * + * @returns 1 if error + */ int gdf_ipc_parser_failed(gdf_ipc_parser_type *handle); + +/** + * @brief returns parsed data as json + * + * @param[in] Pointer to a parsing struct gdf_ipc_parser_type + * + * @returns char* of parsed data as json + */ const char* gdf_ipc_parser_to_json(gdf_ipc_parser_type *handle); + +/** + * @brief Gets error from gdf_ipc_parser_type + * + * @param[in] Pointer to a parsing struct gdf_ipc_parser_type + * + * @returns Error message as char* + */ const char* gdf_ipc_parser_get_error(gdf_ipc_parser_type *handle); + +/** + * @brief Gets parsed data from gdf_ipc_parser_type + * + * @param[in] Pointer to a parsing struct gdf_ipc_parser_type + * + * @returns Pointer parsed data + */ const void* gdf_ipc_parser_get_data(gdf_ipc_parser_type *handle); + +/** + * @brief Gets data offset from gdf_ipc_parser_type + * + * @param[in] Pointer to a parsing struct gdf_ipc_parser_type + * + * @returns Data offset + */ int64_t gdf_ipc_parser_get_data_offset(gdf_ipc_parser_type *handle); -const char *gdf_ipc_parser_get_schema_json(gdf_ipc_parser_type *handle) ; -const char *gdf_ipc_parser_get_layout_json(gdf_ipc_parser_type *handle) ; +/** + * @brief returns parsed schema as json + * + * @param[in] Pointer to a parsing struct gdf_ipc_parser_type + * + * @returns char* of parsed schema as json + */ +const char *gdf_ipc_parser_get_schema_json(gdf_ipc_parser_type *handle); + +/** + * @brief returns layout as json + * + * @param[in] Pointer to a parsing struct gdf_ipc_parser_type + * + * @returns char* of layout as json + */ +const char *gdf_ipc_parser_get_layout_json(gdf_ipc_parser_type *handle); /* sorting */ + +/** + * @brief Constructor for the gdf_radixsort_plan_type object + * + * @param[in] Number of items to sort + * @param[in] Indicates if sort should be ascending or descending. 1 = Descending, 0 = Ascending + * @param[in] The least-significant bit index (inclusive) needed for key comparison + * @param[in] The most-significant bit index (exclusive) needed for key comparison (e.g., sizeof(unsigned int) * 8) + * + * @returns gdf_radixsort_plan_type object pointer + */ gdf_radixsort_plan_type* gdf_radixsort_plan(size_t num_items, int descending, unsigned begin_bit, unsigned end_bit); + +/** + * @brief Allocates device memory for the radixsort + * + * @param[in] Radix sort plan + * @param[in] sizeof data type of key + * @param[in] sizeof data type of val + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_radixsort_plan_setup(gdf_radixsort_plan_type *hdl, size_t sizeof_key, size_t sizeof_val); + +/** + * @brief Frees device memory used for the radixsort + * + * @param[in] Radix sort plan + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_radixsort_plan_free(gdf_radixsort_plan_type *hdl); + /* * The following function performs a sort on the key and value columns. * The null_count of the keycol and valcol columns are expected to be 0 * otherwise a GDF_VALIDITY_UNSUPPORTED error is returned. */ + +/** + * @brief Performs a radixsort on the key and value columns where the key is an int8 + * + * @param[in] Radix sort plan + * @param[in] key gdf_column + * @param[in] value gdf_column + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_radixsort_i8(gdf_radixsort_plan_type *hdl, gdf_column *keycol, gdf_column *valcol); + +/** + * @brief Performs a radixsort on the key and value columns where the key is an int32 + * + * @param[in] Radix sort plan + * @param[in] key gdf_column + * @param[in] value gdf_column + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_radixsort_i32(gdf_radixsort_plan_type *hdl, gdf_column *keycol, gdf_column *valcol); + +/** + * @brief performs a radixsort on the key and value columns where the key is an int64 + * + * @param[in] Radix sort plan + * @param[in] key gdf_column + * @param[in] value gdf_column + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_radixsort_i64(gdf_radixsort_plan_type *hdl, gdf_column *keycol, gdf_column *valcol); + +/** + * @brief performs a radixsort on the key and value columns where the key is an float + * + * @param[in] Radix sort plan + * @param[in] key gdf_column + * @param[in] value gdf_column + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_radixsort_f32(gdf_radixsort_plan_type *hdl, gdf_column *keycol, gdf_column *valcol); + +/** + * @brief performs a radixsort on the key and value columns where the key is an double + * + * @param[in] Radix sort plan + * @param[in] key gdf_column + * @param[in] value gdf_column + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_radixsort_f64(gdf_radixsort_plan_type *hdl, gdf_column *keycol, gdf_column *valcol); + +/** + * @brief performs a radixsort on the key and value columns where the key is any type + * + * @param[in] Radix sort plan + * @param[in] key gdf_column + * @param[in] value gdf_column + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_radixsort_generic(gdf_radixsort_plan_type *hdl, gdf_column *keycol, gdf_column *valcol); + /* segmented sorting */ -gdf_segmented_radixsort_plan_type* gdf_segmented_radixsort_plan(size_t num_items, int descending, - unsigned begin_bit, unsigned end_bit); + +/** + * @brief Constructor for the gdf_segmented_radixsort_plan_type object + * + * @param[in] Number of items to sort + * @param[in] Indicates if sort should be ascending or descending. 1 = Descending, 0 = Ascending + * @param[in] The least-significant bit index (inclusive) needed for key comparison + * @param[in] The most-significant bit index (exclusive) needed for key comparison (e.g., sizeof(unsigned int) * 8) + * + * @returns gdf_segmented_radixsort_plan_type object pointer + */ +gdf_segmented_radixsort_plan_type* gdf_segmented_radixsort_plan(size_t num_items, + int descending, + unsigned begin_bit, + unsigned end_bit); + +/** + * @brief Allocates device memory for the segmented radixsort + * + * @param[in] Segmented Radix sort plan + * @param[in] sizeof data type of key + * @param[in] sizeof data type of val + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_segmented_radixsort_plan_setup(gdf_segmented_radixsort_plan_type *hdl, -size_t sizeof_key, size_t sizeof_val); + size_t sizeof_key, + size_t sizeof_val); + +/** + * @brief Frees device memory used for the segmented radixsort + * + * @param[in] Segmented Radix sort plan + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_segmented_radixsort_plan_free(gdf_segmented_radixsort_plan_type *hdl); + /* -* The following function performs a sort on the key and value columns. -* The null_count of the keycol and valcol columns are expected to be 0 -* otherwise a GDF_VALIDITY_UNSUPPORTED error is returned. -*/ + * The following function performs a sort on the key and value columns. + * The null_count of the keycol and valcol columns are expected to be 0 + * otherwise a GDF_VALIDITY_UNSUPPORTED error is returned. + */ + +/** + * @brief performs a segmented radixsort on the key and value columns where the key is an int8 + * + * @param[in] Radix sort plan + * @param[in] key gdf_column + * @param[in] value gdf_column + * @param[in] The number of segments that comprise the sorting data + * @param[in] Pointer to the sequence of beginning offsets of length num_segments, such that d_begin_offsets[i] is the first element of the ith data segment in d_keys_* and d_values_* + * @param[in] Pointer to the sequence of ending offsets of length num_segments, such that d_end_offsets[i]-1 is the last element of the ith data segment in d_keys_* and d_values_*. If d_end_offsets[i]-1 <= d_begin_offsets[i], the ith is considered empty. + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_segmented_radixsort_i8(gdf_segmented_radixsort_plan_type *hdl, gdf_column *keycol, gdf_column *valcol, unsigned num_segments, unsigned *d_begin_offsets, unsigned *d_end_offsets); + +/** + * @brief performs a segmented radixsort on the key and value columns where the key is an int32 + * + * @param[in] Radix sort plan + * @param[in] key gdf_column + * @param[in] value gdf_column + * @param[in] The number of segments that comprise the sorting data + * @param[in] Pointer to the sequence of beginning offsets of length num_segments, such that d_begin_offsets[i] is the first element of the ith data segment in d_keys_* and d_values_* + * @param[in] Pointer to the sequence of ending offsets of length num_segments, such that d_end_offsets[i]-1 is the last element of the ith data segment in d_keys_* and d_values_*. If d_end_offsets[i]-1 <= d_begin_offsets[i], the ith is considered empty. + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_segmented_radixsort_i32(gdf_segmented_radixsort_plan_type *hdl, gdf_column *keycol, gdf_column *valcol, unsigned num_segments, unsigned *d_begin_offsets, unsigned *d_end_offsets); + +/** + * @brief performs a segmented radixsort on the key and value columns where the key is an int64 + * + * @param[in] Radix sort plan + * @param[in] key gdf_column + * @param[in] value gdf_column + * @param[in] The number of segments that comprise the sorting data + * @param[in] Pointer to the sequence of beginning offsets of length num_segments, such that d_begin_offsets[i] is the first element of the ith data segment in d_keys_* and d_values_* + * @param[in] Pointer to the sequence of ending offsets of length num_segments, such that d_end_offsets[i]-1 is the last element of the ith data segment in d_keys_* and d_values_*. If d_end_offsets[i]-1 <= d_begin_offsets[i], the ith is considered empty. + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_segmented_radixsort_i64(gdf_segmented_radixsort_plan_type *hdl, gdf_column *keycol, gdf_column *valcol, unsigned num_segments, unsigned *d_begin_offsets, unsigned *d_end_offsets); + +/** + * @brief performs a segmented radixsort on the key and value columns where the key is an float + * + * @param[in] Radix sort plan + * @param[in] key gdf_column + * @param[in] value gdf_column + * @param[in] The number of segments that comprise the sorting data + * @param[in] Pointer to the sequence of beginning offsets of length num_segments, such that d_begin_offsets[i] is the first element of the ith data segment in d_keys_* and d_values_* + * @param[in] Pointer to the sequence of ending offsets of length num_segments, such that d_end_offsets[i]-1 is the last element of the ith data segment in d_keys_* and d_values_*. If d_end_offsets[i]-1 <= d_begin_offsets[i], the ith is considered empty. + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_segmented_radixsort_f32(gdf_segmented_radixsort_plan_type *hdl, gdf_column *keycol, gdf_column *valcol, unsigned num_segments, unsigned *d_begin_offsets, unsigned *d_end_offsets); + +/** + * @brief performs a segmented radixsort on the key and value columns where the key is an double + * + * @param[in] Radix sort plan + * @param[in] key gdf_column + * @param[in] value gdf_column + * @param[in] The number of segments that comprise the sorting data + * @param[in] Pointer to the sequence of beginning offsets of length num_segments, such that d_begin_offsets[i] is the first element of the ith data segment in d_keys_* and d_values_* + * @param[in] Pointer to the sequence of ending offsets of length num_segments, such that d_end_offsets[i]-1 is the last element of the ith data segment in d_keys_* and d_values_*. If d_end_offsets[i]-1 <= d_begin_offsets[i], the ith is considered empty. + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_segmented_radixsort_f64(gdf_segmented_radixsort_plan_type *hdl, gdf_column *keycol, gdf_column *valcol, unsigned num_segments, unsigned *d_begin_offsets, unsigned *d_end_offsets); + +/** + * @brief performs a segmented radixsort on the key and value columns where the key is any type + * + * @param[in] Radix sort plan + * @param[in] key gdf_column + * @param[in] value gdf_column + * @param[in] The number of segments that comprise the sorting data + * @param[in] Pointer to the sequence of beginning offsets of length num_segments, such that d_begin_offsets[i] is the first element of the ith data segment in d_keys_* and d_values_* + * @param[in] Pointer to the sequence of ending offsets of length num_segments, such that d_end_offsets[i]-1 is the last element of the ith data segment in d_keys_* and d_values_*. If d_end_offsets[i]-1 <= d_begin_offsets[i], the ith is considered empty. + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_segmented_radixsort_generic(gdf_segmented_radixsort_plan_type *hdl, gdf_column *keycol, gdf_column *valcol, unsigned num_segments, @@ -208,7 +555,7 @@ gdf_error gdf_segmented_radixsort_generic(gdf_segmented_radixsort_plan_type *hdl * @param[in] ncols Number of columns in in_cols * @param[in] in_cols[] Input table of (ncols) number of columns each of size (nrows) * @param[out] out_cols[] Preallocated output_table of (nrows) columns each of size (ncols) - * @return gdf_error GDF_SUCCESS if successful, else appropriate error code + * @returns gdf_error GDF_SUCCESS if successful, else appropriate error code */ gdf_error gdf_transpose(gdf_size_type ncols, gdf_column** in_cols, @@ -216,8 +563,6 @@ gdf_error gdf_transpose(gdf_size_type ncols, // joins - -/* --------------------------------------------------------------------------*/ /** * @brief Performs an inner join on the specified columns of two * dataframes (left, right) @@ -245,7 +590,6 @@ gdf_error gdf_transpose(gdf_size_type ncols, * @returns GDF_SUCCESS if the join operation was successful, otherwise an appropriate * error code */ -/* ----------------------------------------------------------------------------*/ gdf_error gdf_inner_join( gdf_column **left_cols, int num_left_cols, @@ -260,7 +604,6 @@ gdf_error gdf_inner_join( gdf_column * right_indices, gdf_context *join_context); -/* --------------------------------------------------------------------------*/ /** * @brief Performs a left join (also known as left outer join) on the * specified columns of two dataframes (left, right) @@ -288,7 +631,6 @@ gdf_error gdf_inner_join( * @returns GDF_SUCCESS if the join operation was successful, otherwise an appropriate * error code */ -/* ----------------------------------------------------------------------------*/ gdf_error gdf_left_join( gdf_column **left_cols, int num_left_cols, @@ -303,7 +645,6 @@ gdf_error gdf_left_join( gdf_column * right_indices, gdf_context *join_context); -/* --------------------------------------------------------------------------*/ /** * @brief Performs a full join (also known as full outer join) on the * specified columns of two dataframes (left, right) @@ -331,7 +672,6 @@ gdf_error gdf_left_join( * @returns GDF_SUCCESS if the join operation was successful, otherwise an appropriate * error code */ -/* ----------------------------------------------------------------------------*/ gdf_error gdf_full_join( gdf_column **left_cols, int num_left_cols, @@ -348,7 +688,6 @@ gdf_error gdf_full_join( /* partioning */ -/* --------------------------------------------------------------------------*/ /** * @brief Computes the hash values of the rows in the specified columns of the * input columns and bins the hash values into the desired number of partitions. @@ -369,7 +708,6 @@ gdf_error gdf_full_join( * * @returns If the operation was successful, returns GDF_SUCCESS */ -/* ----------------------------------------------------------------------------*/ gdf_error gdf_hash_partition(int num_input_cols, gdf_column * input[], int columns_to_hash[], @@ -411,7 +749,7 @@ gdf_error gdf_prefixsum(const gdf_column *input, gdf_column *output, bool inclus * then each element will be hashed as-is. * @param[out] output The hash value of each row of the input * - * @return GDF_SUCCESS if the operation was successful, otherwise an + * @returns GDF_SUCCESS if the operation was successful, otherwise an * appropriate error code. * ----------------------------------------------------------------------------**/ gdf_error gdf_hash(int num_cols, @@ -422,145 +760,1201 @@ gdf_error gdf_hash(int num_cols, /* trig */ +/** + * @brief Computes trigonometric sine function for any floating point data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_sin_generic(gdf_column *input, gdf_column *output); + +/** + * @brief Computes trigonometric sine function for float data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_sin_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Computes trigonometric sine function for double data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_sin_f64(gdf_column *input, gdf_column *output); +/** + * @brief Computes trigonometric cosine function for any floating point data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cos_generic(gdf_column *input, gdf_column *output); + +/** + * @brief Computes trigonometric cosine function for float data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cos_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Computes trigonometric cosine function for double data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cos_f64(gdf_column *input, gdf_column *output); +/** + * @brief Computes trigonometric tangent function for any floating point data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_tan_generic(gdf_column *input, gdf_column *output); + +/** + * @brief Computes trigonometric tangent function for float data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_tan_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Computes trigonometric tangent function for double data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_tan_f64(gdf_column *input, gdf_column *output); +/** + * @brief Computes trigonometric arcsin function for any floating point data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_asin_generic(gdf_column *input, gdf_column *output); + +/** + * @brief Computes trigonometric arcsin function for float data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_asin_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Computes trigonometric arcsin function for double data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_asin_f64(gdf_column *input, gdf_column *output); +/** + * @brief Computes trigonometric arccos function for any floating point data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_acos_generic(gdf_column *input, gdf_column *output); + +/** + * @brief Computes trigonometric arccos function for float data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_acos_f32(gdf_column *input, gdf_column *output); -gdf_error gdf_acos_f64(gdf_column *input, gdf_column *output); -gdf_error gdf_atan_generic(gdf_column *input, gdf_column *output); -gdf_error gdf_atan_f32(gdf_column *input, gdf_column *output); +/** + * @brief Computes trigonometric arccos function for double data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ +gdf_error gdf_acos_f64(gdf_column *input, gdf_column *output); + +/** + * @brief Computes trigonometric arctan function for any floating point data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ +gdf_error gdf_atan_generic(gdf_column *input, gdf_column *output); + +/** + * @brief Computes trigonometric arctan function for a float data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ +gdf_error gdf_atan_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Computes trigonometric arctan function for a double data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_atan_f64(gdf_column *input, gdf_column *output); + /* exponential */ +/** + * @brief Computes e (Euler's number, 2.7182818...) raised to the given power arg for any floating point data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_exp_generic(gdf_column *input, gdf_column *output); + +/** + * @brief Computes e (Euler's number, 2.7182818...) raised to the given power arg float data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_exp_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Computes e (Euler's number, 2.7182818...) raised to the given power arg for double data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_exp_f64(gdf_column *input, gdf_column *output); +/** + * @brief Computes the natural (base e) logarithm of arg for any floating point data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_log_generic(gdf_column *input, gdf_column *output); + +/** + * @brief Computes the natural (base e) logarithm of arg for float data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_log_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Computes the natural (base e) logarithm of arg for double data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_log_f64(gdf_column *input, gdf_column *output); + /* power */ +/** + * @brief Computes the square root for any floating point data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_sqrt_generic(gdf_column *input, gdf_column *output); + +/** + * @brief Computes the square root for float data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_sqrt_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Computes the square root for double data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_sqrt_f64(gdf_column *input, gdf_column *output); /* rounding */ +/** + * @brief Computes the smallest integer value not less than arg for any floating point data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_ceil_generic(gdf_column *input, gdf_column *output); + +/** + * @brief Computes the smallest integer value not less than arg for float data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_ceil_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Computes the smallest integer value not less than arg for double data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_ceil_f64(gdf_column *input, gdf_column *output); +/** + * @brief Computes the largest integer value not greater than arg for any floating point data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_floor_generic(gdf_column *input, gdf_column *output); + +/** + * @brief Computes the largest integer value not greater than arg for float data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_floor_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Computes the largest integer value not greater than arg for double data type + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_floor_f64(gdf_column *input, gdf_column *output); + /* casting */ +/** + * @brief Casts data in a gdf_column of any data type to a GDF_FLOAT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_generic_to_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column of type GDF_INT8 to a GDF_FLOAT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i8_to_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column of type GDF_INT32 to a GDF_FLOAT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i32_to_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column of type GDF_INT64 to a GDF_FLOAT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i64_to_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column of type GDF_FLOAT32 to a GDF_FLOAT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f32_to_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column of type GDF_FLOAT64 to a GDF_FLOAT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f64_to_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column of type GDF_DATE32 to a GDF_FLOAT32 + * + * This is effectively casting the underlying GDF_INT32 physical data type of GDF_DATE32 to GDF_FLOAT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date32_to_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column of type GDF_DATE64 to a GDF_FLOAT32 + * + * This is effectively casting the underlying GDF_INT64 physical data type of GDF_DATE64 to GDF_FLOAT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date64_to_f32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column of type GDF_TIMESTAMP to a GDF_FLOAT32 + * + * This is effectively casting the underlying GDF_INT64 physical data type of GDF_TIMESTAMP to GDF_FLOAT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_timestamp_to_f32(gdf_column *input, gdf_column *output); +/** + * @brief Casts data in a gdf_column of any data type to a GDF_FLOAT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_generic_to_f64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT8 to a GDF_FLOAT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i8_to_f64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT32 to a GDF_FLOAT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i32_to_f64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT64 to a GDF_FLOAT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i64_to_f64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT32 to a GDF_FLOAT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f32_to_f64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT64 to a GDF_FLOAT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f64_to_f64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_DATE32 to a GDF_FLOAT64 + * + * This is effectively casting the underlying GDF_INT32 physical data type of GDF_DATE32 to GDF_FLOAT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date32_to_f64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_DATE64 to a GDF_FLOAT64 + * + * This is effectively casting the underlying GDF_INT64 physical data type of GDF_DATE64 to GDF_FLOAT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date64_to_f64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_TIMESTAMP to a GDF_FLOAT64 + * + * This is effectively casting the underlying GDF_INT64 physical data type of GDF_TIMESTAMP to GDF_FLOAT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_timestamp_to_f64(gdf_column *input, gdf_column *output); +/** + * @brief Casts data in a gdf_column of any data type to a GDF_INT8 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_generic_to_i8(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT8 to a GDF_INT8 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i8_to_i8(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT32 to a GDF_INT8 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i32_to_i8(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT64 to a GDF_INT8 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i64_to_i8(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT32 to a GDF_INT8 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f32_to_i8(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT64 to a GDF_INT8 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f64_to_i8(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_DATE32 to a GDF_INT8 + * + * This is effectively casting the underlying GDF_INT32 physical data type of GDF_DATE32 to GDF_INT8 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date32_to_i8(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_DATE64 to a GDF_INT8 + * + * This is effectively casting the underlying GDF_INT64 physical data type of GDF_DATE64 to GDF_INT8 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date64_to_i8(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_TIMESTAMP to a GDF_INT8 + * + * This is effectively casting the underlying GDF_INT64 physical data type of GDF_TIMESTAMP to GDF_INT8 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_timestamp_to_i8(gdf_column *input, gdf_column *output); +/** + * @brief Casts data in a gdf_column of any data type to a GDF_INT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_generic_to_i32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT8 to a GDF_INT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i8_to_i32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT32 to a GDF_INT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i32_to_i32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT64 to a GDF_INT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i64_to_i32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT32 to a GDF_INT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f32_to_i32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT64 to a GDF_INT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f64_to_i32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_DATE32 to a GDF_INT32 + * + * This is effectively casting the underlying GDF_INT32 physical data type of GDF_DATE32 to GDF_INT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date32_to_i32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_DATE64 to a GDF_INT32 + * + * This is effectively casting the underlying GDF_INT64 physical data type of GDF_DATE64 to GDF_INT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date64_to_i32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_TIMESTAMP to a GDF_INT32 + * + * This is effectively casting the underlying GDF_INT64 physical data type of GDF_TIMESTAMP to GDF_INT32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_timestamp_to_i32(gdf_column *input, gdf_column *output); +/** + * @brief Casts data in a gdf_column of any data type to a GDF_INT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_generic_to_i64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT8 to a GDF_INT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i8_to_i64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT32 to a GDF_INT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i32_to_i64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT64 to a GDF_INT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i64_to_i64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT32 to a GDF_INT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f32_to_i64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT64 to a GDF_INT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f64_to_i64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_DATE32 to a GDF_INT64 + * + * This is effectively casting the underlying GDF_INT32 physical data type of GDF_DATE32 to GDF_INT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date32_to_i64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_DATE64 to a GDF_INT64 + * + * This is effectively casting the underlying GDF_INT64 physical data type of GDF_DATE64 to GDF_INT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date64_to_i64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_TIMESTAMP to a GDF_INT64 + * + * This is effectively casting the underlying GDF_INT64 physical data type of GDF_TIMESTAMP to GDF_INT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_timestamp_to_i64(gdf_column *input, gdf_column *output); +/** + * @brief Casts data in a gdf_column of any data type to a GDF_DATE32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_generic_to_date32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT8 to a GDF_DATE32 + * + * This is effectively casting the GDF_INT8 to the underlying GDF_INT32 physical data type of GDF_DATE32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i8_to_date32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT32 to a GDF_DATE32 + * + * This is effectively casting the GDF_INT32 to the underlying GDF_INT32 physical data type of GDF_DATE32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i32_to_date32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT64 to a GDF_DATE32 + * + * This is effectively casting the GDF_INT64 to the underlying GDF_INT32 physical data type of GDF_DATE32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i64_to_date32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT32 to a GDF_DATE32 + * + * This is effectively casting the GDF_FLOAT32 to the underlying GDF_INT32 physical data type of GDF_DATE32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f32_to_date32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT64 to a GDF_DATE32 + * + * This is effectively casting the GDF_FLOAT64 to the underlying GDF_INT32 physical data type of GDF_DATE32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f64_to_date32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_DATE32 to a GDF_DATE32 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date32_to_date32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_DATE64 to a GDF_DATE32 + * + * This casting converts from milliseconds since the UNIX epoch to days since the UNIX epoch + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date64_to_date32(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_TIMESTAMP to a GDF_DATE32 + * + * This casting converts from gdf_time_unit since the UNIX epoch to days since the UNIX epoch + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_timestamp_to_date32(gdf_column *input, gdf_column *output); +/** + * @brief Casts data in a gdf_column of any data type to a GDF_FLOAT64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_generic_to_date64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT8 to a GDF_DATE64 + * + * This is effectively casting the GDF_INT8 to the underlying GDF_INT64 physical data type of GDF_DATE64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i8_to_date64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT32 to a GDF_DATE64 + * + * This is effectively casting the GDF_INT32 to the underlying GDF_INT64 physical data type of GDF_DATE64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i32_to_date64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_INT64 to a GDF_DATE64 + * + * This is effectively casting the GDF_INT64 to the underlying GDF_INT64 physical data type of GDF_DATE64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i64_to_date64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT32 to a GDF_DATE64 + * + * This is effectively casting the GDF_FLOAT32 to the underlying GDF_INT64 physical data type of GDF_DATE64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f32_to_date64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT64 to a GDF_DATE64 + * + * This is effectively casting the GDF_FLOAT64 to the underlying GDF_INT64 physical data type of GDF_DATE64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f64_to_date64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_DATE32 to a GDF_DATE64 + * + * This casting converts from days since the UNIX epoch to milliseconds since the UNIX epoch + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date32_to_date64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_DATE64 to a GDF_DATE64 + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date64_to_date64(gdf_column *input, gdf_column *output); + +/** + * @brief Casts data in a gdf_column type GDF_TIMESTAMP to a GDF_DATE32 + * + * This casting converts from gdf_time_unit since the UNIX epoch to milliseconds since the UNIX epoch + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_timestamp_to_date64(gdf_column *input, gdf_column *output); +/** + * @brief Casts data in a gdf_column of any data type to a GDF_TIMESTAMP + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_generic_to_timestamp(gdf_column *input, gdf_column *output, gdf_time_unit time_unit); + +/** + * @brief Casts data in a gdf_column type GDF_INT8 to a GDF_TIMESTAMP + * + * This is effectively casting the GDF_INT8 to the underlying GDF_INT64 physical data type of GDF_TIMESTAMP + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i8_to_timestamp(gdf_column *input, gdf_column *output, gdf_time_unit time_unit); + +/** + * @brief Casts data in a gdf_column type GDF_INT32 to a GDF_TIMESTAMP + * + * This is effectively casting the GDF_INT32 to the underlying GDF_INT64 physical data type of GDF_TIMESTAMP + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i32_to_timestamp(gdf_column *input, gdf_column *output, gdf_time_unit time_unit); + +/** + * @brief Casts data in a gdf_column type GDF_INT64 to a GDF_TIMESTAMP + * + * This is effectively casting the GDF_INT64 to the underlying GDF_INT64 physical data type of GDF_TIMESTAMP + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_i64_to_timestamp(gdf_column *input, gdf_column *output, gdf_time_unit time_unit); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT32 to a GDF_TIMESTAMP + * + * This is effectively casting the GDF_FLOAT32 to the underlying GDF_INT64 physical data type of GDF_TIMESTAMP + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f32_to_timestamp(gdf_column *input, gdf_column *output, gdf_time_unit time_unit); + +/** + * @brief Casts data in a gdf_column type GDF_FLOAT64 to a GDF_TIMESTAMP + * + * This is effectively casting the GDF_FLOAT64 to the underlying GDF_INT64 physical data type of GDF_TIMESTAMP + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_f64_to_timestamp(gdf_column *input, gdf_column *output, gdf_time_unit time_unit); + +/** + * @brief Casts data in a gdf_column type GDF_DATE32 to a GDF_TIMESTAMP + * + * This casting converts from days since UNIX epoch to gdf_time_unit since the UNIX epoch + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date32_to_timestamp(gdf_column *input, gdf_column *output, gdf_time_unit time_unit); + +/** + * @brief Casts data in a gdf_column type GDF_DATE64 to a GDF_TIMESTAMP + * + * This casting converts from milliseconds days since UNIX epoch to gdf_time_unit since the UNIX epoch + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_date64_to_timestamp(gdf_column *input, gdf_column *output, gdf_time_unit time_unit); + +/** + * @brief Casts data in a gdf_column type GDF_TIMESTAMP to a GDF_TIMESTAMP + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_cast_timestamp_to_timestamp(gdf_column *input, gdf_column *output, gdf_time_unit time_unit); + /* datetime extract*/ + +/** + * @brief Extracts year from any date time type and places results into a preallocated GDF_INT16 column + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_extract_datetime_year(gdf_column *input, gdf_column *output); + +/** + * @brief Extracts month from any date time type and places results into a preallocated GDF_INT16 column + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_extract_datetime_month(gdf_column *input, gdf_column *output); + +/** + * @brief Extracts day from any date time type and places results into a preallocated GDF_INT16 column + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_extract_datetime_day(gdf_column *input, gdf_column *output); + +/** + * @brief Extracts hour from either GDF_DATE64 or GDF_TIMESTAMP type and places results into a preallocated GDF_INT16 column + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_extract_datetime_hour(gdf_column *input, gdf_column *output); + +/** + * @brief Extracts minute from either GDF_DATE64 or GDF_TIMESTAMP type and places results into a preallocated GDF_INT16 column + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_extract_datetime_minute(gdf_column *input, gdf_column *output); + +/** + * @brief Extracts second from either GDF_DATE64 or GDF_TIMESTAMP type and places results into a preallocated GDF_INT16 column + * + * @param[in] gdf_column of the input + * @param[out] output gdf_column. The output memory needs to be preallocated + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_extract_datetime_second(gdf_column *input, gdf_column *output); @@ -674,20 +2068,20 @@ size for this use. */ -/* --------------------------------------------------------------------------* +/** * @brief Reports the intermediate buffer size in elements required for * all cuDF reduction operations (gdf_sum, gdf_product, * gdf_sum_of_squares, gdf_min and gdf_max) - * * - * @return The size of output/intermediate buffer to allocate for reductions + * + * @returns The size of output/intermediate buffer to allocate for reductions * * @todo Reductions should be re-implemented to use an atomic add for each * block sum rather than launch a second kernel. When that happens, this * function can go away and the output can be a single element. - * --------------------------------------------------------------------------*/ + */ unsigned int gdf_reduction_get_intermediate_output_size(); -/* --------------------------------------------------------------------------* +/** * @brief Computes the sum of the values in all rows of a column * * @param[in] col Input column @@ -697,13 +2091,13 @@ unsigned int gdf_reduction_get_intermediate_output_size(); * This is used as intermediate storage, and the * first element contains the total result * - * @return GDF_SUCCESS if the operation was successful, otherwise an + * @returns GDF_SUCCESS if the operation was successful, otherwise an * appropriate error code. * - * --------------------------------------------------------------------------*/ + */ gdf_error gdf_sum(gdf_column *col, void *dev_result, gdf_size_type dev_result_size); -/* --------------------------------------------------------------------------* +/** * @brief Computes the multiplicative product of the values in all rows of * a column * @@ -714,12 +2108,12 @@ gdf_error gdf_sum(gdf_column *col, void *dev_result, gdf_size_type dev_result_si * This is used as intermediate storage, and the * first element contains the total result * - * @return GDF_SUCCESS if the operation was successful, otherwise an + * @returns GDF_SUCCESS if the operation was successful, otherwise an * appropriate error code. - * --------------------------------------------------------------------------*/ + */ gdf_error gdf_product(gdf_column *col, void *dev_result, gdf_size_type dev_result_size); -/* --------------------------------------------------------------------------* +/** * @brief Computes the sum of squares of the values in all rows of a column * * Sum of squares is useful for variance implementation. @@ -731,15 +2125,15 @@ gdf_error gdf_product(gdf_column *col, void *dev_result, gdf_size_type dev_resul * This is used as intermediate storage, and the * first element contains the total result * - * @return GDF_SUCCESS if the operation was successful, otherwise an + * @returns GDF_SUCCESS if the operation was successful, otherwise an * appropriate error code. * * @todo could be implemented using inner_product if that function is * implemented - * --------------------------------------------------------------------------*/ + */ gdf_error gdf_sum_of_squares(gdf_column *col, void *dev_result, gdf_size_type dev_result_size); -/* --------------------------------------------------------------------------* +/** * @brief Computes the minimum of the values in all rows of a column * * @param[in] col Input column @@ -749,13 +2143,13 @@ gdf_error gdf_sum_of_squares(gdf_column *col, void *dev_result, gdf_size_type de * This is used as intermediate storage, and the * first element contains the total result * - * @return GDF_SUCCESS if the operation was successful, otherwise an + * @returns GDF_SUCCESS if the operation was successful, otherwise an * appropriate error code. * - * --------------------------------------------------------------------------*/ + */ gdf_error gdf_min(gdf_column *col, void *dev_result, gdf_size_type dev_result_size); -/* --------------------------------------------------------------------------* +/** * @brief Computes the maximum of the values in all rows of a column * * @param[in] col Input column @@ -765,10 +2159,10 @@ gdf_error gdf_min(gdf_column *col, void *dev_result, gdf_size_type dev_result_si * This is used as intermediate storage, and the * first element contains the total result * - * @return GDF_SUCCESS if the operation was successful, otherwise an + * @returns GDF_SUCCESS if the operation was successful, otherwise an * appropriate error code. * - * --------------------------------------------------------------------------*/ + */ gdf_error gdf_max(gdf_column *col, void *dev_result, gdf_size_type dev_result_size); @@ -776,37 +2170,145 @@ gdf_error gdf_max(gdf_column *col, void *dev_result, gdf_size_type dev_result_si * Filtering and comparison operators */ - -//These compare every value on the left hand side to a static value and return a stencil in output which will have 1 when the comparison operation returns 1 and 0 otherwise +/** + * @brief Compare every value on the left hand side to a static value and return a stencil in output which will have 1 when the comparison operation returns 1 and 0 otherwise + * + * @param[in] gdf_column of the input of type GDF_INT8 + * @param[in] Static value to compare against the input + * @param[out] output gdf_column of type GDF_INT8. The output memory needs to be preallocated + * @param[in] gdf_comparison_operator enum defining the comparison operator to be used + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_comparison_static_i8(gdf_column *lhs, int8_t value, gdf_column *output,gdf_comparison_operator operation); + +/** + * @brief Compare every value on the left hand side to a static value and return a stencil in output which will have 1 when the comparison operation returns 1 and 0 otherwise + * + * @param[in] gdf_column of the input of type GDF_INT16 + * @param[in] Static value to compare against the input + * @param[out] output gdf_column of type GDF_INT8. The output memory needs to be preallocated + * @param[in] gdf_comparison_operator enum defining the comparison operator to be used + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_comparison_static_i16(gdf_column *lhs, int16_t value, gdf_column *output,gdf_comparison_operator operation); + +/** + * @brief Compare every value on the left hand side to a static value and return a stencil in output which will have 1 when the comparison operation returns 1 and 0 otherwise + * + * @param[in] gdf_column of the input of type GDF_INT32 + * @param[in] Static value to compare against the input + * @param[out] output gdf_column of type GDF_INT8. The output memory needs to be preallocated + * @param[in] gdf_comparison_operator enum defining the comparison operator to be used + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_comparison_static_i32(gdf_column *lhs, int32_t value, gdf_column *output,gdf_comparison_operator operation); + +/** + * @brief Compare every value on the left hand side to a static value and return a stencil in output which will have 1 when the comparison operation returns 1 and 0 otherwise + * + * @param[in] gdf_column of the input of type GDF_INT64 + * @param[in] Static value to compare against the input + * @param[out] output gdf_column of type GDF_INT8. The output memory needs to be preallocated + * @param[in] gdf_comparison_operator enum defining the comparison operator to be used + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_comparison_static_i64(gdf_column *lhs, int64_t value, gdf_column *output,gdf_comparison_operator operation); + +/** + * @brief Compare every value on the left hand side to a static value and return a stencil in output which will have 1 when the comparison operation returns 1 and 0 otherwise + * + * @param[in] gdf_column of the input of type GDF_FLOAT32 + * @param[in] Static value to compare against the input + * @param[out] output gdf_column of type GDF_INT8. The output memory needs to be preallocated + * @param[in] gdf_comparison_operator enum defining the comparison operator to be used + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_comparison_static_f32(gdf_column *lhs, float value, gdf_column *output,gdf_comparison_operator operation); + +/** + * @brief Compare every value on the left hand side to a static value and return a stencil in output which will have 1 when the comparison operation returns 1 and 0 otherwise + * + * @param[in] gdf_column of the input of type GDF_FLOAT64 + * @param[in] Static value to compare against the input + * @param[out] output gdf_column of type GDF_INT8. The output memory needs to be preallocated + * @param[in] gdf_comparison_operator enum defining the comparison operator to be used + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_comparison_static_f64(gdf_column *lhs, double value, gdf_column *output,gdf_comparison_operator operation); -//allows you two compare two columns against each other using a comparison operation, retunrs a stencil like functions above +/** + * @brief Compare two columns of any types against each other using a comparison operation, returns a stencil in output which will have 1 when the comparison operation returns 1 and 0 otherwise + * + * @param[in] gdf_column of one input of any type + * @param[in] gdf_column of second input of any type + * @param[out] output gdf_column of type GDF_INT8. The output memory needs to be preallocated + * @param[in] gdf_comparison_operator enum defining the comparison operator to be used + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_comparison(gdf_column *lhs, gdf_column *rhs, gdf_column *output,gdf_comparison_operator operation); -//takes a stencil and uses it to compact a colum e.g. remove all values for which the stencil = 0 -//The lhs column is expected to have 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned +/** + * @brief takes a stencil and uses it to compact a colum e.g. remove all values for which the stencil = 0 + * + * @param[in] gdf_column of input of any type + * @param[in] gdf_column holding the stencil + * @param[out] output gdf_column of same type as input. The output memory needs to be preallocated to be the same size as input + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_apply_stencil(gdf_column *lhs, gdf_column * stencil, gdf_column * output); +/** + * @brief Concatenates two gdf_columns + * + * @param[in] gdf_column of one input of any type + * @param[in] gdf_column of same type as the first + * @param[out] output gdf_column of same type as inputs. The output memory needs to be preallocated to be the same size as the sum of both inputs + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_concat(gdf_column *lhs, gdf_column *rhs, gdf_column *output); + /* * Hashing */ -//class cudaStream_t; +/** + * @brief Creates a hash of multiple gdf_columns + * + * @param[in] an array of gdf_columns to be hashes together + * @param[in] the number of columns in the array of gdf_columns to be hashes together + * @param[out] output gdf_column of type GDF_INT64. The output memory needs to be preallocated + * @param[in] A pointer to a cudaStream_t. If nullptr, the function will create a stream to use. + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error gdf_hash_columns(gdf_column ** columns_to_hash, int num_columns, gdf_column * output_column, void * stream); + /* * gdf introspection utlities */ +/** + * @brief returns the byte width of the data type of the gdf_column + * + * @param[in] gdf_column whose data type's byte width will be determined + * @param[out] the byte width of the data type + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ gdf_error get_column_byte_width(gdf_column * col, int * width); + /* Multi-Column SQL ops: WHERE (Filtering) @@ -814,76 +2316,167 @@ gdf_error get_column_byte_width(gdf_column * col, int * width); GROUP-BY */ -gdf_error gdf_filter(size_t nrows, //in: # rows - gdf_column* cols, //in: host-side array of gdf_columns with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - size_t ncols, //in: # cols - void** d_cols, //out: pre-allocated device-side array to be filled with gdf_column::data for each column; slicing of gdf_column array (host) - int* d_types, //out: pre-allocated device-side array to be filled with gdf_colum::dtype for each column; slicing of gdf_column array (host) - void** d_vals, //in: device-side array of values to filter against (type-erased) - size_t* d_indx, //out: device-side array of row indices that remain after filtering - size_t* new_sz); //out: host-side # rows that remain after filtering - -gdf_error gdf_group_by_sum(int ncols, // # columns - gdf_column** cols, //input cols with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - gdf_column* col_agg, //column to aggregate on with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - gdf_column* out_col_indices, //if not null return indices of re-ordered rows - gdf_column** out_col_values, //if not null return the grouped-by columns - //(multi-gather based on indices, which are needed anyway) - gdf_column* out_col_agg, //aggregation result - gdf_context* ctxt); //struct with additional info: bool is_sorted, flag_sort_or_hash, bool flag_count_distinct - -gdf_error gdf_group_by_min(int ncols, // # columns - gdf_column** cols, //input cols with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - gdf_column* col_agg, //column to aggregate on with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - gdf_column* out_col_indices, //if not null return indices of re-ordered rows - gdf_column** out_col_values, //if not null return the grouped-by columns - //(multi-gather based on indices, which are needed anyway) - gdf_column* out_col_agg, //aggregation result - gdf_context* ctxt); //struct with additional info: bool is_sorted, flag_sort_or_hash, bool flag_count_distinct - - -gdf_error gdf_group_by_max(int ncols, // # columns - gdf_column** cols, //input cols with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - gdf_column* col_agg, //column to aggregate on with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - gdf_column* out_col_indices, //if not null return indices of re-ordered rows - gdf_column** out_col_values, //if not null return the grouped-by columns - //(multi-gather based on indices, which are needed anyway) - gdf_column* out_col_agg, //aggregation result - gdf_context* ctxt); //struct with additional info: bool is_sorted, flag_sort_or_hash, bool flag_count_distinct - - -gdf_error gdf_group_by_avg(int ncols, // # columns - gdf_column** cols, //input cols with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - gdf_column* col_agg, //column to aggregate on with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - gdf_column* out_col_indices, //if not null return indices of re-ordered rows - gdf_column** out_col_values, //if not null return the grouped-by columns - //(multi-gather based on indices, which are needed anyway) - gdf_column* out_col_agg, //aggregation result - gdf_context* ctxt); //struct with additional info: bool is_sorted, flag_sort_or_hash, bool flag_count_distinct - -gdf_error gdf_group_by_count(int ncols, // # columns - gdf_column** cols, //input cols with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - gdf_column* col_agg, //column to aggregate on with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - gdf_column* out_col_indices, //if not null return indices of re-ordered rows - gdf_column** out_col_values, //if not null return the grouped-by columns - //(multi-gather based on indices, which are needed anyway) - gdf_column* out_col_agg, //aggregation result - gdf_context* ctxt); //struct with additional info: bool is_sorted, flag_sort_or_hash, bool flag_count_distinct - -gdf_error gdf_quantile_exact( gdf_column* col_in, //input column with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - gdf_quantile_method prec, //precision: type of quantile method calculation - double q, //requested quantile in [0,1] - void* t_erased_res, //result; for should probably be double*; it's void* because - //(1) for uniformity of interface with ; - //(2) for possible types bigger than double, in the future; - gdf_context* ctxt); //context info - -gdf_error gdf_quantile_aprrox( gdf_column* col_in, //input column with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned - double q, //requested quantile in [0,1] - void* t_erased_res, //type-erased result of same type as column; - gdf_context* ctxt); //context info - -/* --------------------------------------------------------------------------* +/** + * @brief Performs SQL like WHERE (Filtering) + * + * @param[in] # rows + * @param[in] host-side array of gdf_columns with 0 null_count otherwise GDF_VALIDITY_UNSUPPORTED is returned + * @param[in] # cols + * @param[out] pre-allocated device-side array to be filled with gdf_column::data for each column; slicing of gdf_column array (host) + * @param[out] pre-allocated device-side array to be filled with gdf_colum::dtype for each column; slicing of gdf_column array (host) + * @param[in] device-side array of values to filter against (type-erased) + * @param[out] device-side array of row indices that remain after filtering + * @param[out] host-side # rows that remain after filtering + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ +gdf_error gdf_filter(size_t nrows, + gdf_column* cols, + size_t ncols, + void** d_cols, + int* d_types, + void** d_vals, + size_t* d_indx, + size_t* new_sz); + +/** + * @brief Performs SQL like GROUP BY with SUM aggregation + * + * @param[in] # columns + * @param[in] input cols + * @param[in] column to aggregate on + * @param[out] if not null return indices of re-ordered rows + * @param[out] if not null return the grouped-by columns (multi-gather based on indices, which are needed anyway) + * @param[out] aggregation result + * @param[in] struct with additional info: bool is_sorted, flag_sort_or_hash, bool flag_count_distinct + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ +gdf_error gdf_group_by_sum(int ncols, + gdf_column** cols, + gdf_column* col_agg, + gdf_column* out_col_indices, + gdf_column** out_col_values, + gdf_column* out_col_agg, + gdf_context* ctxt); + +/** + * @brief Performs SQL like GROUP BY with MIN aggregation + * + * @param[in] # columns + * @param[in] input cols + * @param[in] column to aggregate on + * @param[out] if not null return indices of re-ordered rows + * @param[out] if not null return the grouped-by columns (multi-gather based on indices, which are needed anyway) + * @param[out] aggregation result + * @param[in] struct with additional info: bool is_sorted, flag_sort_or_hash, bool flag_count_distinct + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ +gdf_error gdf_group_by_min(int ncols, + gdf_column** cols, + gdf_column* col_agg, + gdf_column* out_col_indices, + gdf_column** out_col_values, + gdf_column* out_col_agg, + gdf_context* ctxt); + +/** + * @brief Performs SQL like GROUP BY with MAX aggregation + * + * @param[in] # columns + * @param[in] input cols + * @param[in] column to aggregate on + * @param[out] if not null return indices of re-ordered rows + * @param[out] if not null return the grouped-by columns (multi-gather based on indices, which are needed anyway) + * @param[out] aggregation result + * @param[in] struct with additional info: bool is_sorted, flag_sort_or_hash, bool flag_count_distinct + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ +gdf_error gdf_group_by_max(int ncols, + gdf_column** cols, + gdf_column* col_agg, + gdf_column* out_col_indices, + gdf_column** out_col_values, + gdf_column* out_col_agg, + gdf_context* ctxt); + +/** + * @brief Performs SQL like GROUP BY with AVG aggregation + * + * @param[in] # columns + * @param[in] input cols + * @param[in] column to aggregate on + * @param[out] if not null return indices of re-ordered rows + * @param[out] if not null return the grouped-by columns (multi-gather based on indices, which are needed anyway) + * @param[out] aggregation result + * @param[in] struct with additional info: bool is_sorted, flag_sort_or_hash, bool flag_count_distinct + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ +gdf_error gdf_group_by_avg(int ncols, + gdf_column** cols, + gdf_column* col_agg, + gdf_column* out_col_indices, + gdf_column** out_col_values, + gdf_column* out_col_agg, + gdf_context* ctxt); + +/** + * @brief Performs SQL like GROUP BY with COUNT aggregation + * + * @param[in] # columns + * @param[in] input cols + * @param[in] column to aggregate on + * @param[out] if not null return indices of re-ordered rows + * @param[out] if not null return the grouped-by columns (multi-gather based on indices, which are needed anyway) + * @param[out] aggregation result + * @param[in] struct with additional info: bool is_sorted, flag_sort_or_hash, bool flag_count_distinct + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ +gdf_error gdf_group_by_count(int ncols, + gdf_column** cols, + gdf_column* col_agg, + gdf_column* out_col_indices, + gdf_column** out_col_values, + gdf_column* out_col_agg, + gdf_context* ctxt); + +/** + * @brief Calculates exact quantiles + * + * @param[in] input column + * @param[in] precision: type of quantile method calculation + * @param[in] requested quantile in [0,1] + * @param[out] result; for should probably be double*; it's void* because: (1) for uniformity of interface with ; (2) for possible types bigger than double, in the future; + * @param[in] struct with additional info + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ +gdf_error gdf_quantile_exact(gdf_column* col_in, + gdf_quantile_method prec, + double q, + void* t_erased_res, + gdf_context* ctxt); + +/** + * @brief Calculates approximate quantiles + * + * @param[in] input column + * @param[in] requested quantile in [0,1] + * @param[out] result; type-erased result of same type as column; + * @param[in] struct with additional info + * + * @returns GDF_SUCCESS upon successful compute, otherwise returns appropriate error code + */ +gdf_error gdf_quantile_approx(gdf_column* col_in, + double q, + void* t_erased_res, + gdf_context* ctxt); + +/** * @brief Replace elements from `col` according to the mapping `old_values` to * `new_values`, that is, replace all `old_values[i]` present in `col` * with `new_values[i]`. @@ -894,12 +2487,12 @@ gdf_error gdf_quantile_aprrox( gdf_column* col_in, //input column with 0 * * @returns GDF_SUCCESS upon successful completion * - * --------------------------------------------------------------------------*/ + */ gdf_error gdf_find_and_replace_all(gdf_column* col, const gdf_column* old_values, const gdf_column* new_values); -/* --------------------------------------------------------------------------* +/** * @brief Sorts an array of gdf_column. * * @param[in] input_columns Array of gdf_columns @@ -913,15 +2506,14 @@ gdf_error gdf_find_and_replace_all(gdf_column* col, * indices * * @returns GDF_SUCCESS upon successful completion - * - * ----------------------------------------------------------------------------*/ + */ gdf_error gdf_order_by(gdf_column** input_columns, int8_t* asc_desc, size_t num_inputs, gdf_column* output_indices, int flag_nulls_are_smallest); -/* --------------------------------------------------------------------------* +/** * @brief Replaces all null values in a column with either a specific value or corresponding values of another column * * This function is a binary function. It will take in two gdf_columns. @@ -938,15 +2530,14 @@ gdf_error gdf_order_by(gdf_column** input_columns, * replace all nulls of the first column with the corresponding elemetns of the * second column * - * @Param[in,out] col_out A gdf_column that is the output of this function with null values replaced - * @Param[in] col_in A gdf_column that is of size 1 or same size as col_out, contains value / values to be placed in col_out + * @param[in,out] col_out A gdf_column that is the output of this function with null values replaced + * @param[in] col_in A gdf_column that is of size 1 or same size as col_out, contains value / values to be placed in col_out * - * @Returns GDF_SUCCESS upon successful completion - * - * --------------------------------------------------------------------------*/ + * @returns GDF_SUCCESS upon successful completion + */ gdf_error gdf_replace_nulls(gdf_column* col_out, const gdf_column* col_in); -/* --------------------------------------------------------------------------* +/** * @brief Finds the indices of the bins in which each value of the column * belongs. * @@ -964,10 +2555,9 @@ gdf_error gdf_replace_nulls(gdf_column* col_out, * @param[out] out_indices Output device array of same size as `col` * to be filled with bin indices * - * @return GDF_SUCCESS upon successful completion, otherwise an + * @returns GDF_SUCCESS upon successful completion, otherwise an * appropriate error code. - * - * ----------------------------------------------------------------------------*/ + */ gdf_error gdf_digitize(gdf_column* col, gdf_column* bins, // same type as col bool right, diff --git a/cpp/src/join/joining.cu b/cpp/src/join/joining.cu index baffe6691c99..3ce4bc2fc40e 100644 --- a/cpp/src/join/joining.cu +++ b/cpp/src/join/joining.cu @@ -38,11 +38,11 @@ constexpr output_index_type MAX_JOIN_SIZE{std::numeric_limits /** * @brief Computes the Join result between two tables using the hash-based implementation. * - * @param num_cols The number of columns to join - * @param leftcol The left set of columns to join - * @param rightcol The right set of columns to join - * @param l_result The join computed indices of the left table - * @param r_result The join computed indices of the right table + * @param[in] num_cols The number of columns to join + * @param[in] leftcol The left set of columns to join + * @param[in] rightcol The right set of columns to join + * @param[out] l_result The join computed indices of the left table + * @param[out] r_result The join computed indices of the right table * @tparam join_type The type of join to be performed * @tparam size_type The data type used for size calculations * @@ -122,18 +122,18 @@ gdf_error sort_join_typed(gdf_column *leftcol, gdf_column *rightcol, /* --------------------------------------------------------------------------*/ /** * @brief Computes the join operation between a single left and single right column - using the sort based implementation. + * using the sort based implementation. * - * @param leftcol The left column to join - * @param rightcol The right column to join - * @param left_result The join computed indices of the left table - * @param right_result The join computed indices of the right table - * @param ctxt Structure that determines various run parameters, such as if the inputs - are already sorted. - @tparama join_type The type of join to perform + * @param[in] leftcol The left column to join + * @param[in] rightcol The right column to join + * @param[out] left_result The join computed indices of the left table + * @param[out] right_result The join computed indices of the right table + * @param[in] ctxt Structure that determines various run parameters, such as if the inputs + * are already sorted. + * @tparama join_type The type of join to perform * * @returns GDF_SUCCESS upon succesful completion of the join, otherwise returns - appropriate error code. + * appropriate error code. */ /* ----------------------------------------------------------------------------*/ template @@ -169,14 +169,16 @@ gdf_error sort_join(gdf_column *leftcol, gdf_column *rightc /* --------------------------------------------------------------------------*/ /** -* @brief Allocates a buffer and fills it with a repeated value -* -* @param buffer Address of the buffer to be allocated -* @param buffer_length Amount of memory to be allocated -* @param value The value to be filled into the buffer -* @tparam data_type The data type to be used for the buffer -* @tparam size_type The data type used for size calculations -*/ + * @brief Allocates a buffer and fills it with a repeated value + * + * @param[in,out] buffer Address of the buffer to be allocated + * @param[in] buffer_length Amount of memory to be allocated + * @param[in] value The value to be filled into the buffer + * @tparam data_type The data type to be used for the buffer + * @tparam size_type The data type used for size calculations + * + * @returns GDF_SUCCESS upon succesful completion + */ /* ----------------------------------------------------------------------------*/ template @@ -191,13 +193,15 @@ gdf_error allocValueBuffer(data_type ** buffer, /* --------------------------------------------------------------------------*/ /** -* @brief Allocates a buffer and fills it with a sequence -* -* @param buffer Address of the buffer to be allocated -* @param buffer_length Amount of memory to be allocated -* @tparam data_type The data type to be used for the buffer -* @tparam size_type The data type used for size calculations -*/ + * @brief Allocates a buffer and fills it with a sequence + * + * @param[in,out] buffer Address of the buffer to be allocated + * @param[in] buffer_length Amount of memory to be allocated + * @tparam data_type The data type to be used for the buffer + * @tparam size_type The data type used for size calculations + * + * @returns GDF_SUCCESS upon succesful completion + */ /* ----------------------------------------------------------------------------*/ template @@ -212,13 +216,13 @@ gdf_error allocSequenceBuffer(data_type ** buffer, /* --------------------------------------------------------------------------*/ /** * @brief Trivially computes full join of two tables if one of the tables - are empty + * are empty * - * @param left_size The size of the left table - * @param right_size The size of the right table - * @param rightcol The right set of columns to join - * @param left_result The join computed indices of the left table - * @param right_result The join computed indices of the right table + * @param[in] left_size The size of the left table + * @param[in] right_size The size of the right table + * @param[in] rightcol The right set of columns to join + * @param[out] left_result The join computed indices of the left table + * @param[out] right_result The join computed indices of the right table * @tparam size_type The data type used for size calculations * * @returns GDF_SUCCESS upon succesfull compute, otherwise returns appropriate error code @@ -267,13 +271,13 @@ gdf_error trivial_full_join( /** * @brief Computes the join operation between two sets of columns * - * @param num_cols The number of columns to join - * @param leftcol The left set of columns to join - * @param rightcol The right set of columns to join - * @param left_result The join computed indices of the left table - * @param right_result The join computed indices of the right table - * @param join_context A structure that determines various run parameters, such as - whether to perform a hash or sort based join + * @param[in] num_cols The number of columns to join + * @param[in] leftcol The left set of columns to join + * @param[in] rightcol The right set of columns to join + * @param[out] left_result The join computed indices of the left table + * @param[out] right_result The join computed indices of the right table + * @param[in] join_context A structure that determines various run parameters, such as + * whether to perform a hash or sort based join * @tparam join_type The type of join to be performed * * @returns GDF_SUCCESS upon succesfull compute, otherwise returns appropriate error code diff --git a/cpp/src/quantiles/quantiles.cu b/cpp/src/quantiles/quantiles.cu index 6b92caea69ff..895617d4c483 100644 --- a/cpp/src/quantiles/quantiles.cu +++ b/cpp/src/quantiles/quantiles.cu @@ -204,7 +204,7 @@ gdf_error gdf_quantile_exact( gdf_column* col_in, //input column; return ret; } -gdf_error gdf_quantile_aprrox( gdf_column* col_in, //input column; +gdf_error gdf_quantile_approx( gdf_column* col_in, //input column; double q, //requested quantile in [0,1] void* t_erased_res, //type-erased result of same type as column; gdf_context* ctxt) //context info diff --git a/cpp/tests/quantiles/quantiles_test.cu b/cpp/tests/quantiles/quantiles_test.cu index 6edbc6d703b5..87d6719f1090 100644 --- a/cpp/tests/quantiles/quantiles_test.cu +++ b/cpp/tests/quantiles/quantiles_test.cu @@ -65,7 +65,7 @@ void f_quantile_tester(gdf_column* col_in, std::vector& v_out_exact, std: { VType res = 0; auto q = qvals[j]; - gdf_error ret = gdf_quantile_aprrox(col_in, q, &res, &ctxt); + gdf_error ret = gdf_quantile_approx(col_in, q, &res, &ctxt); v_out_exact[j] = res; EXPECT_EQ( ret, expected_error) << "approx " << " returns unexpected failure\n"; diff --git a/python/cudf/_gdf.py b/python/cudf/_gdf.py index a7e71b0d43ec..be44593c8ac4 100644 --- a/python/cudf/_gdf.py +++ b/python/cudf/_gdf.py @@ -594,7 +594,7 @@ def quantile(column, quant, method, exact): ffi.cast('void *', px), gdf_context) else: - libgdf.gdf_quantile_aprrox(column.cffi_view, + libgdf.gdf_quantile_approx(column.cffi_view, q, ffi.cast('void *', px), gdf_context) diff --git a/python/cudf/bindings/cudf_cpp.pxd b/python/cudf/bindings/cudf_cpp.pxd index f7bffce9ac72..bcc19054ea42 100644 --- a/python/cudf/bindings/cudf_cpp.pxd +++ b/python/cudf/bindings/cudf_cpp.pxd @@ -672,7 +672,7 @@ cdef extern from "cudf.h" nogil: gdf_context* ctxt) - cdef gdf_error gdf_quantile_aprrox( gdf_column* col_in, + cdef gdf_error gdf_quantile_approx( gdf_column* col_in, double q, void* t_erased_res, gdf_context* ctxt)