2 Replies Latest reply on Jan 29, 2014 10:58 AM by coordz

    How to see call stack of CL function call?

    coordz

      I'm using the GPU Application Trace part of CodeXL and can navigate to the source code that made the OCL call. However, I can't find a way to see a call stack associated with that OCL call. How can I see the call stack associated with a OCL function call?

       

      Thanks

        • Re: How to see call stack of CL function call?
          kalyanpk

          Hi,

          In "Host Thread" tab of "GPU: Application Trace" profile run, we get OpenCL call history.

           

          If you are looking for the call stack associated with a particular OpenCL call, do the following:

               i. Change CodeXL mode to "Debug" by clicking on "D" icon or by "Debug -> Debug Mode".

               ii. Click on "Debug -> Add/Remove Breakpoint" and add the desired OCL call as break point

               iii. Click "F5" to start debugging.

               iv. Once Break point is hit, "Call Stack" tab shows the desired call stack for the OCL call

           

          Let us know if you need any other help in using CodeXL.

           

          Thanks,

          Kalyan P

          • Re: How to see call stack of CL function call?
            coordz

            Thanks for your reply, Kalyan.

             

            It is useful to do things the way you said in simple cases but not in my case. The exact same line containing the OpenCL call is in a class which is used thousands of times during program execution and I know that one of those class instances is leaking the OCL resource. Say it's the call numbered 12345 in the application trace. I then want to know the call stack above so I know how the class got called in the first place. Solutions I can think of are:

             

            1) Be able to set an OpenCL breakpoint that is of the form "break on the 12345th OCL call";

            2) Enable a full call stack to be logged for either all, or specific, OCL calls in the OCL application trace (my preference);

            3) Somehow count the number of times an OCL call is made on a specific source line and report this. I could then set a conditional breakpoint on the number of times hit.

             

            Do you see my problem?

             

            Thanks,

            Tim