3 Replies Latest reply on Jan 23, 2009 11:39 AM by thesquiff

    A bug

    thesquiff
      or is it me....

      While compiling this code, I get the errors below:

      kernel void zeros(float matches<>, out float zeros<> {
          int idx = instance().x;
          zeros = (matches < 1.0F) ? (float)idx:0.0F;
      }

      1>ERROR: Invalid cast
      1>While processing <buffer>:127
      1>In compiler at AST::Symbol::AsFunctionSymbol()[astsymbol.hpp:178]
      1>  ToString() = (float)zeros[r308]
      1>Aborting...
      1>Problem with compiling u:\GPGPU\mygzip\hello_brook\\built\hello_brook_zeros.hlslERROR: Invalid cast
      1>While processing <buffer>:179
      1>In compiler at AST::Symbol::AsFunctionSymbol()[astsymbol.hpp:178]
      1>  ToString() = (float)zeros[r368]
      1>Aborting...

      I've tried all sorts of ways of modifying the code. Is it me or the compiler?

      Thanks

        • A bug
          gaurav.garg

          Brcc fails in case funtion name matches with any parameter name or variable inside kernel.

          Try changing kernel name.

            • A bug
              ryta1203
              kernel void foo_s(float matches<>, out float zeros<>)
              {
              int idx=instance().x;

              zeros = (matches < 1.0F) ? (float)idx:0.0F;
              }

              This works, although Garuav beat me to it, your function name and output stream name are the same.
                • A bug
                  thesquiff

                  ok, I had a feel it would be my fault. A more descriptive error message might have pointed me in the right direction!

                  Thanks for your help once again guys.