Hi,
I have a device function that call another device function that have a for loop that go though an array of integer in structure as follow :-
__device__ bool mustAttack()
{
for (int i = 0; i < 32; i++)
{
if ( this->pieces[i] & ~(this->KING) == this->currentPlayer)
if (mayAttack(i))
return true;
}
return false;
}
I am getting memory access violation on the array of integer “pieces” because of the for loop. does anyone have a solution for this problem because I have to go through all the variables in the array ???
I really need your help guys.