5 Replies Latest reply on Nov 22, 2013 3:22 AM by himanshu.gautam

    OpenCL in CentOS6.0

    mariacs

      I need to install OpenCL on a 32-bit machine with CentOS6.0

      Anyone can help me?

        • Re: OpenCL in CentOS6.0
          himanshu.gautam


          Hi

          You will be able to install opencl on this os.

          You can download the package from the below link

          http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloads/

           

          Please post your feedback after installation.

            • Re: OpenCL in CentOS6.0
              mariacs

              Hello.

               

              The installation was successful but when compiling a program I get the following error:


              'size_t' was not declared In this scope

               

              This error is repeated with other variables. How I can fix? I have to install something else?

               

              Thanks.

                • Re: OpenCL in CentOS6.0
                  himanshu.gautam

                  Hi

                  Just make sure that you have included stddef.h . size_t is defined in this header file.

                    • Re: OpenCL in CentOS6.0
                      mariacs

                      This is my code:

                       

                      #include "simpleCL.h"

                       

                      int main() {

                      char buf[]="Hello, World!";

                      size_t global_size[2], local_size[2];

                      int found, worksize;

                      sclHard hardware;

                      sclSoft software;

                       

                      // Target buffer just so we show we got the data from OpenCL

                      worksize = strlen(buf);

                      char buf2[worksize];

                      buf2[0]='?';

                      buf2[worksize]=0;

                       

                      // Get the hardware

                      hardware = sclGetGPUHardware( 0, &found );

                      // Get the software

                      software = sclGetCLSoftware( "example.cl", "example", hardware );

                      // Set NDRange dimensions

                      global_size[0] = strlen(buf); global_size[1] = 1;

                      local_size[0] = global_size[0]; local_size[1] = 1;

                       

                      sclManageArgsLaunchKernel( hardware, software, global_size, local_size,

                      " %r %w ",

                      worksize, buf, worksize, buf2 );

                       

                      // Finally, output out happy message.

                      puts(buf2);

                       

                      }

                       

                      __kernel void example( __global char* buf, __global char* buf2 ){

                      int x = get_global_id(0);

                       

                      buf2[x] = buf[x];

                       

                      }



                      and this is the output now:

                       

                      simple.cpp:1:22: error: simpleCL.h: No such file or directory

                      simple.cpp: In function ‘int main()’:

                      simple.cpp:8: error: ‘sclHard’ was not declared in this scope

                      simple.cpp:8: error: expected ‘;’ before ‘hardware’

                      simple.cpp:9: error: ‘sclSoft’ was not declared in this scope

                      simple.cpp:9: error: expected ‘;’ before ‘software’

                      simple.cpp:12: error: ‘strlen’ was not declared in this scope

                      simple.cpp:18: error: ‘hardware’ was not declared in this scope

                      simple.cpp:18: error: ‘sclGetGPUHardware’ was not declared in this scope

                      simple.cpp:20: error: ‘software’ was not declared in this scope

                      simple.cpp:20: error: ‘sclGetCLSoftware’ was not declared in this scope

                      simple.cpp:27: error: ‘sclManageArgsLaunchKernel’ was not declared in this scope

                      simple.cpp:30: error: ‘puts’ was not declared in this scope

                      simple.cpp: At global scope:

                      simple.cpp:34: error: expected constructor, destructor, or type conversion before ‘void’

                       

                       

                      Thanks!!


                        • Re: OpenCL in CentOS6.0
                          himanshu.gautam

                          Could you please attach your complete application folder in zip format here.

                          Because, you must place your .h files in a approprate path to access. By the error which you mentioned above shows that your .h file is somewhere and u r just giving the path as "simpleCL.h". Make sure the path