Skip to content

Commit

Permalink
Remove unnecessary move's in pylibcudf
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt711 committed Oct 2, 2024
1 parent 289e466 commit 1afa0b9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions python/pylibcudf/pylibcudf/strings/convert/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
set(cython_sources convert_durations.pyx convert_datetime.pyx)

set(linked_libraries cudf::cudf)

# Set the Cython flags to include annotation
set(CYTHON_FLAGS "--annotate")

rapids_cython_create_modules(
CXX
SOURCE_FILES "${cython_sources}"
LINKED_LIBRARIES "${linked_libraries}" MODULE_PREFIX pylibcudf_strings_ ASSOCIATED_TARGETS cudf
CYTHON_FLAGS "${CYTHON_FLAGS}" # Pass the annotate flag to cython
)
4 changes: 4 additions & 0 deletions python/pylibcudf/pylibcudf/strings/split/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@

set(cython_sources partition.pyx split.pyx)

# Set the Cython flags to include annotation
set(CYTHON_FLAGS "--annotate")

set(linked_libraries cudf::cudf)
rapids_cython_create_modules(
CXX
SOURCE_FILES "${cython_sources}"
LINKED_LIBRARIES "${linked_libraries}" MODULE_PREFIX pylibcudf_strings_ ASSOCIATED_TARGETS cudf
CYTHON_FLAGS "${CYTHON_FLAGS}" # Pass the annotate flag to cython
)
16 changes: 6 additions & 10 deletions python/pylibcudf/pylibcudf/strings/split/partition.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ cpdef Table partition(Column input, Scalar delimiter=None):
)

with nogil:
c_result = move(
cpp_partition.partition(
input.view(),
dereference(c_delimiter)
)
c_result = cpp_partition.partition(
input.view(),
dereference(c_delimiter)
)

return Table.from_libcudf(move(c_result))
Expand Down Expand Up @@ -85,11 +83,9 @@ cpdef Table rpartition(Column input, Scalar delimiter=None):
)

with nogil:
c_result = move(
cpp_partition.rpartition(
input.view(),
dereference(c_delimiter)
)
c_result = cpp_partition.rpartition(
input.view(),
dereference(c_delimiter)
)

return Table.from_libcudf(move(c_result))

0 comments on commit 1afa0b9

Please sign in to comment.