Skip to content

Commit

Permalink
Reorder functions
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Nov 29, 2023
1 parent 4bed647 commit 83c2630
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
16 changes: 8 additions & 8 deletions python/cudf/cudf/_lib/pylibcudf/copying.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ cpdef Table gather(
out_of_bounds_policy bounds_policy
)

cpdef Column shift(Column input, size_type offset, Scalar fill_values)

cpdef Table table_scatter(Table source, Column scatter_map, Table target_table)

cpdef Table scalar_scatter(list source, Column scatter_map, Table target_table)
Expand All @@ -28,16 +26,18 @@ cpdef object table_empty_like(Table input)

cpdef Column allocate_like(Column input_column, mask_allocation_policy policy, size=*)

cpdef Column copy_if_else(object lhs, object rhs, Column boolean_mask)

cpdef Table table_boolean_mask_scatter(Table input, Table target, Column boolean_mask)

cpdef Table scalar_boolean_mask_scatter(list input, Table target, Column boolean_mask)

cpdef Column copy_range(
Column input_column,
Column target_column,
size_type input_begin,
size_type input_end,
size_type target_begin,
)

cpdef Column shift(Column input, size_type offset, Scalar fill_values)

cpdef Column copy_if_else(object lhs, object rhs, Column boolean_mask)

cpdef Table table_boolean_mask_scatter(Table input, Table target, Column boolean_mask)

cpdef Table scalar_boolean_mask_scatter(list input, Table target, Column boolean_mask)
68 changes: 34 additions & 34 deletions python/cudf/cudf/_lib/pylibcudf/copying.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,6 @@ cpdef Table gather(
return Table.from_libcudf(move(c_result))


cpdef Column shift(Column input, size_type offset, Scalar fill_values):
cdef unique_ptr[column] c_result
with nogil:
c_result = move(
cpp_copying.shift(
input.view(),
offset,
dereference(fill_values.c_obj)
)
)
return Column.from_libcudf(move(c_result))


cpdef Table table_scatter(Table source, Column scatter_map, Table target_table):
cdef unique_ptr[table] c_result

Expand Down Expand Up @@ -171,6 +158,40 @@ cpdef Column allocate_like(
return Column.from_libcudf(move(c_result))


cpdef Column copy_range(
Column input_column,
Column target_column,
size_type input_begin,
size_type input_end,
size_type target_begin,
):
cdef unique_ptr[column] c_result

with nogil:
c_result = move(cpp_copying.copy_range(
input_column.view(),
target_column.view(),
input_begin,
input_end,
target_begin)
)

return Column.from_libcudf(move(c_result))


cpdef Column shift(Column input, size_type offset, Scalar fill_values):
cdef unique_ptr[column] c_result
with nogil:
c_result = move(
cpp_copying.shift(
input.view(),
offset,
dereference(fill_values.c_obj)
)
)
return Column.from_libcudf(move(c_result))


cpdef Column copy_if_else(object lhs, object rhs, Column boolean_mask):
cdef unique_ptr[column] result

Expand Down Expand Up @@ -246,24 +267,3 @@ cpdef Table scalar_boolean_mask_scatter(list input, Table target, Column boolean
)

return Table.from_libcudf(move(result))


cpdef Column copy_range(
Column input_column,
Column target_column,
size_type input_begin,
size_type input_end,
size_type target_begin,
):
cdef unique_ptr[column] c_result

with nogil:
c_result = move(cpp_copying.copy_range(
input_column.view(),
target_column.view(),
input_begin,
input_end,
target_begin)
)

return Column.from_libcudf(move(c_result))

0 comments on commit 83c2630

Please sign in to comment.