class_docstr: tests for magma functions
      
docstr: test geev for eigenvalues only
  dtype: s, d, c, z
docstr_tok: ["test","geev","for","eigenvalues","only","dtype",":","s",",","d",",","c",",","z"]
code: def _test_magma_geev_novecs(self, type_key, jobvl, jobvr):
      """
      test geev for eigenvalues only
      dtype: s, d, c, z
      """
      dtype = TYPEDICT[type_key]
      dtype_float = np.float32 if type_key in ["s", "c"] else np.float64
  
      mat = np.random.rand(self.N * self.N)
      if type_key in ["c", "z"]:
          mat = mat + 1j * np.random.rand(self.N * self.N)
  
      mat = mat.astype(dtype).reshape((self.N, self.N), order="F")
      mat_numpy = mat.copy()  # cpu
  
      if type_key in ["s", "d"]:
          wr = np.zeros((self.N,), dtype=dtype)
          wi = np.zeros((self.N,), dtype=dtype)
      else:
          w = np.zeros((self.N,), dtype=dtype)
  
      vl = (
          np.zeros((1, 1), dtype=dtype)
          if jobvl == "N"
          else np.zeros((self.N, self.N), dtype=dtype)
      )
      vr = (
          np.zeros((1, 1), dtype=dtype)
          if jobvr == "N"
          else np.zeros((self.N, self.N), dtype=dtype)
      )
  
      if type_key == "s":
          nb = magma.magma_get_sgeqrf_nb(self.N, self.N)
      elif type_key == "d":
          nb = magma.magma_get_dgeqrf_nb(self.N, self.N)
      elif type_key == "c":
          nb = magma.magma_get_cgeqrf_nb(self.N, self.N)
      elif type_key == "z":
          nb = magma.magma_get_zgeqrf_nb(self.N, self.N)
  
      lwork = self.N * (1 + 2 * nb)
      work = np.zeros((lwork,), dtype=dtype)
      if type_key in ["c", "z"]:
          rwork = np.zeros((2 * self.N,), dtype=dtype_float)
  
      if type_key == "s":
          magma.magma_sgeev(
              jobvl,
              jobvr,
              self.N,
              mat.ctypes.data,
              self.N,
              wr.ctypes.data,
              wi.ctypes.data,
              vl.ctypes.data,
              vl.shape[0],
              vr.ctypes.data,
              vr.shape[0],
              work.ctypes.data,
              lwork,
          )
      elif type_key == "d":
          magma.magma_dgeev(
              jobvl,
              jobvr,
              self.N,
              mat.ctypes.data,
              self.N,
              wr.ctypes.data,
              wi.ctypes.data,
              vl.ctypes.data,
              vl.shape[0],
              vr.ctypes.data,
              vr.shape[0],
              work.ctypes.data,
              lwork,
          )
      elif type_key == "c":
          magma.magma_cgeev(
              jobvl,
              jobvr,
              self.N,
              mat.ctypes.data,
              self.N,
              w.ctypes.data,
              vl.ctypes.data,
              vl.shape[0],
              vr.ctypes.data,
              vr.shape[0],
              work.ctypes.data,
              lwork,
              rwork.ctypes.data,
          )
  
      elif type_key == "z":
          magma.magma_zgeev(
              jobvl,
              jobvr,
              self.N,
              mat.ctypes.data,
              self.N,
              w.ctypes.data,
              vl.ctypes.data,
              vl.shape[0],
              vr.ctypes.data,
              vr.shape[0],
              work.ctypes.data,
              lwork,
              rwork.ctypes.data,
          )
  
      if type_key in ["s", "d"]:
          if np.allclose(wi, np.zeros(wi.shape[0])):
              # if w is real
              w_magma = np.sort(wr)
          else:
              w_magma = np.sort(wr + 1j * wi)
      else:
          w_magma = np.sort(w)
  
      w_numpy = np.sort(np.linalg.eigvals(mat_numpy))
  
      assert_allclose(
          w_numpy,
          w_magma,
          rtol=DTYPE_TO_RTOL[dtype],
          atol=DTYPE_TO_ATOL[dtype],
      )
  
file_path: scikit-cuda/tests/test_magma.py
imports: from unittest import main, TestCase, TestSuite
  import numpy
  from numpy.testing import assert_allclose
  from pycuda.tools import clear_context_caches, make_default_context
  import skcuda.magma
label_desc: Use image node_id 4 for calling the test_magma obj's underlying member method code with example usage: obj._test_magma_geev_novecs(type_key, jobvl, jobvr) without return types