4 Replies Latest reply on Nov 16, 2012 8:06 PM by juliomh

    Problem building program

    juliomh

      Hello, I've been having a problem with a large kernel I wrote. I can run it from Visual Studio or from the command line.

       

      However, if I try to run it from gDebugger of CodeAnalyst, when clBuildProgram is called, it just shows an enigmatic: "Error: syntax error". I think is an output of the CL library (not mine), but the strange thing is that it returns without error, and allows me to execute the kernel without error (although in this case, it does not do anything).

       

      I have searched about this message: "Error: syntax error" and I haven't found anything. Anyone has faced the same problem??

       

      Thanks.

      Julio

        • Re: Problem building program
          binying

          Is it possible for you to narrow down the problem and upload the code s that it can be reproduced?

            • Re: Problem building program
              juliomh

              Ok, I've narrowed it to.. an empty kernel!

               

              Is there any problem with typedef or enum?

               

              typedef float deftype;
              
              typedef enum{MT_HARD, MT_SOFT} ModuleType;
              
              typedef struct {
                  int parent;
                  int left;
                  int right;
                  
                  ModuleType type;
              
                  deftype x1;
                  deftype y1;
                  deftype x2;
                  deftype y2;
              
                  deftype width;
                  deftype height;
                  deftype area;
              
                  deftype minAR;
                  deftype maxAR;
              } Node;
              
              typedef struct {
                  int front;
                  int back;
              } Contour;
              
              typedef struct {
                  unsigned int x;
                  unsigned int y;
                  unsigned int z;
                  unsigned int c;
              } kiss_state_t;
              
              __kernel void MoveAndCost(
                  __global int *numNodes,
                  __global Node *nodes,
                  __global int *rootNode,
                  __global Node *workingNodes,
                  __global int *workingRootNode,
                  __global int *numMoves,
                  __global deftype *bestCost,
                  __global kiss_state_t *state,
                  __global int *stackNodes,
                  __global Contour *contour,
                  volatile __global int *mutex)
              {
              
              }
              
              
                • Re: Problem building program
                  binying

                  "Is there any problem with typedef or enum?" No, I don't think so.


                  Btw, ur code u pasted compiles well on my KernelAnalyzer.

                  -------------------

                  1. typedef float deftype; 
                  2.  
                  3. typedef enum{MT_HARD, MT_SOFT} ModuleType; 
                  4.  

                  ...

                  1.     volatile __global int *mutex) 
                  2.  
                    • Re: Problem building program
                      juliomh

                      Yep, I compiles okay with KernelAnalyzer, and it executes ok from Visual Studio or the command line. It's only from the gdebugger or CodeAnalyst that fails. I wonder if these programs use a different underlying library to perform the debugging and this is what is failing...