3.4.3.1. Versions
3.4.3.1. 版本
A version number comprises three logical fields:
版本号包括三个逻辑字段:
-
The major version indicates a significant change. Backwards compatibility may break across major versions.
-
主要版本表示发生了重大变化。向后兼容性可能会破坏主要版本。
-
The minor version indicates the addition of new functionality with backwards compatibility for any existing profiles.
-
次要版本表示添加了与任何现有配置文件向后兼容的新功能。
-
The patch version indicates bug fixes, clarifications and general improvements.
-
补丁版本指示错误修复、澄清和一般改进。
Version numbers are represented using the cl_version type that is an alias for a 32-bit integer. The fields are packed as follows:
版本号使用cl_Version类型表示,该类型是32位整数的别名。字段打包如下:
-
The major version is a 10-bit integer packed into bits 31-22.
-
主要版本是一个10位整数,它被打包成31-22位。
-
The minor version is a 10-bit integer packed into bits 21-12.
-
次要版本是一个10位整数,它被打包成21-12位。
-
The patch version is a 12-bit integer packed into bits 11-0.
-
修补程序版本是一个12位整数,它被打包为位11-0。
This enables versions to be ordered using standard C/C++ operators.
这使得可以使用标准C/C++运算符对版本进行排序。
A number of convenience macros are provided by the OpenCL Headers to make working with version numbers easier.
OpenCL Headers提供了许多方便的宏,使使用版本号变得更容易。
CL_VERSION_MAJOR extracts the major version from a packed cl_version.
CL_VERSION_MAJOR从压缩的cl_version中提取主要版本。
CL_VERSION_MINOR extracts the minor version from a packed cl_version.
CL_VERSION_MINOR从打包的cl_version中提取次要版本。
CL_VERSION_PATCH extracts the patch version from a packed cl_version.
CL_VERSION_PATCH从打包的cl_version中提取修补程序版本。
CL_MAKE_VERSION returns a packed cl_version from a major, minor and patch version.
CL_MAKE_VERSION从主要、次要和修补程序版本返回压缩的cl_version。
These are defined as follows:
这些定义如下:
typedef cl_uint cl_version;
#define CL_VERSION_MAJOR_BITS (10)
#define CL_VERSION_MINOR_BITS (10)
#define CL_VERSION_PATCH_BITS (12)
#define CL_VERSION_MAJOR_MASK ((1 << CL_VERSION_MAJOR_BITS) - 1)
#define CL_VERSION_MINOR_MASK ((1 << CL_VERSION_MINOR_BITS) - 1)
#define CL_VERSION_PATCH_MASK ((1 << CL_VERSION_PATCH_BITS) - 1)
#define CL_VERSION_MAJOR(version) \
((version) >> (CL_VERSION_MINOR_BITS + CL_VERSION_PATCH_BITS))
#define CL_VERSION_MINOR(version) \
(((version) >> CL_VERSION_PATCH_BITS) & CL_VERSION_MINOR_MASK)
#define CL_VERSION_PATCH(version) ((version) & CL_VERSION_PATCH_MASK)
#define CL_MAKE_VERSION(major, minor, patch) \
((((major) & CL_VERSION_MAJOR_MASK) << \
(CL_VERSION_MINOR_BITS + CL_VERSION_PATCH_BITS)) | \
(((minor) & CL_VERSION_MINOR_MASK) << \
CL_VERSION_PATCH_BITS) | \
((patch) & CL_VERSION_PATCH_MASK))
468




被折叠的 条评论
为什么被折叠?



