cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Ceq
Journeyman III

Kernel Execution : Error with input streams

If you don't like using a startup script you can change it inside the program, just use putenv function. Putenv can be used to set environment variables in a running program. Example:

int main(int argc, char *argv[]) {
putenv("BRT_PERMIT_READ_WRITE_ALIASING=1");
...

0 Likes
Raistmer
Adept II

Kernel Execution : Error with input streams

LoL

Yes, it's exact that case.

I came to additional accumulator stream creation alredy too, thanks.

 

0 Likes
Raistmer
Adept II

Kernel Execution : Error with input streams

Originally posted by: Ceq If you don't like using a startup script you can change it inside the program, just use putenv function. Putenv can be used to set environment variables in a running program. Example:

int main(int argc, char *argv[]) { putenv("BRT_PERMIT_READ_WRITE_ALIASING=1"); ...

Thanks for hint, will keep it in mind, maybe it will be useful too.

0 Likes
Gipsel
Adept I

Kernel Execution : Error with input streams

Originally posted by: Raistmer LoL

Yes, it's exact that case.



I know. Btw., I've chosen Milkyway@home as this much smaller project fits better to my limited time resources

You should be glad SETI works only with float values. Using doubles for MW forced me to basically write the kernels in IL assembly. I used brook only for prototyping. I experienced some quite severe bugs of the SDK which made the "repair" on the IL level necessary. But I was amazed to see that some of them (like a mixed up ordering of arguments in the constant cache of the GPU when using gather arrays) only apply if you are working with doubles.

0 Likes
Raistmer
Adept II

Kernel Execution : Error with input streams

Yes, doubles used only in few places, most of processing goes in float.

BTW,

putenv("BRT_PERMIT_READ_WRITE_ALIASING=1");

didn't work unfortunately (that is, CAL error remains). Setting env variable on system level works though.

 

0 Likes
Gipsel
Adept I

Kernel Execution : Error with input streams

Originally posted by: Raistmer

putenv("BRT_PERMIT_READ_WRITE_ALIASING=1");

didn't work unfortunately (that is, CAL error remains). Setting env variable on system level works though.



I guess the brook runtime is initialized (and reads the environment variable) at startup of the program, so it is too late to change it within the program.

0 Likes
Raistmer
Adept II

Kernel Execution : Error with input streams

Seems so.

Runtime exists as brook.dll so it loaded before main() called.

It's initialization functions are called before too perhaps.

0 Likes
Ceq
Journeyman III

Kernel Execution : Error with input streams

That is strange, as far as I know Brook+ runtime reads that variable the first time you define a stream. Maybe it is system dependant, I'm using WinXP x64, MSVC 2005, Brook+ 1.4 and Catalyst 9.5.

Try the following code:

File "ker.br"

kernel void inc(float in1< >, out float out1< > ) { out1 = in1 + 1.0f; }

 

File "main.cpp"

#include <cstdio >
#include <cstdlib >
#include "brook/Stream.h"
#include "built/ker.h"

using namespace std;
using namespace brook;

int main(int argc, char** argv) {

    unsigned int i, SIZE = 1 << 4;

    // Memory arrays
    float* v = (float*)malloc(SIZE * sizeof(float));

    // Set environment variable
    putenv("BRT_PERMIT_READ_WRITE_ALIASING=1"); // *********

    // Init
    for(i = 0; i < SIZE; ++i)
        v[i ] =  (float)i;

    {
        // Stream arrays
        Stream<float > s(1, &SIZE);
        
        // Load
        s.read(v);

        // Kernel
        inc(s, s);

        // Save
        s.write(v);
    }

    // Print
    for(i = 0; i < 8; i++)
        printf("v[%i] = (%7.3f);\n", i, v[i ] );
}

0 Likes
Raistmer
Adept II

Kernel Execution : Error with input streams

Thanks, will try:

1)
.\built\ker.cpp(11) : error C2005: #line expected a line number, found '-'
I already encountered this error.
It appears when code in br file starts from first line.
In ATI counting starts from -1 perhaps, not from zero as in the rest of world 😉
(or big corporation guys can't imagine some source w/o copyrigt/left comments in few first dozens of code lines.... )

Healed by adding one blank line in the beginning of br file.

2)App output:

Kernel Execution Error: Input stream is same as output stream.
Binding kernels read-write is prohibited.
Environment variable BRT_PERMIT_READ_WRITE_ALIASING can be used to allow input-output aliasing.
But the results can be unpredictable.
v[0] = ( 0.000);
v[1] = ( 1.000);
v[2] = ( 2.000);
v[3] = ( 3.000);
v[4] = ( 4.000);
v[5] = ( 5.000);
v[6] = ( 6.000);
v[7] = ( 7.000);

OS is Vista x86 SP1, compiler - VC2005 SP1
Driver: Catalyst 9.2 (sorry, can't use 9.5 - it can't handle arrays of size I need).
SDK&RT: Brook 1.4 beta
0 Likes
youplaboom
Journeyman III

Kernel Execution : Error with input streams

I had this error too after instaling the latest catalyst driver 9.6 (I skipped 9.5)

It took me some time and tests to realize that the size of 1D streams was now limited to 8192. Go figure... The error message does not help either to understand what's going on exactly.

Just so you know, you can use catalyst 9.4; the size limitation appeared since version 9.5

0 Likes