-
Notifications
You must be signed in to change notification settings - Fork 886
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'branch-24.12' into fea-pinned-aware-device_scalar
- Loading branch information
Showing
38 changed files
with
1,262 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
docs/cudf/source/user_guide/api_docs/pylibcudf/strings/find_multiple.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
============= | ||
find_multiple | ||
============= | ||
|
||
.. automodule:: pylibcudf.strings.find_multiple | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,12 @@ strings | |
contains | ||
extract | ||
find | ||
find_multiple | ||
findall | ||
regex_flags | ||
regex_program | ||
repeat | ||
replace | ||
slice | ||
split | ||
strip |
6 changes: 6 additions & 0 deletions
6
docs/cudf/source/user_guide/api_docs/pylibcudf/strings/split.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
===== | ||
split | ||
===== | ||
|
||
.. automodule:: pylibcudf.strings.split | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,20 @@ | ||
# Copyright (c) 2020-2024, NVIDIA CORPORATION. | ||
|
||
from libcpp.memory cimport unique_ptr | ||
from libcpp.utility cimport move | ||
|
||
from cudf.core.buffer import acquire_spill_lock | ||
|
||
from pylibcudf.libcudf.column.column cimport column | ||
from pylibcudf.libcudf.column.column_view cimport column_view | ||
from pylibcudf.libcudf.strings.find_multiple cimport ( | ||
find_multiple as cpp_find_multiple, | ||
) | ||
|
||
from cudf._lib.column cimport Column | ||
|
||
import pylibcudf as plc | ||
|
||
|
||
@acquire_spill_lock() | ||
def find_multiple(Column source_strings, Column target_strings): | ||
""" | ||
Returns a column with character position values where each | ||
of the `target_strings` are found in each string of `source_strings`. | ||
""" | ||
cdef unique_ptr[column] c_result | ||
cdef column_view source_view = source_strings.view() | ||
cdef column_view target_view = target_strings.view() | ||
|
||
with nogil: | ||
c_result = move(cpp_find_multiple( | ||
source_view, | ||
target_view | ||
)) | ||
|
||
return Column.from_unique_ptr(move(c_result)) | ||
plc_result = plc.strings.find_multiple.find_multiple( | ||
source_strings.to_pylibcudf(mode="read"), | ||
target_strings.to_pylibcudf(mode="read") | ||
) | ||
return Column.from_pylibcudf(plc_result) |
Oops, something went wrong.