3 Replies Latest reply on Aug 14, 2014 3:54 AM by dipak

    printf bug

    ms_alkadi

      I have the following kernel

       

      kernel void generate_bi(global uint *sizes, global uint *bi)

      {

          uint globalID0 = get_global_id(0);

          uint globalID1 = get_global_id(1);

          printf((__constant char*) "(%d, %d) Thread works\n", globalID0, globalID1);

      }

       

      I don't get all printf's on my screen. For example, when I launch 16x16 in a single workgroup, I get the following

       

      (0, 0) Thread works

      (1, 0) Thread works

      (2, 0) Thread works

      (3, 0) Thread works

      (4, 0) Thread works

      (5, 0) Thread works

      (6, 0) Thread works

      (7, 0) Thread works

      (8, 0) Thread works

      (9, 0) Thread works

      (10, 0) Thread works

      (11, 0) Thread works

      (12, 0) Thread works

      (13, 0) Thread works

      (14, 0) Thread works

      (15, 0) Thread works

      (0, 1) Thread works

      (1, 1) Thread works

      (2, 1) Thread works

      (3, 1) Thread works

      (4, 1) Thread works

      (5, 1) Thread works

      (6, 1) Thread works

      (7, 1) Thread works

      (8, 1) Thread works

      (9, 1) Thread works

      (10, 1) Thread works

      (11, 1) Thread works

      (12, 1) Thread works

      (13, 1) Thread works

      (14, 1) Thread works

      (15, 1) Thread works

      (0, 2) Thread works

      (1, 2) Thread works

      (2, 2) Thread works

      (3, 2) Thread works

      (4, 2) Thread works

      (5, 2) Thread works

      (6, 2) Thread works

       

      Any ideas?

        • Re: printf bug
          dipak

          Hi,

          I tested the same with latest Catalyst driver and APP SDK on Windows 7 -64bit and it worked fine for me.

           

          Setup details

          AMD FX(tm)-4100 Quad-Core Processor 3.6GHz

          Windows 7 6bit

          Visual Studio 13

          HD Radeon Pitcairn 7850

          Driver 14.7 (14.30-140716a-173979E-ATI)

           

          Please check with the lastest driver and APP SDK. If still find the problem, please let us know your system details.

           

          FYI:

           

          As per AMD APP Programming Guide:

          The OpenCL Specification 1.1 and 1.2 support the optional AMD extension cl_amd_printf, which provides printf capabilities to OpenCL C programs. To use this extension, an application first must include

           

           

           

          #pragma OPENCL EXTENSION cl_amd_printf : enable

           

           

           

           

           

           

          Regards,

            • Re: printf bug
              ms_alkadi

              Thanks for the reply.

               

              I'm using Ubuntu 14.04 64bit with fglrx driver v13.35.5

              I have the Radeon R9 200 Tahiti and Core i7-4770K @ 3.5GHz

              gcc 4.8.2              

               

              I use thextension cl_amd_printf already.

               

              By the way I have other functions where I use printf and it works perfectly.

                • Re: printf bug
                  dipak

                  Hi,

                  I tested it again under Ubuntu 14.04 LTS with latest catalyst driver 14.40 but was unable to reproduce the issue.  Please check with the latest driver and let us know your findings.

                   

                  Setup Details:

                  HD Radeon Pitcairn 7850 and AMD Radeon HD 8670D

                  Driver: 14.40-140729a-174320E-ATI

                  APP SDK 2.9

                   

                  Regards,