I have started now to learn openCL. I am doing the tutorial now but I can't really grasp the idea is of host could someone explain.Thank you
问题:
回答1:
OpenCL is a system designed to support massively parallel processing such as can be performed by modern graphics chips (GPUs). In the OpenCL paradigm, a "host program" is the outer control logic that performs the configuration for a GPU-based application. This host program normally would run on a general purpose CPU (such as the x86-compatible main processor in most desktop PCs). An OpenCL program also contains one or more "kernel" functions that are designed for parallel execution on the GPU.
Once all of the buffers and kernels are configured, the host program will call something like
EnqueueNDRangeKernel()
which will begin execution of the kernel on the GPU.
Depending on your target platform, things could be a little different. For example, OpenCL does not specifically require the existence of a GPU. In can instead execute the kernel as multiple threads on the same CPU that runs the host program.
Summary of OpenCL nomenclature:
- Host - the main CPU used to configure kernel execution
- Device - the component which contains the processing units that will execute the kernel (the GPU)