opencl programming

i do not have a gpu for my system…i want to run an opencl program for face recogniton… can i do it possibly with a cpu(x86,i5 core cpu,32 bit operating system)? please help me out…

On my macbook pro, I use opencl both on the GPU and the CPU. You specify something like CL_DEVICE_CPU to make a context for the cpu.

Off the top of my head I don’t know how many cores (real or virtual) the i5 has. My i7 has two real cores but with hyperthreading they appear as four.

thanks… can you help me out with any sites related my project…?wat are the back up files required for running a opencl code?

in compiling the following program i’m gettin a error saying"error compiling opencl kernel".
can anyone pl help me out?

#include <utility>
#define __NO_STD_VECTOR
#include <CL/cl.hpp>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <string>
#include <iterator>
const std::string hw("Hello World
");
inline void
checkErr(cl_int err, const char * name)
{
if (err != CL_SUCCESS) {
std::cerr << “ERROR: " << name
<< " (” << err << “)” << std::endl;
exit(EXIT_FAILURE);
}
}
int
main(void)
{
cl_int err;
cl::vector< cl::Platform > platformList;
cl::Platform::get(&platformList);
checkErr(platformList.size()!=0 ? CL_SUCCESS : -1, “cl::Platform::get”);
std::cerr << "Platform number is: " << platformList.size() << std::endl;

std::string platformVendor;
platformList[0].getInfo((cl_platform_info)CL_PLATFORM_VENDOR, &platformVendor);
std::cerr &lt;&lt; "Platform is by: " &lt;&lt; platformVendor &lt;&lt; "

";
cl_context_properties cprops[3] =
{CL_CONTEXT_PLATFORM, (cl_context_properties)(platformList[0])(), 0};

cl::Context context(
   CL_DEVICE_TYPE_CPU, 
   cprops,
   NULL,
   NULL,
   &err);
checkErr(err, "Conext::Context()");       

char * outH = new char[hw.length()+1];
cl::Buffer outCL(
context,
CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
hw.length()+1,
outH,
&err);
checkErr(err, “Buffer::Buffer()”);

I use Xcode / Cocoa under OSX … everything is already there when I install Xcode, but I don’t have the luxury of latest drivers etc. – I have to wait for Apple to do stuff, and they lag way behind.

I don’t know C++ so I’m not much help; maybe later I can find some time to see something obvious wrong with your code, but maybe someone who knows C++ will speak up…?

Is that your entire code? I don’t see your kernel (what is compiled), nor do I see your commands for compiling.

Make sure you have an SDK installed so that you can use OpenCL. AMD/NVIDIA/Intel should be good. Please give us more information and we can help you further.

is it possible to write a opencl code for face recognition?

I imagine that it may be possible to do what you want to do, but I do not know what is involved in face recognition, or the details of your proposed approach.

You need to decide that yourself. I think that you need first to at least design your program, how you intend to deal with face recognition, which calculations are involved. Then, once that is done, you can look at your design and decide which of those calculations can be done in parallel. Then you will know if your project is appropriate for OpenCL.

iam planning to write program for a illuminance invariant face recognition system using opencl.methodology includes filtering(homomorphic),illumination normalization and correction using dct,face recognition using pca…

i use a intel processor(i5 core). i have installed AMD APP SDK for opencl … will it be compatible? please help me soon…

Yes it will be compatible, but intel also provides an OpenCL implementation
that you might like to try.

http://software.intel.com/en-us/article … pencl-sdk/


jason

I did not know about the Intel implementation. That could be really cool! If you don’t have a GPU then that may be what you want to use; it could be very well optimized for their CPUs.

Here is how I did my work:

I had a project, already working, from ~25 years ago, that seemed good for opencl. SO!, I jumped in and started converting it. I learned XCode, Cocoa, and OpenCL, enough to make my project work, between March and November of 2011 (the old version was CodeWarrior, a >10 year old development environment).

SO, I already had something that worked. THEN, I made it work in OpenCL. THEN!, only once it actually worked, I optimized it until I had maybe 4x speedup over the first time it ran in OpenCL. (This included adding vector types [float4] for my amd gpu.)

. . . so . . . do i really have anything to say here? maybe yes, maybe my message is that first, you might want to get your program working the old way (completely ignoring opencl), and then, once you have that, you can convert it to opencl. AND!, then, once you have that, you can optimize things in many ways to really get the best benefits of opencl and all those processor cores on your GPU!