code: def test_LRU_cache5(self):
      # test if the LRU cache is thread-local
  
      def init_caches(gpus):
          for i in gpus:
              with device.Device(i):
                  config.get_plan_cache()
  
      # Testing in the current thread: in setUp() we ensure all caches
      # are initialized
      stdout = intercept_stdout(config.show_plan_cache_info)
      assert "uninitialized" not in stdout
  
      def thread_show_plan_cache_info(queue):
          # allow output from another thread to be accessed by the
          # main thread
          cupy.cuda.Device().use()
          stdout = intercept_stdout(config.show_plan_cache_info)
          queue.put(stdout)
  
      # When starting a new thread, the cache is uninitialized there
      # (for both devices)
      q = queue.Queue()
      thread = threading.Thread(
          target=thread_show_plan_cache_info, args=(q,)
      )
      thread.start()
      thread.join()
      stdout = q.get()
      assert stdout.count("uninitialized") == n_devices
  
      def thread_init_caches(gpus, queue):
          cupy.cuda.Device().use()
          init_caches(gpus)
          thread_show_plan_cache_info(queue)
  
      # Now let's try initializing device 0 on another thread
      thread = threading.Thread(
          target=thread_init_caches,
          args=(
              [0],
              q,
          ),
      )
      thread.start()
      thread.join()
      stdout = q.get()
      assert stdout.count("uninitialized") == n_devices - 1
  
      # ...and this time both devices
      thread = threading.Thread(
          target=thread_init_caches,
          args=(
              [0, 1],
              q,
          ),
      )
      thread.start()
      thread.join()
      stdout = q.get()
      assert stdout.count("uninitialized") == n_devices - 2
  
imports: import contextlib
  import io
  import queue
  import threading
  import unittest
  import pytest
  import cupy
  from cupy import testing
  from cupy.cuda import cufft
  from cupy.cuda import device
  from cupy.cuda import runtime
  from cupy.fft import config
  from .test_fft import multi_gpu_config, _skip_multi_gpu_bug
label_desc: Use image node_id 7 for calling the TestPlanCache obj's underlying member method code with example usage: obj.test_LRU_cache5() without return types