// Copyright (c) 2010 Advanced Micro Devices, Inc. All rights reserved. // /* * Description: * * This is the file that contains definitions of all options to clBuildProgram(). * And any changes to option (add/remove/modify) should be done here. This option * processing is thread-safe, that is, each option is not implemented as a static * variable that is assessible to all threads but as a local variable that is * accessible only to its definining thread. For example, * * option::Options localOptions; * option::parseAllOptions(cppstr, localOptions); * * where 'localOptions' is an option object that contains all option variables and any * code that needs to access the option has to do so via 'localOptions'. (That is why * 'localOptions' has been passed down to many parts that need to access option * variables.) For instance, the following will be used to check if -g is present: * * if (localOptions.oVariables->EnableDebug) { * <-g is present>; * } * * * MACROS for making changes to this file: * * Two macros : OPTION for runtime options that have option variables and NOPTION for others * that do Not have option variables. The OPTION are ones that are referenced by the runtime * via their option variables like the one shown above. The NOPTION are ones that are either * passed into component option processors directly, or alias runtime options. An alias runtime * option is one that refers to another option or a group of others and has no corresponding * option variable in the above option object. For example, * -D NAME= is passed into the front end and the runtime has no variable for it in the * above option object. Another example is -cl-opt-disable, which is a runtime alias option. * It is equivalent to -O0 and used to set -O0. It has no variable in the option object either. * * Here are these two macros: * OPTION(type, attr, sn, ln, var, ideft, imix, imax, sdeft, desc) * NOPTION(type, attr, sn, ln, var, ideft, imix, imax, sdeft, desc) * * For convenience, FLAG marco is provided as well. FLAG macro is very close to a flag * used in flags.hpp. It is define as below: * FLAG(type, vis, sn, var, deft, desc) * * type: option type defined as OptionType enum: * OT_BOOL : bool * OT_INT32 : int32 * OT_UINT32 : uint32 * OT_CSTRING : char* * OT_uCHAR : unsigned char * * attr: option attributes, divided in several groups: * OptionValue : value attribute. Use exactly one. * OVA_OPTIONAL : value is optional * OVA_REQUIRED : value is required to appear * OVA_DISALLOWED : value may not be specified * * OptionForm : form attribute. Use exactly one. * OFA_NORMAL : normal form, no prefix * OFA_PREFIX_F : -f, machine-independent (-f[no-]