You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
roundToMultipleOf() doesn't round to next multiple, it rounds to an exact or previous multiple.
say if t=100 & devInfo.maxWGSize=64, roundToMultipleOf(t, devInfo.maxWGSize) would be 64
In compute tests, following pattern is used:
clpeak/src/compute_sp.cpp
Line 24 in bcc21dc
uint64_t globalWIs = (devInfo.numCUs) * (devInfo.computeWgsPerCU) * (devInfo.maxWGSize);
uint64_t t = MIN((globalWIs * sizeof(cl_float)), devInfo.maxAllocSize) / sizeof(cl_float);
globalWIs = roundToMultipleOf(t, devInfo.maxWGSize);
cl::Buffer outputBuf = cl::Buffer(ctx, CL_MEM_WRITE_ONLY, (globalWIs * sizeof(cl_float)));
t is computed as minimal of globalWIs * sizeof(cl_float) and maxAllocSize, let's assume that maxAllocSize is smaller.
in next line globalWIs is rounded to the next multiple of maxWGSize, it means it may be larger then t which is computed using maxAllocSize.
That will cause the buffer creation to fail, as it will be above maxAllocSize.
The text was updated successfully, but these errors were encountered: