I am trying to use gfor in a test function: it compiles fine, but when I try to execute it I receive the following exception:
src/gena/image.cpp:509: error: GFOR not supported
The code is the following:
- Code: Select all
array function_Test_GFOR(const array &refImg, const array &mTol) {
array imgRet = constant(255, refImg.dims(0), refImg.dims(1));
//Getting list of unique values in refImg
array greyLevUn = setunique(refImg);
int n = greyLevUn.elements();
gfor(array i, n) {
array greyLev = greyLevUn(i);
try {
array bInf = greyLev - mTol;
array bSup = greyLev + mTol;
array thresh = (refImgGF>=bInf)&(refImgGF<=bSup);
array binImgLab = regions(thresh, 8);
} catch (af::exception& e) {
fprintf(stderr, "%s\n", e.what());
throw;
}
}
return(imgRet);
}
Does anyone know what can be the issue here? I have tried setting n to 2, to assess if it was a problem of memory, but I get the same error.
Thank you very much in advance. BEst regards,
V.