Completely Starter in OpenCL

I am familiar with C++ and OpenGL 1.2.
Platform: Windows64 / Linux64

I want to give a try to OpenCL for my matrix library (multiplication, addition, gauss-jordan elimination etc). I work with big matrices (e.g. 50000x50000).

These are some starter questions:
[ul]
[li]Ok, headers provided. What about library? Where is opencl.a? For OpenGL, libraries are provided with MingW. But for OpenCL?[/:m:3mt2o44o][/li][li]If opencl.a provided from hardware vendor, how can we be sure that the program will work on other vendors?[/:m:3mt2o44o][/li][li]A OpenCL program run only on GPUs or run on CPUs too?[/:m:3mt2o44o][/li][li]If I am a freak and I have 2 different GPUs in one machine, it will work with both of them “correctly” or I must wait for the slowest GPU?[/:m:3mt2o44o][/li][]How big is the floating point? 32bit? 64bit? 128bit?[/:m:3mt2o44o][/ul]

I use windows x32 for opencl development, so I can help only with Visual Studio configuration

[quote=“chameleon”]
[ul]
[li]Ok, headers provided. What about library? Where is opencl.a? For OpenGL, libraries are provided with MingW. But for OpenCL?[/*:m:3haqlynx][/ul][/li][/quote]

I additionally included opencl.lib (if I’m not mistaken it came with SDK)

[quote=“chameleon”]
[ul]
[li]If opencl.a provided from hardware vendor, how can we be sure that the program will work on other vendors?[/*:m:3haqlynx][/ul][/li][/quote]

using clCreateProgramWithSource (or with binary) and clBuildProgram compile the program for the specific device (which is determined earlier)

[quote=“chameleon”]
[ul]
[li]A OpenCL program run only on GPUs or run on CPUs too?[/*:m:3haqlynx][/ul][/li][/quote]

It can be run on CPU too. When choosing device via clGetDeviceIDs set CL_DEVICE_TYPE_GPU or CL_DEVICE_TYPE_CPU as the second parameter to choose the device you want you program to be compiled for.

[quote=“chameleon”]
[ul]
[li]If I am a freak and I have 2 different GPUs in one machine, it will work with both of them “correctly” or I must wait for the slowest GPU?[/*:m:3haqlynx][/ul][/li][/quote]

You can use two devices (or even more). Read clGetDeviceIDs from manual

[quote=“chameleon”]
[ul]
[li]How big is the floating point? 32bit? 64bit? 128bit?[/*:m:3haqlynx][/ul][/li][/quote]

sizeof(), nope? :slight_smile: