can we write GPU version for this CPU code? Its dependant code.

[codebox]void foo( unsigned char* src, unsigned char* inOutParam )

{

int index=0;

int srcIndex=0;

int value=0;

for( int i=0; i<1000; i += 2 )

{

	value=0;

	if ( index != 0 )

		srcIndex = inOutParam[index-1]; 

	else

		srcIndex = 0;

	if( src[srcIndex] != 0 )	

		value = src[srcIndex];	

	if( index != 0 )

		inOutParam[index] = inOutParam[index-1]+value+2;

	else

		inOutParam[0] = value+2;

	index++;

}

[/codebox]

please help me.