2 Replies Latest reply on Mar 27, 2009 11:13 AM by Peterp

    #include in *.br File

    Peterp

      Hi,

      i have my br-file and i want to compile it width brcc, the file looks like that

      gpucode.br

      #include <brook/brook.h>

      kernel void test_kernel(float a<>, float b<>, out float c<>
      {
        c = a + b;
      }

      void call_brook()
      {
          unsigned int size = 1024;
         Stream<float> stream1(1,&size);
      }

       

      if I compile it with brcc i get this error: 

      Error (syntax error> before 'float'

          Stream<float> stream(1,&size);

       

      What i'm doing wrong?

       

        • #include in *.br File
          genaganna

          Problem is with c++ code in your .br file.

          .br should contain c-language only.

          Move non-kernel code to your C++ file if you like to use C++ for non-kernel code.

           

           

            • #include in *.br File
              Peterp

              Hi,

               

              Ok i use the C++ Code only in my *.cpp Files, how i can pass a Stream to a function in the *.br file:

              CPP file

              Streamstream1(1,&size);

              Streamstream2(1,&size);

              Streamstream3(1,&size);

              call_brook(stream1,stream2,stream3);

               

              BR file

              kernel void test_kernel(float a<>, float b<>, out float c<>
              {
                c = a + b;
              }

              void call_brook(float a<>, float b<>, float c<>
              {

                 test_kernel(a,b,c);
               }

               

              i get the error: ERROR--1 Problem with stream declaration Statement: float s1()

               

              I don't want to pass them direct to the kernel.