Skip to content

Commit 28013a0

Browse files
committed
Add missing config.DISABLE_PERFORMANCE_WARNINGS checks
Fix a few functions that raise a NumbaPerformanceWarning` without checking whether `config.DISABLE_PERFORMANCE_WARNINGS` is set.
1 parent bb31021 commit 28013a0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

numba_cuda/numba/cuda/cudadrv/devicearray.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,10 @@ def auto_device(obj, stream=0, copy=True, user_explicit=False):
876876
sentry_contiguous(obj)
877877
devobj = from_array_like(obj, stream=stream)
878878
if copy:
879-
if config.CUDA_WARN_ON_IMPLICIT_COPY:
879+
if (
880+
config.CUDA_WARN_ON_IMPLICIT_COPY
881+
and not config.DISABLE_PERFORMANCE_WARNINGS
882+
):
880883
if (
881884
not user_explicit and
882885
(not isinstance(obj, DeviceNDArray)

numba_cuda/numba/cuda/dispatcher.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,10 @@ def __init__(self, dispatcher, griddim, blockdim, stream, sharedmem):
519519
self.stream = stream
520520
self.sharedmem = sharedmem
521521

522-
if config.CUDA_LOW_OCCUPANCY_WARNINGS:
522+
if (
523+
config.CUDA_LOW_OCCUPANCY_WARNINGS
524+
and not config.DISABLE_PERFORMANCE_WARNINGS
525+
):
523526
# Warn when the grid has fewer than 128 blocks. This number is
524527
# chosen somewhat heuristically - ideally the minimum is 2 times
525528
# the number of SMs, but the number of SMs varies between devices -

0 commit comments

Comments
 (0)