Hello, I am testing flowing code, and have a question:
Why T[adr]
value is not increasing (at line T[adr] += 1.f;
) with every iteration?
{
myQueue.submit([&](handler &cgh) {
stream out(1024, 256, cgh);
auto T = TBuff.get_access<access::mode::read_write>(cgh);
auto myRange = nd_range<2>(range<2>(size, size), range<2>(size / 4, size / 4));
auto myKernel1 = ([=](nd_item<2> item) {
uint x = item.get_global_id()[0];
uint y = item.get_global_id()[1];
if (x < size && y < size)
{
uint adrT = i*size*size;
uint adr = adrT + y * size + x;
if (x > 0 && x < size - 1 && y > 0 && y < size - 1)
{
T[adr] += 1.f;
}
}
});
cgh.parallel_for<kernel1Name>(myRange, myKernel1);
});
}
}```