mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 22:12:59 +08:00
Add Math::divideAndRoundUp usage
Change-Id: Iae7775a61f7d12dd43d9253498fe388956af2fc4 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
fcf2387398
commit
4d76fe93b0
@@ -57,7 +57,7 @@ class VmeBuiltinDispatchInfoBuilder : public BuiltinDispatchInfoBuilder {
|
||||
cl_int stride = height;
|
||||
size_t numThreadsX = gwWidthInBlk;
|
||||
const size_t simdWidth = vmeKernel->getKernelInfo().getMaxSimdSize();
|
||||
stride = (height * width + (cl_int)numThreadsX - 1) / (cl_int)numThreadsX;
|
||||
stride = static_cast<cl_int>(Math::divideAndRoundUp(height * width, numThreadsX));
|
||||
|
||||
// update implicit args
|
||||
vmeKernel->setArg(heightArgNum, sizeof(height), &height);
|
||||
|
||||
@@ -192,7 +192,7 @@ void choosePreferredWorkGroupSizeWithOutRatio(uint32_t xyzFactors[3][1024], uint
|
||||
workGroups *= Math::divideAndRoundUp(workItems[2], Zdim);
|
||||
cl_ulong euThrdsDispatched;
|
||||
|
||||
euThrdsDispatched = (Xdim * Ydim * Zdim + wsInfo.simdSize - 1) / wsInfo.simdSize;
|
||||
euThrdsDispatched = Math::divideAndRoundUp(Xdim * Ydim * Zdim, wsInfo.simdSize);
|
||||
euThrdsDispatched *= workGroups;
|
||||
|
||||
if (euThrdsDispatched < localEuThrdsDispatched) {
|
||||
@@ -274,7 +274,7 @@ void computeWorkgroupSize2D(uint32_t maxWorkGroupSize, size_t workGroupSize[3],
|
||||
workGroups *= Math::divideAndRoundUp(workItems[1], yDim);
|
||||
|
||||
// Compaction Mode!
|
||||
euThrdsDispatched = (xDim * yDim + simdSize - 1) / simdSize;
|
||||
euThrdsDispatched = Math::divideAndRoundUp(xDim * yDim, simdSize);
|
||||
euThrdsDispatched *= workGroups;
|
||||
|
||||
waste = simdSize - ((xDim * yDim - 1) & (simdSize - 1));
|
||||
|
||||
@@ -227,7 +227,7 @@ void AubFileStream::expectMemory(uint64_t physAddress, const void *memory, size_
|
||||
auto sizeThisIteration = std::min(sizeRemaining, blockSizeMax);
|
||||
|
||||
// Round up to the number of dwords
|
||||
auto dwordCount = (headerSize + sizeThisIteration + sizeof(uint32_t) - 1) / sizeof(uint32_t);
|
||||
auto dwordCount = Math::divideAndRoundUp(headerSize + sizeThisIteration, sizeof(uint32_t));
|
||||
|
||||
header.dwordCount = static_cast<uint32_t>(dwordCount - 1);
|
||||
header.dataSizeInBytes = static_cast<uint32_t>(sizeThisIteration);
|
||||
|
||||
Reference in New Issue
Block a user