5.8.6.1. Preprocessor Options
5.8.6.1. 预处理器选项
These options control the OpenCL C/C++ preprocessor which is run on each program source before actual compilation. These options are ignored for programs created with IL.
这些选项控制OpenCL C/C++预处理器,该预处理器在实际编译之前在每个程序源上运行。对于使用IL创建的程序,这些选项将被忽略。
-D name
Predefine name as a macro, with definition 1.
将名称预定义为宏,定义为1。
-D name=definition
The contents of definition are tokenized and processed as if they appeared during translation phase three in a #define
directive. In particular, the definition will be truncated by embedded newline characters.
定义的内容被标记和处理,就像它们出现在#define指令的翻译阶段三一样。特别是,定义将被嵌入的换行符截断。
-D
options are processed in the order they are given in the options argument to clBuildProgram or clCompileProgram. Note that a space is required between the -D
option and the symbol it defines, otherwise behavior is implementation-defined.
-D选项按照clBuildProgram或clCompileProgram的options参数中给出的顺序进行处理。请注意,-D选项和它定义的符号之间需要一个空格,否则行为将由实现定义。
-I dir
Add the directory dir to the list of directories to be searched for header files. dir can optionally be enclosed in double quotes.
将目录dir添加到要搜索头文件的目录列表中。dir可以选择用双引号括起来。
This option is not portable due to its dependency on host file system and host operating system. It is supported for backwards compatibility with previous OpenCL versions. Developers are encouraged to create and use explicit header objects by means of clCompileProgram followed by clLinkProgram.
此选项不可移植,因为它依赖于主机文件系统和主机操作系统。它支持与以前的OpenCL版本向后兼容。鼓励开发人员通过clCompileProgram和clLinkProgram创建和使用显式头对象。