code: def merge_opencl_binaries(opencl_binaries, output_file):
      platform_info_key = "mace_opencl_precompiled_platform_info_key"
  
      kvs = {}
      for binary in opencl_binaries:
          if not os.path.exists(binary):
              MaceLogger.warning("OpenCL bin %s not found" % binary)
              continue
  
          with open(binary, "rb") as f:
              binary_array = np.fromfile(f, dtype=np.uint8)
  
          idx = 0
          (size,) = struct.unpack("Q", binary_array[idx : idx + 8])
          idx += 8
          for _ in range(size):
              (key_size,) = struct.unpack(
                  "i", binary_array[idx : idx + 4]
              )
              idx += 4
              (key,) = struct.unpack(
                  str(key_size) + "s",
                  binary_array[idx : idx + key_size],
              )
              idx += key_size
              (value_size,) = struct.unpack(
                  "i", binary_array[idx : idx + 4]
              )
              idx += 4
              if key == platform_info_key and key in kvs:
                  mace_check(
                      (
                          kvs[key]
                          == binary_array[idx : idx + value_size]
                      ).all(),
                      "There exists more than one OpenCL version for models:"
                      " %s vs %s "
                      % (
                          kvs[key],
                          binary_array[idx : idx + value_size],
                      ),
                  )
              else:
                  kvs[key] = binary_array[idx : idx + value_size]
              idx += value_size
  
      output_byte_array = bytearray()
      data_size = len(kvs)
      output_byte_array.extend(struct.pack("Q", data_size))
      for key, value in kvs.items():
          key_size = len(key)
          output_byte_array.extend(struct.pack("i", key_size))
          output_byte_array.extend(
              struct.pack(str(key_size) + "s", key)
          )
          value_size = len(value)
          output_byte_array.extend(struct.pack("i", value_size))
          output_byte_array.extend(value)
  
      np.array(output_byte_array).tofile(output_file)
  
file_path: mace/tools/python/gen_opencl.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import jinja2
  import os
  import struct
  import numpy
  from utils import util
  from utils.util import MaceLogger
  from utils.util import mace_check
label_desc: Use image node_id 2 for calling a global function with example usage: merge_opencl_binaries(opencl_binaries, output_file) without return types