code: def test_specialize(mode):
      counter = 0
  
      def inc_counter(*args, **kwargs):
          nonlocal counter
          counter += 1
  
      JITFunction.cache_hook = inc_counter
      reset_tmp_dir()
      x = torch.empty(1, dtype=torch.int32, device="cuda")
      function = {"enable": kernel, "disable": kernel_nospec}[mode]
      target = {"enable": 4, "disable": 1}[mode]
      for i in [1, 2, 4, 8, 16, 32]:
          function[(1,)](x, i, BLOCK=512)
      assert counter == target
  
imports: import importlib.util
  import os
  import shutil
  import tempfile
  import pytest
  import torch
  import triton
  import triton.language
  from triton.runtime.jit import JITFunction
label_desc: Use image node_id 13 for calling a global function with example usage: test_specialize(mode) without return types