code: def test_device_function_called_once(self):
      @jit.rawkernel(device=True)
      def g(x):
          x[0] += 1
          return 1
  
      @jit.rawkernel()
      def f(x):
          x[g(x)] += 1
  
      x = cupy.array([0, 0])
      f((1,), (1,), (x,))
      testing.assert_array_equal(x, [1, 1])
  
file_path: cupy/tests/cupyx_tests/jit_tests/test_device_function.py
imports: import unittest
  import numpy
  import pytest
  import cupy
  from cupyx import jit
  from cupy import testing
label_desc: Use image node_id 5 for calling the TestDeviceFunction obj's underlying member method code with example usage: obj.test_device_function_called_once() and returns: int