code: def total_mem_on_dev(
      device: Union[ivy.Device, ivy.NativeDevice], /
  ) -> float:
      """Get the total amount of memory (in GB) for a given device string. In
      case of CPU, the total RAM is returned.
  
      Parameters
      ----------
      device
          The device string to convert to native device handle.
  
      Returns
      -------
      ret
          The total memory on the device in GB.
  
      Examples
      --------
      >>> x = ivy.total_mem_on_dev("cpu")
      >>> print(x)
      53.66700032
  
      >>> x = ivy.total_mem_on_dev("gpu:0")
      >>> print(x)
      8.589934592
      """
      if "gpu" in device:
          handle = _get_nvml_gpu_handle(device)
          info = pynvml.nvmlDeviceGetMemoryInfo(handle)
          return info.total / 1e9
      elif device == "cpu":
          return psutil.virtual_memory().total / 1e9
      else:
          raise ivy.utils.exceptions.IvyException(
              'Invalid device string input, must be on the form "gpu:idx" or "cpu", but'
              f" found {device}"
          )
  
imports: import os
  import gc
  import abc
  import math
  import psutil
  import warnings
  import types
  from typing import Type, Optional, Tuple
  from typing import Union, Callable, Iterable, Any
  import ivy
  from ivy.func_wrapper import handle_out_argument, to_native_arrays_and_back, inputs_to_native_arrays, handle_nestable, handle_array_like_without_promotion, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 13 for calling a global function with example usage: total_mem_on_dev() and returns: unknown, unknown