cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

rgy
Journeyman III

how to compile OpenCL project on eclipse?

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, CL_DEVICE_NAME, 128, buf, NULL);

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

            clGetDeviceInfo(devices, 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 ~~!!

0 Likes
0 Replies