cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

jean-claude
Journeyman III

stream dynamic allocation (new approach)

possible bug?

I noticed a probable dynamic stream allocation bug ...

Coul you confirm?

here is a simple test program


// Test_GPU_1.cpp : Defines the entry point for the console application.

#include "stdafx.h"
#include "brook/Stream.h"

brook::Stream<int3> *stream_A;

void create_streams( int width, int height ) {
    unsigned int dims[2] = { height, width };       
    stream_A= new brook::Stream<int3>(2,dims); // allocation doubtful...
}

int _tmain(int argc, _TCHAR* argv[])
{
    create_streams(576,720);
    return 0;
}


Noticed that as a resultof allocation, here is part of the stream_A structure :

stream_A

  _refcount =1

  _rank=2

  _ dimensions (should have 2 items)

      720  OK

      576 is missing !!!!

 

 

0 Likes
2 Replies
gaurav_garg
Adept I

Hi Jean-Claude,

Its probably the way your debugger works. Try putting _dimensions[0] and _dimensions[1] as your watch points if your debugger allows that.

 

As I can see from your code you are using visual studio.

Brook+ allocates these _dimensions arrays dynamically and visual studio has no way to know how many items has been allocated in these arrays and it just shows the 0th element of these arrays.

0 Likes

Hi Gaurav,

You're right

stream_A->_stream->_dimensions[1]    gives indeed 576 !

Sorry about that, at 5:00 am my time my mind was not at its top!

Kind regards

Jean-Claude

0 Likes