5 Replies Latest reply on May 24, 2011 8:06 PM by himanshu.gautam

    cl_amd_printf unrecognized extension

    notyou

      I couldn't find any topics relating to why I can't get cl_amd_printf to work under SDK 2.4 and driver 11.4.

      Whenever I add #pragma OPENCL EXTENSION cl_amd_printf : enable to my .cl file, it comes back with "warning: ignore unrecognized OpenCL extension" and fails to compile.

      If I try to use the standard printf ( ... ) I get "error: function "printf" declared implicitly" and again it fails to compile.

      Is there a file or library I need to include to make this work?

      For reference:

      Windows 7 x64 Home Premium

      Intel i7-720QM

      ATI Mobility Radeon 5870

        • cl_amd_printf unrecognized extension
          himanshu.gautam

          Your method appears fine and so does your system configuration.Althoug it would be nice if you can check the 11.5 hotfix version once.

          Maybe someone else can provide some possible reason for this. It works on my system:

          Vista64,SDK 2.4,Radeon HD 5770.

            • cl_amd_printf unrecognized extension
              notyou

              I'll try the 11.5 hotfix and post back.

              For now though, can you (or anyone else) post a simple C++ file so I can try a working program on my system. As well, let me know if I need to include anything like CL.hpp or SDKUtil.hpp (would this one be the reason it doesn't work? Do I need to include a certain file to access AMD extensions?)

                • cl_amd_printf unrecognized extension
                  notyou

                  Update: Tried the 11.5 hotfix, it didn't fix the problem. I did however go back to HelloCL and add in the pragma and a printf which then worked correctly. My guess is that SDKUtil.lib or something needs to be included in order for the cl_amd_printf extension to be recognized. I'll look into this further and post back.

                  -Matt

                    • cl_amd_printf unrecognized extension
                      notyou

                      This block of text can be ignored. I'll leave it here for reference.

                      [ignore]OK. So after some more digging, if I copy all of the project settings and files from HelloCL to my own project, it still doesn't work correctly so something is still not being copied properly. So, is there any way to start a new project (or copy an existing one) that will save all the project settings so I can use it as a base for my own project?[/ignore]

                      I figured out the error. It was a really stupid mistake on my part. When I was reading in the source file, I thought it was adding a newline after each line...it wasn't, leading to a big #pragma OPENCL EXTENSION cl_amd_printf : enable__kernel .... statement the compiler couldn't interpret. It just never came up before since I hadn't used pragmas inside my .cl file before.