add env var CUPY_CUB_BLOCK_REDUCTION_DISABLED
@@ -65,5 +65,8 @@ from cupy.core.raw import RawModule # NOQA
# Whether to use reduction kernels based on cub::BlockReduce
-# TODO(leofang): do we want an env var to control this?
+import os
+cub_block_reduction_enabled = False
+if int(os.getenv('CUPY_CUB_BLOCK_REDUCTION_DISABLED', 1)) == 0:
cub_block_reduction_enabled = True
+del os
