/* Copyright (c) 2010 - 2021 Advanced Micro Devices, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* * 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-]