11 Replies Latest reply on Nov 30, 2016 1:57 AM by dipak

    Error Getting Platform OpenCL

    musa

      hi ,

      my system configuration is

      Ubuntu 14.04

      no Gpu

      intel i5 processor 3rd generation

      RAM 4GB

      using opencl -> AMDAPPSDK-3.0

      I am new into OpenCL. i ran a simple program to check the no. of platform got error.

       

      CODE:

       

      #include <CL/cl.h>

      #include <string.h>

      #include <stdio.h>

      #include <stdlib.h>

      #include <iostream>

      #include <string>

      #include <fstream>

       

      #define SUCCESS 0

      #define FAILURE 1

      using namespace std;

       

      int main()

      {

          /*Step1: Getting platforms and choose an available one.*/

          cl_uint numPlatforms;    //the NO. of platforms

          cl_platform_id platform = NULL;    //the chosen platform

          cl_int    status = clGetPlatformIDs(0, NULL, &numPlatforms);

       

          cout << "No ofPlatforms: "<< numPlatforms<<endl;

          if (status < 1)

          {

              cout << "Error: Getting platforms!" << endl;

              return FAILURE;

          }

       

      }

      ERROR:

      Error: Getting platforms!

      KINDLY PROVIDE SOME SOLUTION TO THIS.