Download GPU computations in heterogeneous grid
Transcript
project is created. Any features required by the OpenCL application can be enforced with the techila_client_features project parameter. The features can be specified to be equal, greater or equal , less than or equal to a value or any value. If some feature is not enforced by the local management code the worker code has to check that this feature is supported by the platform and the compute device at runtime using clGetPlatformInfo and clGetDeviceInfo OpenCL API calls. 6.2 OpenCL worker code This chapter will describe the process of writing a cross-platform compatible OpenCL application. An OpenCL application can be divided into two components the host code and the kernel code. The steps in implementing the OpenCL host code are explained with the help of a flow graph. The OpenCL API and OpenCL C syntax is not discussed in detail as it is well documented in [5]. It is recommended that the OpenCL application is developed, tested and proven functional locally before running it on the grid. Before reading further it is strongly recommended that the reader has read chapter 3.2 and understood the key concepts of the OpenCL architecture presented in that chapter. When developing OpenCL applications on a Windows or Linux computer a software development kit such as the NVIDIA GPU Computing SDK or the ATI Stream SDK has to be installed. Note that the NVIDIA GPU Computing SDK will require the development version of the ForceWare display driver. Besides containing all the necessary library and header files the SDKs contain sample programs, utility libraries and vendor specific documentation. If the development is done in OS X the development tools package has to be installed. On Unix platforms the OpenCL host code can be compiled with the gcc compiler. Under Linux the OpenCL library flag -lOpenCL has to be passed to the gcc compiler and in OS X the the compiler has to be instructed to use the OpenCL framework by passing the flag -framework OpenCL to the gcc compiler. If the application development is done in Windows the compilation can be performed with Microsoft Visual Studio. Detailed instructions how to do this can be found from the programming guides [10] and [2]. 6.2.1 OpenCL host code The purpose of the host codes is to manage the compute devices and the resources they have. This is achieved through the OpenCL API. Experimental C++ bindings exist 31