Skip to content

Commit

Permalink
Use libcudf_exception_handler throughout pylibcudf.libcudf (#17109)
Browse files Browse the repository at this point in the history
Closes #17036

(WIP, generated by a quick `sed` script)

Authors:
  - https://github.com/brandon-b-miller
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #17109
  • Loading branch information
brandon-b-miller authored Nov 20, 2024
1 parent be9ba6c commit 2e88835
Show file tree
Hide file tree
Showing 111 changed files with 1,370 additions and 1,050 deletions.
56 changes: 32 additions & 24 deletions python/pylibcudf/pylibcudf/libcudf/aggregation.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from libcpp cimport bool
from libcpp.memory cimport unique_ptr
from libcpp.string cimport string
from libcpp.vector cimport vector
from pylibcudf.exception_handler cimport libcudf_exception_handler
from pylibcudf.libcudf.types cimport (
data_type,
interpolation,
Expand Down Expand Up @@ -94,71 +95,78 @@ cdef extern from "cudf/aggregation.hpp" namespace "cudf" nogil:
ZERO_NORMALIZED
ONE_NORMALIZED

cdef unique_ptr[T] make_sum_aggregation[T]() except +
cdef unique_ptr[T] make_sum_aggregation[T]() except +libcudf_exception_handler

cdef unique_ptr[T] make_product_aggregation[T]() except +
cdef unique_ptr[T] make_product_aggregation[T]() except +libcudf_exception_handler

cdef unique_ptr[T] make_min_aggregation[T]() except +
cdef unique_ptr[T] make_min_aggregation[T]() except +libcudf_exception_handler

cdef unique_ptr[T] make_max_aggregation[T]() except +
cdef unique_ptr[T] make_max_aggregation[T]() except +libcudf_exception_handler

cdef unique_ptr[T] make_count_aggregation[T](null_policy) except +
cdef unique_ptr[T] make_count_aggregation[T](
null_policy
) except +libcudf_exception_handler

cdef unique_ptr[T] make_any_aggregation[T]() except +
cdef unique_ptr[T] make_any_aggregation[T]() except +libcudf_exception_handler

cdef unique_ptr[T] make_all_aggregation[T]() except +
cdef unique_ptr[T] make_all_aggregation[T]() except +libcudf_exception_handler

cdef unique_ptr[T] make_sum_of_squares_aggregation[T]() except +
cdef unique_ptr[T] make_sum_of_squares_aggregation[T]()\
except +libcudf_exception_handler

cdef unique_ptr[T] make_mean_aggregation[T]() except +
cdef unique_ptr[T] make_mean_aggregation[T]() except +libcudf_exception_handler

cdef unique_ptr[T] make_variance_aggregation[T](
size_type ddof) except +
size_type ddof) except +libcudf_exception_handler

cdef unique_ptr[T] make_std_aggregation[T](size_type ddof) except +
cdef unique_ptr[T] make_std_aggregation[T](
size_type ddof
) except +libcudf_exception_handler

cdef unique_ptr[T] make_median_aggregation[T]() except +
cdef unique_ptr[T] make_median_aggregation[T]() except +libcudf_exception_handler

cdef unique_ptr[T] make_quantile_aggregation[T](
vector[double] q, interpolation i) except +
vector[double] q, interpolation i) except +libcudf_exception_handler

cdef unique_ptr[T] make_argmax_aggregation[T]() except +
cdef unique_ptr[T] make_argmax_aggregation[T]() except +libcudf_exception_handler

cdef unique_ptr[T] make_argmin_aggregation[T]() except +
cdef unique_ptr[T] make_argmin_aggregation[T]() except +libcudf_exception_handler

cdef unique_ptr[T] make_nunique_aggregation[T](null_policy null_handling) except +
cdef unique_ptr[T] make_nunique_aggregation[T](
null_policy null_handling
) except +libcudf_exception_handler

cdef unique_ptr[T] make_nth_element_aggregation[T](
size_type n,
null_policy null_handling
) except +
) except +libcudf_exception_handler

cdef unique_ptr[T] make_collect_list_aggregation[T](
null_policy null_handling
) except +
) except +libcudf_exception_handler

cdef unique_ptr[T] make_collect_set_aggregation[T](
null_policy null_handling, null_equality nulls_equal, nan_equality nans_equal
) except +
) except +libcudf_exception_handler

cdef unique_ptr[T] make_udf_aggregation[T](
udf_type type,
string user_defined_aggregator,
data_type output_type) except +
data_type output_type) except +libcudf_exception_handler

cdef unique_ptr[T] make_ewma_aggregation[T](
double com, ewm_history adjust
) except +
) except +libcudf_exception_handler

cdef unique_ptr[T] make_correlation_aggregation[T](
correlation_type type, size_type min_periods) except +
correlation_type type, size_type min_periods) except +libcudf_exception_handler

cdef unique_ptr[T] make_covariance_aggregation[T](
size_type min_periods, size_type ddof) except +
size_type min_periods, size_type ddof) except +libcudf_exception_handler

cdef unique_ptr[T] make_rank_aggregation[T](
rank_method method,
order column_order,
null_policy null_handling,
null_order null_precedence,
rank_percentage percentage) except +
rank_percentage percentage) except +libcudf_exception_handler
1 change: 0 additions & 1 deletion python/pylibcudf/pylibcudf/libcudf/binaryop.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Copyright (c) 2020-2024, NVIDIA CORPORATION.

