parameters: (fd, overload)
return_statement: return nb_guards
docstring: Emits guards according the function type.
      Returns the number of emitted guards.
docstring_summary: Emits guards according the function type.
      Returns the number of emitted guards.
docstring_tokens: Emits guards according the function type . Returns the number of emitted guards .
function: def emit_guards(fd, overload):
      """
      Emits guards according the function type.
      Returns the number of emitted guards.
      """
      requires_half = overload_requires_fp16(overload)
      requires_double = overload_requires_fp64(overload)
      nb_guards = 0
      if requires_half:
          nb_guards += 1
          fd.write("#ifdef cl_khr_fp16\n")
      if requires_double:
          nb_guards += 1
          fd.write("#ifdef cl_khr_fp64\n")
      return nb_guards
function_tokens: def emit_guards ( fd , overload ) : requires_half = overload_requires_fp16 ( overload ) requires_double = overload_requires_fp64 ( overload ) nb_guards = 0 if requires_half : nb_guards += 1 fd . write ( "#ifdef cl_khr_fp16\n" ) if requires_double : nb_guards += 1 fd . write ( "#ifdef cl_khr_fp64\n" ) return nb_guards