|
Ultra fast cnn based Hardware Computing Platform Concepts for adas visual Sensors and Evolutionary Mobile RobotsBog'liq Alireza Fasih8.6
Methodology of system design using OpenCL
OpenCL is “a framework suited for parallel programming of heterogeneous systems”. The
framework includes the OpenCL C language as well as the compiler and the runtime
environment required to run the code written in OpenCL-C. OpenCL is standardized by the
Khronos Group, who is known for their management of the OpenGL specification [136].
OpenCL is a framework which has been developed in order to program on any
heterogeneous environment. Therefore we can say that the OpenCL code is capable of
being executed on any computer. OpenCL provides standardized APIs that perform tasks
such as vectorized Single
Instruction Multiple Data
(SIMD) operations, data parallel
processing, task parallel processing and memory transfer. A simple functional execution
block written in OpenCL is called as a kernel. The OpenCL kernel is written in its native
language using its own API. The benefits of OpenCL are: it allows acceleration in parallel
processing, it manages the computational resources, it views multi-core CPUs, GPUs etc. as
computational units, allocates different levels of memory, it also supports cross-vendor
software portability. A simple kernel written in OpenCL in comparison with the traditional
loop coding is seen the following Figure 8-3.
92
Figure
8-3: A comparison traditional loop with the OpenCL data parallel kernel
The Figure 8-3 gives the advantages of writing the code in OpenCL as well as the parallel
computing capability of the OpenCL kernel. From Figure 8-4 we can clearly understand the
steps involved in the OpenCL programming model. The steps show the structural design
and execution of a kernel. Whenever the kernel is designed, these steps are followed in
order to execute the kernel on the appropriate device.
Here in our work, we have used the OpenCL in order to develop the UM
–
CNN which is to be
executed on the GPU. The required kernel which is necessary for the execution of the CNN
is written using the OpenCL programming model. The interface of the data is done from the
CPU which is to be loaded onto the device. For proper interface of the communication of
data we have used the
Open Computer Vision Library
(OpenCV) for the reading of images,
loading of the image data on to the memory elements and to display the retrieved image
back from the GPU after its execution.
|
| |