cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Raistmer
Adept II

"Invalid stream" error at domain using

0 Likes
8 Replies
gaurav_garg
Adept I

Make sure you are specifying the correct size. Specifying a domain of size (x1, x2), means part of stream from x1 to x2-1 would be used. So, the maximum domain extent can be (0, width) if you want to use complete stream.

or

(0,0) to (width, height) in case of 2D stream.

0 Likes

Originally posted by: gaurav.garg

Make sure you are specifying the correct size. Specifying a domain of size (x1, x2), means part of stream from x1 to x2-1 would be used. So, the maximum domain extent can be (0, width) if you want to use complete stream.


or


(0,0) to (width, height) in case of 2D stream.



But I get same error even when I use

unsigned int begin[]={0,0};
unsigned int end[]={0,0};

That is, single element.... 😞

ADDON:
This code used for gpu_temp initialization right before domain extraction attempt.
And it gives no erros...
GPU_fetch_array_kernel3(gpu_data,gpu_periods,*gpu_per_int,gpu_n_per,*gpu_temp);
#if 1
gpu_temp->finish();
#endif
if(gpu_temp->error())
fprintf(stderr,"ERROR: GPU_fetch_array_kernel3: %s\n",gpu_temp->errorLog());

0 Likes

For single element extent should be-

unsigned int begin[]={0,0};
unsigned int end[]={1,1};

0 Likes

Originally posted by: gaurav.garg

For single element extent should be-




unsigned int begin[]={0,0};
unsigned int end[]={1,1};



Yes, I got it by trying, but no understanding why (there is only single example of domain usage available and it supposes (0,0) (0,0) should be used IMHO.

Thank you for help!
0 Likes

0 Likes

Well, in my case

unsigned int begin[]={0,0};
unsigned int end[]={per_int[0],1}; //EDITED

works as intended

unsigned int begin[]={0,0};
unsigned int end[]={per_int[0],0}; //EDITED
gave Invalid stream error again... It seems zero not allowed in end at all.
How SDK sample works correcly then? It should lose last column and row of array IMHO...
0 Likes

I think the sample given is correct. You can take a look at the given CPU function to verify GPU output and see what it intends to do.

0 Likes

OMG,
unsigned int begin[]={0,0};
unsigned int end[]={1,1};
gave that first element correctly....

But what SDK sample means then ???

// Executing kernel and copying back data
//--------------------------------------------------------------------------

// Specifying the domain for the output stream
// For a 2D stream, the start and end coordinates are 2D like (x,y).
// start = (x0,y0)
// end = (x1,y1)
unsigned int start[] = {2,2};
unsigned int end[] = {width - 1, height - 1};

0 Likes