cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Peterp
Journeyman III

#include in *.br File

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?

 

0 Likes
2 Replies
genaganna
Journeyman III

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.

 

 

0 Likes

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.

0 Likes