code: def test_setup_with_cuda_stream(cuda_stream_mock, *_):
      model = torch.nn.Linear(2, 2)
      strategy = DDPStrategy(
          parallel_devices=[torch.device("cpu")],
          cluster_environment=LightningEnvironment(),
      )
      strategy.setup_module(model)
      cuda_stream_mock.assert_not_called()
  
      strategy = DDPStrategy(
          parallel_devices=[torch.device("cuda", 0)],
          cluster_environment=LightningEnvironment(),
      )
      strategy.setup_module(model)
      cuda_stream_mock.assert_called_once()
  
imports: import os
  from copy import deepcopy
  from datetime import timedelta
  from unittest import mock
  from unittest.mock import MagicMock, Mock
  import pytest
  import torch
  from lightning.fabric.plugins import DoublePrecision, HalfPrecision, Precision
  from lightning.fabric.plugins.environments import LightningEnvironment
  from lightning.fabric.strategies import DDPStrategy
  from lightning.fabric.strategies.ddp import _DDPBackwardSyncControl
  from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_2_0
  from torch.nn.parallel import DistributedDataParallel
  from tests_fabric.helpers.runif import RunIf
label_desc: Use image node_id 6 for calling a global function with example usage: test_setup_with_cuda_stream(cuda_stream_mock) without return types