Skip to content

Commit

Permalink
Run pre-commit checks and update accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
NaderAlAwar committed Jan 9, 2025
1 parent c11e416 commit 0a6bf9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def CacheModifiedInputIterator(device_array, modifier):
modifier: The PTX cache load modifier
Returns:
A ``CacheModifiedInputIterator`` object intialized with ``device_array``
A ``CacheModifiedInputIterator`` object initialized with ``device_array``
"""
if modifier != "stream":
raise NotImplementedError("Only stream modifier is supported")
Expand Down
11 changes: 7 additions & 4 deletions python/cuda_parallel/tests/test_reduce_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception


def test_device_reduce():
# example-begin reduce-min
import cupy as cp
Expand Down Expand Up @@ -133,7 +134,9 @@ def add_op(a, b):
# Run reduction
reduce_into(d_temp_storage, first_it, d_output, num_items, h_init)

expected_output = functools.reduce(lambda a, b: a + b, range(first_item, first_item + num_items))
expected_output = functools.reduce(
lambda a, b: a + b, range(first_item, first_item + num_items)
)
assert (d_output == expected_output).all()
# example-end counting-iterator

Expand All @@ -152,7 +155,7 @@ def add_op(a, b):
return a + b

def square_op(a):
return a ** 2
return a**2

first_item = 10
num_items = 3
Expand All @@ -173,7 +176,7 @@ def square_op(a):
reduce_into(d_temp_storage, transform_it, d_output, num_items, h_init)

expected_output = functools.reduce(
lambda a, b: a + b, [a ** 2 for a in range(first_item, first_item + num_items)]
lambda a, b: a + b, [a**2 for a in range(first_item, first_item + num_items)]
)
assert (d_output == expected_output).all()
# example-end transform-iterator
# example-end transform-iterator

0 comments on commit 0a6bf9e

Please sign in to comment.