3.2.5. Categories of Kernels
3.2.5.内核类别
The OpenCL execution model supports three types of kernels:
OpenCL执行模型支持三种类型的内核:
-
OpenCL kernels are managed by the OpenCL API as kernel objects associated with kernel functions within program objects. OpenCL program objects are created and built using OpenCL APIs. The OpenCL API includes functions to query the kernel languages and and intermediate languages that may be used to create OpenCL program objects for a device.
-
OpenCL内核由OpenCL API作为与程序对象中的内核函数相关联的内核对象进行管理。OpenCL程序对象是使用OpenCLAPI创建和构建的。OpenCL API包括查询内核语言和可用于为设备创建OpenCL程序对象的中间语言的函数。
-
Native kernels are accessed through a host function pointer. Native kernels are queued for execution along with OpenCL kernels on a device and share memory objects with OpenCL kernels. For example, these native kernels could be functions defined in application code or exported from a library. The ability to execute native kernels is optional within OpenCL and the semantics of native kernels are implementation-defined. The OpenCL API includes functions to query capabilities of a device to determine if this capability is supported.
-
通过主机函数指针访问本机内核。本机内核与设备上的OpenCL内核一起排队等待执行,并与OpenCL内核共享内存对象。例如,这些原生内核可以是应用程序代码中定义的函数,也可以是从库中导出的函数。在OpenCL中,执行本地内核的能力是可选的,并且本地内核的语义是由实现定义的。OpenCL API包括查询设备功能以确定是否支持该功能的功能。
-
Built-in kernels are tied to particular device and are not built at runtime from source code in a program object. The common use of built in kernels is to expose fixed-function hardware or firmware associated with a particular OpenCL device or custom device. The semantics of a built-in kernel may be defined outside of OpenCL and hence are implementation defined. Note: Built-in kernels are missing before version 1.2.
-
内置内核绑定到特定的设备,并且不是在运行时从程序对象中的源代码构建的。内置内核的常见用途是公开与特定OpenCL设备或自定义设备相关的固定功能硬件或固件。内置内核的语义可以在OpenCL之外定义,因此是实现定义的。注意:1.2版本之前缺少内置内核。
All three types of kernels are manipulated through the OpenCL command queues and must conform to the synchronization points defined in the OpenCL execution model.
所有三种类型的内核都是通过OpenCL命令队列进行操作的,并且必须符合OpenCL执行模型中定义的同步点。