cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

codeboycjy
Journeyman III

Access violation writing location in Stream<T>::Domain

Hi:
   Things are a little strange here.
   When i run the program, it works. When i debug the program, there is an error:
   Unhandled exception at 0x0228a9d3 in Tracer.exe: 0xC0000005: Access violation writing location 0x11518441.
   It's in the Stream<T>:omain function. Is there something to be noted inth the function??

   Thanks

0 Likes
11 Replies
codeboycjy
Journeyman III

I think i've figure out the cause. But i still have no idea about the reason.

A scatter stream could not be used as a normal stream anymore.

For example, a stream can't be the output of the two kernel:

kernel void kernelSplitNode( out float4 countArray[][] )
{
 //get the index
 int2 index = instance().xy;

 countArray[index.y][index.x] = float4( 1.0f , 2.0f , 3.0f , 34.0f );
}

//clear the memory
kernel void kernelClearMemory( float data , out float4 buffer<> )
{
 buffer = float4( data , data , data , data );
}

If u debug the code , it'll crash.


Any idea about the reason is really appreciated!! Thanks for ur kind help.

0 Likes

That is strange.Could you post your runtime code as well?

0 Likes

 Here are the whole thins.


 

#include "brookgenfiles/test002.h"
#include <stdio.h>

using namespace brook;
using namespace std;

#define MAX 4 * 4 * 4

void main()
{
 float* in1 = new float[MAX];
 float* out = new float[MAX];

 //initialize
 for(int i=0; i<MAX; i++)
  in1 = (float)i;

 //the dimension
 unsigned int size[] = { 4 , 4 };

 //the stream
 Stream<float4> stream_a( 2 , size );

 //read the data from cpu
 stream_a.read(in1);
 
 //call the scatter kernel
 kernelSplitNode(stream_a);

 //call the clear memory
 //note : it'll crash here when u're debuging the program!!!!
 //  Still don't figure out the reason
 kernelClearMemory( 0.0f , stream_a );

 //output the result
 stream_a.write(out);

 for(int i=0; i<MAX; i++)
 {
  printf( "%f\t" , out );
  if( i%4 == 3 )
   printf("\n");
 }

 delete in1;
 delete out;
}


kernel void kernelSplitNode( out float4 countArray[][] )
{
 //get the index
 int2 index = instance().xy;

 countArray[index.y][index.x] = float4( 1.0f , 2.0f , 3.0f , 4.0f );
}

//clear the memory
kernel void kernelClearMemory( float data , out float4 buffer<> )
{
 buffer = float4( data , data , data , data );
}

There are only two files. It's pretty simple.
I'm really really appreciate ur help!

0 Likes

It seems to be working fine for me and I am able to debug this as well. Which SDK and catalyst version are you using?

0 Likes

Hi:
   First , i'm grateful!!
   And i'm using sdk 1.4.0_beta with catalyst 9.5. And i'm developing on Visual studio 2005 sp1.
   Does that work??
   And could u tell me about the version of ur sdk and catalyst??
   Thanks for ur patient.

0 Likes

Catalyst 9.6 with SDK 1.4beta. Visual Studio 2005 SP1 should work too.

0 Likes

I've changed the latest version, but the problem remains unsolved....
Is there anything else could cause that??
By the way , i'm using Windows Vista with a 4850 display card.

0 Likes

I am working on XP. I will try to check it on Vista If I get some free cycles.

0 Likes

I've got something else.
My classmate gets a computer with 4870 x2 today , the OS is xp.
And there is neither problem for him!

It seems like the guy posting the topic had the same problem with me.

http://forums.amd.com/devforum/messageview.cfm?catid=328&threadid=115195&enterthread=y

0 Likes

I did try it on Vista and I am able to reproduce the problem. Surprisingly, crash occurs only if we try to debug the code.

Also, if we move kernelClearMemory above kernelSplitNode, the problem doesnot reproduce. My guess is that its a bug with CAL that doesn't allow using regular output kernel after scatter kernel.

0 Likes

That's exactly what happened on my gear.

Because currently i'm developing on XP and interoperablity is not supported on XP. Anyway i would swittch to vista before the deadline of the second phase of the contest.

Could i know when i could get the sdk without the specific bug?

0 Likes