from libc.stdint cimport int32_t
from libcpp cimport bool
from libcpp.memory cimport unique_ptr
Expand Down
22 changes: 11 additions & 11 deletions python/pylibcudf/pylibcudf/libcudf/column/column.pxd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright (c) 2020-2024, NVIDIA CORPORATION.

from libcpp cimport bool
from libcpp.memory cimport unique_ptr
from libcpp.vector cimport vector
from pylibcudf.exception_handler cimport libcudf_exception_handler
from pylibcudf.libcudf.column.column_view cimport (
column_view,
mutable_column_view,
Expand All @@ -19,15 +19,15 @@ cdef extern from "cudf/column/column.hpp" namespace "cudf" nogil:
vector[unique_ptr[column]] children

cdef cppclass column:
column() except +
column(const column& other) except +
column() except +libcudf_exception_handler
column(const column& other) except +libcudf_exception_handler

column(column_view view) except +
column(column_view view) except +libcudf_exception_handler

size_type size() except +
size_type null_count() except +
bool has_nulls() except +
data_type type() except +
column_view view() except +
mutable_column_view mutable_view() except +
column_contents release() except +
size_type size() except +libcudf_exception_handler
size_type null_count() except +libcudf_exception_handler
bool has_nulls() except +libcudf_exception_handler
data_type type() except +libcudf_exception_handler
column_view view() except +libcudf_exception_handler
mutable_column_view mutable_view() except +libcudf_exception_handler
column_contents release() except +libcudf_exception_handler
58 changes: 35 additions & 23 deletions python/pylibcudf/pylibcudf/libcudf/column/column_factories.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2020-2024, NVIDIA CORPORATION.

from libcpp.memory cimport unique_ptr
from pylibcudf.exception_handler cimport libcudf_exception_handler
from pylibcudf.libcudf.column.column cimport column
from pylibcudf.libcudf.scalar.scalar cimport scalar
from pylibcudf.libcudf.types cimport (
Expand All @@ -15,68 +15,80 @@ from rmm.librmm.device_buffer cimport device_buffer


cdef extern from "cudf/column/column_factories.hpp" namespace "cudf" nogil:
cdef unique_ptr[column] make_numeric_column(data_type type,
size_type size,
mask_state state) except +
cdef unique_ptr[column] make_numeric_column(
data_type type,
size_type size,
mask_state state
) except +libcudf_exception_handler

cdef unique_ptr[column] make_numeric_column(data_type type,
size_type size,
device_buffer mask,
size_type null_count) except +
cdef unique_ptr[column] make_numeric_column(
data_type type,
size_type size,
device_buffer mask,
size_type null_count
) except +libcudf_exception_handler

cdef unique_ptr[column] make_fixed_point_column(
data_type type,
size_type size,
mask_state state) except +
mask_state state) except +libcudf_exception_handler

cdef unique_ptr[column] make_fixed_point_column(
data_type type,
size_type size,
device_buffer mask,
size_type null_count) except +
size_type null_count) except +libcudf_exception_handler

cdef unique_ptr[column] make_timestamp_column(
data_type type,
size_type size,
mask_state state) except +
mask_state state) except +libcudf_exception_handler

cdef unique_ptr[column] make_timestamp_column(
data_type type,
size_type size,
device_buffer mask,
size_type null_count) except +
size_type null_count) except +libcudf_exception_handler

cdef unique_ptr[column] make_duration_column(
data_type type,
size_type size,
mask_state state) except +
mask_state state) except +libcudf_exception_handler

cdef unique_ptr[column] make_duration_column(
data_type type,
size_type size,
device_buffer mask,
size_type null_count) except +
size_type null_count) except +libcudf_exception_handler

cdef unique_ptr[column] make_fixed_width_column(
data_type type,
size_type size,
mask_state state) except +
mask_state state) except +libcudf_exception_handler

cdef unique_ptr[column] make_fixed_width_column(
data_type type,
size_type size,
device_buffer mask,
size_type null_count) except +
size_type null_count) except +libcudf_exception_handler

cdef unique_ptr[column] make_column_from_scalar(const scalar& s,
size_type size) except +
cdef unique_ptr[column] make_column_from_scalar(
const scalar& s,
size_type size
) except +libcudf_exception_handler

cdef unique_ptr[column] make_dictionary_from_scalar(const scalar& s,
size_type size) except +
cdef unique_ptr[column] make_dictionary_from_scalar(
const scalar& s,
size_type size
) except +libcudf_exception_handler

cdef unique_ptr[column] make_empty_column(type_id id) except +
cdef unique_ptr[column] make_empty_column(data_type type_) except +
cdef unique_ptr[column] make_empty_column(
type_id id
) except +libcudf_exception_handler
cdef unique_ptr[column] make_empty_column(
data_type type_
) except +libcudf_exception_handler

cdef unique_ptr[column] make_dictionary_column(
unique_ptr[column] keys_column,
unique_ptr[column] indices_column) except +
unique_ptr[column] indices_column) except +libcudf_exception_handler
Loading

0 comments on commit 2e88835

Please sign in to comment.