mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Checking if the PrivateSurface Size exceeds UINT32_MAX
Change-Id: I75598d7b4bdbfe1648b7f03fd0878ed51824221b
This commit is contained in:
@ -260,8 +260,12 @@ cl_int Kernel::initialize() {
|
||||
if (privateSurfaceSize) {
|
||||
privateSurfaceSize *= device.getDeviceInfo().computeUnitsUsedForScratch * getKernelInfo().getMaxSimdSize();
|
||||
DEBUG_BREAK_IF(privateSurfaceSize == 0);
|
||||
if ((is32Bit() || device.getMemoryManager()->peekForce32BitAllocations()) && (privateSurfaceSize > std::numeric_limits<uint32_t>::max())) {
|
||||
retVal = CL_OUT_OF_RESOURCES;
|
||||
break;
|
||||
}
|
||||
|
||||
privateSurface = device.getMemoryManager()->createGraphicsAllocationWithRequiredBitness(privateSurfaceSize, nullptr);
|
||||
privateSurface = device.getMemoryManager()->createGraphicsAllocationWithRequiredBitness(static_cast<size_t>(privateSurfaceSize), nullptr);
|
||||
if (privateSurface == nullptr) {
|
||||
retVal = CL_OUT_OF_RESOURCES;
|
||||
break;
|
||||
|
@ -481,7 +481,7 @@ class Kernel : public BaseObject<_cl_kernel> {
|
||||
uint32_t crossThreadDataSize;
|
||||
|
||||
GraphicsAllocation *privateSurface;
|
||||
uint32_t privateSurfaceSize;
|
||||
uint64_t privateSurfaceSize;
|
||||
|
||||
GraphicsAllocation *kernelReflectionSurface;
|
||||
|
||||
|
Reference in New Issue
Block a user