Skip to content

Commit

Permalink
Merge branch 'feature/diff-non-numeric' of https://github.com/Matt711…
Browse files Browse the repository at this point in the history
…/cudf into feature/diff-non-numeric
  • Loading branch information
Matt711 committed Apr 14, 2022
2 parents 1eee122 + 9e1655d commit 1f729ad
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -9168,7 +9168,7 @@ def test_diff_many_dtypes():
{
"dates": pd.date_range("2020-01-01", "2020-01-06", freq="D"),
"bools": [True, True, True, False, True, True],
"floats": [1.0, 2.0, 3.5, 4.0, 5.0, -1.7],
"floats": [1.0, 2.0, 3.5, np.nan, 5.0, -1.7],
"ints": [1, 2, 3, 3, 4, 5],
"nans_nulls": [np.nan, None, None, np.nan, np.nan, None],
}
Expand Down
21 changes: 0 additions & 21 deletions python/cudf/cudf/utils/cudautils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,6 @@
#


@cuda.jit
def gpu_diff(in_col, out_col, out_mask, N):
"""Calculate the difference between values at positions i and i - N in an
array and store the output in a new array.
"""
i = cuda.grid(1)

if N > 0:
if i < in_col.size:
out_col[i] = in_col[i] - in_col[i - N]
out_mask[i] = True
if i < N:
out_mask[i] = False
else:
if i <= (in_col.size + N):
out_col[i] = in_col[i] - in_col[i - N]
out_mask[i] = True
if i >= (in_col.size + N) and i < in_col.size:
out_mask[i] = False


# Find segments


Expand Down

0 comments on commit 1f729ad

Please sign in to comment.