class_docstr: Tests just-in-time cpp extensions.
  Don't confuse this with the PyTorch JIT (aka TorchScript).
docstr: Checks for an issue with operator< ambiguity for half when certain
  THC headers are included.
  
  See https://github.com/pytorch/pytorch/pull/10301#issuecomment-416773333
  for the corresponding issue.
docstr_tok: ["Checks","for","an","issue","with","operator","<","ambiguity","for","half","when","certain","THC","headers","are","included",".","See","https",":","\/\/github.com\/pytorch\/pytorch\/pull\/10301","#","issuecomment-416773333","for","the","corresponding","issue","."]
code: def test_half_support(self):
      """
      Checks for an issue with operator< ambiguity for half when certain
      THC headers are included.
  
      See https://github.com/pytorch/pytorch/pull/10301#issuecomment-416773333
      for the corresponding issue.
      """
      cuda_source = """
          template<typename T, typename U>
          __global__ void half_test_kernel(const T* input, U* output) {
              if (input[0] < input[1] || input[0] >= input[1]) {
                  output[0] = 123;
              }
          }
  
          torch::Tensor half_test(torch::Tensor input) {
              auto output = torch::empty(1, input.options().dtype(torch::kFloat));
              AT_DISPATCH_FLOATING_TYPES_AND_HALF(input.scalar_type(), "half_test", [&] {
                  half_test_kernel<scalar_t><<<1, 1>>>(
                      input.data<scalar_t>(),
                      output.data<float>());
              });
              return output;
          }
          """
  
      module = torch.utils.cpp_extension.load_inline(
          name="half_test_extension",
          cpp_sources="torch::Tensor half_test(torch::Tensor input);",
          cuda_sources=cuda_source,
          functions=["half_test"],
          verbose=True,
      )
  
      x = torch.randn(3, device="cuda", dtype=torch.half)
      result = module.half_test(x)
      self.assertEqual(result[0], 123)
  
imports: import os
  import shutil
  import sys
  import unittest
  import warnings
  import re
  import tempfile
  import subprocess
  import glob
  import torch.testing._internal.common_utils
  from torch.testing._internal.common_cuda import TEST_CUDNN, TEST_CUDA
  import torch
  import torch.backends.cudnn
  import torch.utils.cpp_extension
  from torch.utils.cpp_extension import CUDA_HOME, ROCM_HOME
  from torch.testing._internal.common_utils import gradcheck
  import torch.multiprocessing
  from torch.utils.cpp_extension import _TORCH_PATH, remove_extension_h_precompiler_headers, get_cxx_compiler, check_compiler_is_gcc
label_desc: Use image node_id 18 for calling the TestCppExtensionJIT obj's underlying member method code with example usage: obj.test_half_support() without return types