def get_cpu_optimization_flags(compiler, version='9999'):
  """Return the CPU optimization flags for the target and compiler
  combination.

  # Arguments

  compiler: A compiler family string recognized by archspec.

  version: The version of the compiler.  The default version is
  `9999`, i.e., assume the compiler supports the latest optimization
  flags.
  """
  this = sys.modules[__name__]

  if not this.g_cpu_target:
    return None

  if this.g_cpu_target not in archspec.cpu.TARGETS:
    logging.warning('unrecognized CPU target "{}"'.format(this.g_cpu_target))
    return None

  try:
    return archspec.cpu.TARGETS[this.g_cpu_target].optimization_flags(compiler, version)
  except Exception as e:
    logging.warning('get_cpu_optimization_flags: {}'.format(e))

  return None
Return the CPU optimization flags for the target and compiler
  combination.

  # Arguments

  compiler: A compiler family string recognized by archspec.

  version: The version of the compiler.  The default version is
  `9999`, i.e., assume the compiler supports the latest optimization
  flags.
  
hpccm/config.py