Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable custom 2D separable filtering kernels on windows #770

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""A vendored subset of cupyx.scipy.ndimage._filters"""
import math
import platform
import warnings

import cupy
Expand All @@ -22,6 +23,8 @@
except ImportError:
compile_errors = (ResourceLimitError,)

_is_not_windows = platform.system() != "Windows"


def correlate(input, weights, output=None, mode="reflect", cval=0.0, origin=0):
"""Multi-dimensional correlate.
Expand Down Expand Up @@ -231,7 +234,7 @@ def _correlate_or_convolve1d(
default_algorithm = False
if algorithm is None:
default_algorithm = True
if input.ndim == 2 and weights.size <= 256:
if _is_not_windows and input.ndim == 2 and weights.size <= 256:
algorithm = "shared_memory"
else:
algorithm = "elementwise"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import platform

import cupy as cp
import pytest

Expand Down Expand Up @@ -227,6 +229,13 @@ def test_separable_image_shapes_and_modes(shape, axis, kernel_size, mode):
)


@pytest.mark.skipif(
platform.system() == "Windows",
reason=(
"custom separable kernels disabled on Windows until dtype-related "
"test failures can be resolved"
),
)
@pytest.mark.parametrize("axis", (0, 1))
@pytest.mark.parametrize("image_dtype", image_dtypes_tested)
@pytest.mark.parametrize(
Expand All @@ -246,6 +255,13 @@ def test_separable_image_and_kernel_dtypes(axis, image_dtype, kernel_dtype):
)


@pytest.mark.skipif(
platform.system() == "Windows",
reason=(
"custom separable kernels disabled on Windows until dtype-related "
"test failures can be resolved"
),
)
@pytest.mark.parametrize("axis", (0, 1))
@pytest.mark.parametrize("image_dtype", image_dtypes_tested)
@pytest.mark.parametrize(
Expand Down