Skip to content

Commit

Permalink
Merge pull request #81 from rapidsai/branch-21.08
Browse files Browse the repository at this point in the history
[gpuCI] Forward-merge branch-21.08 to branch-21.10 [skip gpuci]
  • Loading branch information
GPUtester authored Jul 28, 2021
2 parents 21007fd + f421e79 commit 6cd95fc
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions python/cucim/src/cucim/skimage/measure/_label_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,10 @@ def _label(x, structure, y, greyscale_mode=False):
y_shape = cupy.array(y.shape, dtype=numpy.int32)
count = cupy.zeros(2, dtype=numpy.int32)
_kernel_init()(x, y)
try:
int_t = int_types[y.dtype.char]
except KeyError:
raise ValueError("y must have int32, uint16, uint32 or uint64 dtype")
if int_t != "int":
raise NotImplementedError(
"Currently only 32-bit integer case is implemented"
)
if greyscale_mode:
_kernel_connect(True, int_t)(
x, y_shape, dirs, ndirs, x.ndim, y, size=y.size
)
_kernel_connect(True)(x, y_shape, dirs, ndirs, x.ndim, y, size=y.size)
else:
_kernel_connect(False, int_t)(
y_shape, dirs, ndirs, x.ndim, y, size=y.size
)
_kernel_connect(False)(y_shape, dirs, ndirs, x.ndim, y, size=y.size)
_kernel_count()(y, count, size=y.size)
maxlabel = int(count[0]) # synchronize
labels = cupy.empty(maxlabel, dtype=numpy.int32)
Expand Down Expand Up @@ -184,11 +172,3 @@ def _kernel_finalize():
""",
"cucim_skimage_measure_label_finalize",
)


int_types = {
"i": "int",
"H": "unsigned short",
"I": "unsigned int",
"L": "unsigned long long",
}

0 comments on commit 6cd95fc

Please sign in to comment.