rgy

how to compile OpenCL project on eclipse?

Discussion created by rgy on Aug 12, 2014

1. eclipse : luna

2. AMD

3. Window 7

캡처1.PNG.png

캡처2.PNG.png

I try to setting likes pictures..(sorry, i can't speak english...)

and ..

I try Build Project

This is my source code..

#include <CL/cl.h>

#include <CL/cl_platform.h>

#include <stdio.h>

#include <stdlib.h>

#ifdef __APPLE__

#include <OpenCL/cl.h>

#else

#include <CL/cl.h>

#endif

using namespace std;

int main(int argc, char* const argv[])

{

    //Number of devices

    cl_uint num_devices, i;

    //Getting device ids

    clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices);

    cl_device_id* devices = (cl_device_id*)calloc(sizeof(cl_device_id), num_devices);

    clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, num_devices, devices, NULL);

 

    char buf[128];

    for (i = 0; i < num_devices; i++)

        {

            clGetDeviceInfo(devices[i], CL_DEVICE_NAME, 128, buf, NULL);

            fprintf(stdout, "Device %s supports ", buf);

            clGetDeviceInfo(devices[i], CL_DEVICE_VERSION, 128, buf, NULL);

            //Printing device info

            fprintf(stdout, "%s\n", buf);

        }

    free(devices);

}

and Run project.

but I have some problem.. like that..

캡처3.PNG.png

I don't know ..how to solve this problem.

 

please help me ~~!!

Outcomes