4 Replies Latest reply on Oct 16, 2012 10:49 AM by binying

    Problem in binary size

    hojin

      Hi.

      I am developing some application with AMD OpenCL.

      But as I compiled certain small CL code, its binary size was too big, so program was down.

      When I use NVIDA or Intel OpenCL Compiler, it works well.

      While the size of binary of compiled by Intel is 19kB, that of AMD is 2MB.

      Can you check?

       

      Here is a simple example

       

       

      typedef struct

       

      {

                short block[12][64];

      }MB_information;

       

      __kernel main()

      {

                MB_information MB;

                Saturate(MB.block[i]);

      }

       

       

      void Saturate(short* Block_Ptr)

       

      {

                Block_Ptr[i] = val;

      }

       

       

       

       

      Thank you.

        • Re: Problem in binary size
          binying

          I test this modified kernel which works. Hope this is helpful to you. I am using win7, sdk 2.7 and the latest driver on A6

           

          typedef struct

           

          {

                    short block[12][64];

          }MB_information;

           

          __kernel test(__global int* in_out)

          {

                    MB_information MB;

                    Saturate(MB.block[3]);

          }

           

           

          void Saturate(short* Block_Ptr)

           

          {

                    Block_Ptr[3] = 5;

          }

            • Re: Problem in binary size
              hojin

              can u try this again?

               

              typedef struct

              {

                        short block[12][64];

              }MB_information;

               

               

              typedef struct

              {

                        int block_count;

              }idct_new_params;

               

               

              typedef struct 

              {

               

               

              }picture_params;

               

               

               

               

              void Saturate(short* Block_Ptr)

              {

                                  Block_Ptr[63] ^= 1;

              }

               

               

              __kernel void idct_new(idct_new_params inp, picture_params pp, __global MB_information * MBinfo, __global unsigned char* frf, __global unsigned char* brf, __global unsigned char* crf)

              {

                                  //int MBA=inp.MBA;

                                  //int MBA= get_global_id(0);

                                  int block_count=inp.block_count;

               

               

               

               

                                  //MB_information MB=MBinfo[MBA];

                                  MB_information MB=MBinfo[0];

               

               

               

                                  /* copy or add block data into picture */

               

               

                                  for (int comp=0; comp<block_count; comp++)

                                  {

               

               

                                            Saturate(MB.block[comp]);

                                  }

               

               

                        return;

              }

               

               

              2012-10-12 19 52 48.png