8 Replies Latest reply on Dec 9, 2014 4:26 AM by dukeleto

    segfault at clBuildProgram

    dukeleto

      Hi,

       

      after modifying a number of variable declarations from

      double to single precision in a (working) .cl file, I now have

      a systematic segmentation fault at the clBuildProgram call.

      It does not seem to be a syntax error, since the code compiles

      properly with another vendor's environment.

       

      Any suggestions on how best to approach a problem like this?

       

      Thanks,

       

      Olivier

        • Re: segfault at clBuildProgram
          titanius

          maybe a long shot but you try finding if its due to some formatting errors, that cause the compiler to fail, by building the kernel in CodeXL analyze mode?

          1 of 1 people found this helpful
            • Re: segfault at clBuildProgram
              dukeleto

              Thanks for the suggestion. Unfortunately, trying to analyze the kernel file with CodeXL (latest version 1.5-5364, with latest catalyst driver) also results in a segfault. It is rather frustrating! Looks like I'm going to have to remove the kernels one by one from the .cl file, to see when the segfaults disappear ...

            • Re: segfault at clBuildProgram
              wolf0

              That's happened to me before - I had to modify a loop into an two loops and an if statement to make the compiler quit crashing on me.

              1 of 1 people found this helpful
              • Re: segfault at clBuildProgram
                dukeleto

                In case anyone from the compiler team is interested, I think I have tracked down the main cause of my segfaults :

                implicit type casting from single to double or double to single.

                 

                When I remove all of them, the code compiles, with one or two type casts, still no problem, but when I leave a number

                of implicit type casts, the segfault at cl compilation occurs.

                 

                While I fully understand that implicit type casting is really not something I should be doing from a numerical correctness point of view,

                it would be nice if the compiler were able to warn of the locations where they are being performed (currently, it says nothing at all)

                rather than segfaulting!

                 

                Olivier

                  • Re: segfault at clBuildProgram
                    dipak

                    It's hard to comment what may be the actual reason behind this segfault. However, I agree with you that one cannot expect a segfault against some implicit type casting. If that is the case, it would be really helpful for us if you share a testcase that manifests the issue. Your input can help us to improve the performance of compiler/driver in future.

                     

                    Regards,