Remove unnecessary casts.
Change-Id: I2d293d065c7efa006efe7d60a625cba0c6116c86
This commit is contained in:
parent
4b4b886eff
commit
e8a71132a4
|
@ -333,7 +333,7 @@ class CommandQueueHw : public CommandQueue {
|
|||
|
||||
protected:
|
||||
MOCKABLE_VIRTUAL void enqueueHandlerHook(const unsigned int commandType, const MultiDispatchInfo &dispatchInfo){};
|
||||
size_t calculateHostPtrSizeForImage(size_t *region, size_t rowPitch, size_t slicePitch, Image *image);
|
||||
size_t calculateHostPtrSizeForImage(const size_t *region, size_t rowPitch, size_t slicePitch, Image *image);
|
||||
|
||||
private:
|
||||
bool isTaskLevelUpdateRequired(const uint32_t &taskLevel, const cl_event *eventWaitList, const cl_uint &numEventsInWaitList, unsigned int commandType);
|
||||
|
|
|
@ -290,7 +290,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
|
|||
CompletionStamp completionStamp;
|
||||
if (!blockQueue) {
|
||||
if (parentKernel) {
|
||||
size_t minSizeSSHForEM = KernelCommandsHelper<GfxFamily>::template getSizeRequiredForExecutionModel<IndirectHeap::SURFACE_STATE>(const_cast<const Kernel &>(*parentKernel));
|
||||
size_t minSizeSSHForEM = KernelCommandsHelper<GfxFamily>::template getSizeRequiredForExecutionModel<IndirectHeap::SURFACE_STATE>(*parentKernel);
|
||||
|
||||
uint32_t taskCount = getCommandStreamReceiver().peekTaskCount() + 1;
|
||||
devQueueHw->setupExecutionModelDispatch(getIndirectHeap(IndirectHeap::SURFACE_STATE, minSizeSSHForEM),
|
||||
|
@ -406,7 +406,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
|
|||
|
||||
if (blockQueue) {
|
||||
if (parentKernel) {
|
||||
size_t minSizeSSHForEM = KernelCommandsHelper<GfxFamily>::template getSizeRequiredForExecutionModel<IndirectHeap::SURFACE_STATE>(const_cast<const Kernel &>(*parentKernel));
|
||||
size_t minSizeSSHForEM = KernelCommandsHelper<GfxFamily>::template getSizeRequiredForExecutionModel<IndirectHeap::SURFACE_STATE>(*parentKernel);
|
||||
blockedCommandsData->surfaceStateHeapSizeEM = minSizeSSHForEM;
|
||||
}
|
||||
|
||||
|
@ -730,7 +730,7 @@ void CommandQueueHw<GfxFamily>::computeOffsetsValueForRectCommands(size_t *buffe
|
|||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t CommandQueueHw<GfxFamily>::calculateHostPtrSizeForImage(size_t *region, size_t rowPitch, size_t slicePitch, Image *image) {
|
||||
size_t CommandQueueHw<GfxFamily>::calculateHostPtrSizeForImage(const size_t *region, size_t rowPitch, size_t slicePitch, Image *image) {
|
||||
auto bytesPerPixel = image->getSurfaceFormatInfo().ImageElementSizeInBytes;
|
||||
auto dstRowPitch = rowPitch ? rowPitch : region[0] * bytesPerPixel;
|
||||
auto dstSlicePitch = slicePitch ? slicePitch : ((image->getImageDesc().image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY ? 1 : region[1]) * dstRowPitch);
|
||||
|
|
|
@ -72,7 +72,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadImage(
|
|||
|
||||
BuiltInOwnershipWrapper builtInLock(builder, this->context);
|
||||
|
||||
size_t hostPtrSize = calculateHostPtrSizeForImage(const_cast<size_t *>(region), inputRowPitch, inputSlicePitch, srcImage);
|
||||
size_t hostPtrSize = calculateHostPtrSizeForImage(region, inputRowPitch, inputSlicePitch, srcImage);
|
||||
void *dstPtr = ptr;
|
||||
|
||||
MemObjSurface srcImgSurf(srcImage);
|
||||
|
|
|
@ -66,7 +66,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteImage(
|
|||
|
||||
BuiltInOwnershipWrapper lock(builder, this->context);
|
||||
|
||||
size_t hostPtrSize = calculateHostPtrSizeForImage(const_cast<size_t *>(region), inputRowPitch, inputSlicePitch, dstImage);
|
||||
size_t hostPtrSize = calculateHostPtrSizeForImage(region, inputRowPitch, inputSlicePitch, dstImage);
|
||||
void *srcPtr = const_cast<void *>(ptr);
|
||||
|
||||
MemObjSurface dstImgSurf(dstImage);
|
||||
|
|
|
@ -247,7 +247,7 @@ IndirectHeap &getIndirectHeap(CommandQueue &commandQueue, const MultiDispatchInf
|
|||
|
||||
if (Kernel *parentKernel = multiDispatchInfo.peekParentKernel()) {
|
||||
if (heapType == IndirectHeap::SURFACE_STATE) {
|
||||
expectedSize += KernelCommandsHelper<GfxFamily>::template getSizeRequiredForExecutionModel<heapType>(const_cast<const Kernel &>(*parentKernel));
|
||||
expectedSize += KernelCommandsHelper<GfxFamily>::template getSizeRequiredForExecutionModel<heapType>(*parentKernel);
|
||||
} else //if (heapType == IndirectHeap::DYNAMIC_STATE || heapType == IndirectHeap::INDIRECT_OBJECT)
|
||||
{
|
||||
DeviceQueueHw<GfxFamily> *pDevQueue = castToObject<DeviceQueueHw<GfxFamily>>(commandQueue.getContext().getDefaultDeviceQueue());
|
||||
|
|
|
@ -59,7 +59,7 @@ inline DerivedType *castToObjectOrAbort(typename DerivedType::BaseType *object)
|
|||
|
||||
template <typename DerivedType>
|
||||
inline const DerivedType *castToObject(const typename DerivedType::BaseType *object) {
|
||||
return const_cast<const DerivedType *>(castToObject<DerivedType>(const_cast<typename DerivedType::BaseType *>(object)));
|
||||
return castToObject<DerivedType>(const_cast<typename DerivedType::BaseType *>(object));
|
||||
}
|
||||
|
||||
template <typename DerivedType>
|
||||
|
|
|
@ -1939,7 +1939,7 @@ void Kernel::ReflectionSurfaceHelper::setParentImageParams(void *reflectionSurfa
|
|||
uint32_t numArgs = (uint32_t)parentArguments.size();
|
||||
for (uint32_t i = 0; i < numArgs; i++) {
|
||||
if (parentArguments[i].type == Kernel::kernelArgType::IMAGE_OBJ) {
|
||||
const Image *image = const_cast<const Image *>(castToObject<Image>((cl_mem)parentArguments[i].object));
|
||||
const Image *image = castToObject<Image>((cl_mem)parentArguments[i].object);
|
||||
if (image) {
|
||||
pImageParameters->m_ArraySize = (uint32_t)image->getImageDesc().image_array_size;
|
||||
pImageParameters->m_Depth = (uint32_t)image->getImageDesc().image_depth;
|
||||
|
@ -1964,7 +1964,7 @@ void Kernel::ReflectionSurfaceHelper::setParentSamplerParams(void *reflectionSur
|
|||
uint32_t numArgs = (uint32_t)parentArguments.size();
|
||||
for (uint32_t i = 0; i < numArgs; i++) {
|
||||
if (parentArguments[i].type == Kernel::kernelArgType::SAMPLER_OBJ) {
|
||||
const Sampler *sampler = const_cast<const Sampler *>(castToObject<Sampler>((cl_sampler)parentArguments[i].object));
|
||||
const Sampler *sampler = castToObject<Sampler>((cl_sampler)parentArguments[i].object);
|
||||
if (sampler) {
|
||||
pParentSamplerParams->CoordinateSnapRequired = (uint32_t)sampler->getSnapWaValue();
|
||||
pParentSamplerParams->m_AddressingMode = (uint32_t)sampler->addressingMode;
|
||||
|
|
|
@ -233,7 +233,7 @@ Buffer *Buffer::create(Context *context,
|
|||
properties.flags,
|
||||
size,
|
||||
memory->getUnderlyingBuffer(),
|
||||
const_cast<void *>(hostPtr),
|
||||
hostPtr,
|
||||
memory,
|
||||
zeroCopyAllowed,
|
||||
isHostPtrSVM,
|
||||
|
|
|
@ -573,7 +573,7 @@ cl_int Image::validateImageTraits(Context *context, cl_mem_flags flags, const cl
|
|||
return CL_SUCCESS;
|
||||
}
|
||||
|
||||
size_t Image::calculateHostPtrSize(size_t *region, size_t rowPitch, size_t slicePitch, size_t pixelSize, uint32_t imageType) {
|
||||
size_t Image::calculateHostPtrSize(const size_t *region, size_t rowPitch, size_t slicePitch, size_t pixelSize, uint32_t imageType) {
|
||||
DEBUG_BREAK_IF(!((rowPitch != 0) && (slicePitch != 0)));
|
||||
size_t sizeToReturn = 0u;
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ class Image : public MemObj {
|
|||
|
||||
static cl_int validateImageTraits(Context *context, cl_mem_flags flags, const cl_image_format *imageFormat, const cl_image_desc *imageDesc, const void *hostPtr);
|
||||
|
||||
static size_t calculateHostPtrSize(size_t *region, size_t rowPitch, size_t slicePitch, size_t pixelSize, uint32_t imageType);
|
||||
static size_t calculateHostPtrSize(const size_t *region, size_t rowPitch, size_t slicePitch, size_t pixelSize, uint32_t imageType);
|
||||
|
||||
static void calculateHostPtrOffset(size_t *imageOffset, const size_t *origin, const size_t *region, size_t rowPitch, size_t slicePitch, uint32_t imageType, size_t bytesPerPixel);
|
||||
|
||||
|
|
|
@ -78,10 +78,10 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
|
|||
auto pWaTable = std::unique_ptr<WorkaroundTable>(new WorkaroundTable);
|
||||
*pWaTable = *(inHwInfo->pWaTable);
|
||||
|
||||
outHwInfo->pPlatform = const_cast<const PLATFORM *>(pPlatform.get());
|
||||
outHwInfo->pSysInfo = const_cast<const GT_SYSTEM_INFO *>(pSysInfo.get());
|
||||
outHwInfo->pSkuTable = const_cast<const FeatureTable *>(pSkuTable.get());
|
||||
outHwInfo->pWaTable = const_cast<const WorkaroundTable *>(pWaTable.get());
|
||||
outHwInfo->pPlatform = pPlatform.get();
|
||||
outHwInfo->pSysInfo = pSysInfo.get();
|
||||
outHwInfo->pSkuTable = pSkuTable.get();
|
||||
outHwInfo->pWaTable = pWaTable.get();
|
||||
outHwInfo->capabilityTable = inHwInfo->capabilityTable;
|
||||
|
||||
int val = 0;
|
||||
|
|
|
@ -161,42 +161,42 @@ TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCountWithNullReturnExpectPas
|
|||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCount1ExpectPass) {
|
||||
cl_uint parm_value = static_cast<cl_uint>(-1);
|
||||
cl_uint param_value = static_cast<cl_uint>(-1);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
|
||||
sizeof(cl_uint),
|
||||
reinterpret_cast<void *>(&parm_value),
|
||||
¶m_value,
|
||||
nullptr);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(1u, parm_value);
|
||||
EXPECT_EQ(1u, param_value);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCountWithLongReturnExpectPass) {
|
||||
cl_uint parm_value = static_cast<cl_uint>(-1);
|
||||
cl_uint param_value = static_cast<cl_uint>(-1);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
|
||||
sizeof(cl_uint) + 1,
|
||||
reinterpret_cast<void *>(&parm_value),
|
||||
¶m_value,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_uint), param_value_size_ret);
|
||||
EXPECT_EQ(1u, parm_value);
|
||||
EXPECT_EQ(1u, param_value);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCountWithShortReturnExpectFail) {
|
||||
cl_uint parm_value = static_cast<cl_uint>(-1);
|
||||
cl_uint param_value = static_cast<cl_uint>(-1);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
|
||||
sizeof(cl_uint) - 1,
|
||||
reinterpret_cast<void *>(&parm_value),
|
||||
¶m_value,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
|
@ -215,7 +215,7 @@ TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCountSizeQueryExpectPass) {
|
|||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCount2ExpectPass) {
|
||||
cl_uint parm_value = static_cast<cl_uint>(-1);
|
||||
cl_uint param_value = static_cast<cl_uint>(-1);
|
||||
|
||||
result = clRetainAcceleratorINTEL(accelerator);
|
||||
ASSERT_EQ(CL_SUCCESS, result);
|
||||
|
@ -224,11 +224,11 @@ TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCount2ExpectPass) {
|
|||
accelerator,
|
||||
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
|
||||
sizeof(cl_uint),
|
||||
reinterpret_cast<void *>(&parm_value),
|
||||
¶m_value,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(2u, parm_value);
|
||||
EXPECT_EQ(2u, param_value);
|
||||
|
||||
result = clReleaseAcceleratorINTEL(accelerator);
|
||||
|
||||
|
@ -238,11 +238,11 @@ TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCount2ExpectPass) {
|
|||
accelerator,
|
||||
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
|
||||
sizeof(cl_uint),
|
||||
reinterpret_cast<void *>(&parm_value),
|
||||
¶m_value,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(1u, parm_value);
|
||||
EXPECT_EQ(1u, param_value);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GetInfoContextNullReturnExpectPass) {
|
||||
|
@ -258,13 +258,13 @@ TEST_F(IntelAcceleratorGetInfoTest, GetInfoContextNullReturnExpectPass) {
|
|||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GetInfoContextLongExpectPass) {
|
||||
cl_context parm_value = reinterpret_cast<cl_context>(-1);
|
||||
cl_context param_value = reinterpret_cast<cl_context>(-1);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_CONTEXT_INTEL,
|
||||
sizeof(cl_context) + 1,
|
||||
reinterpret_cast<void *>(&parm_value),
|
||||
¶m_value,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
|
@ -272,30 +272,30 @@ TEST_F(IntelAcceleratorGetInfoTest, GetInfoContextLongExpectPass) {
|
|||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GetInfoContextLongExpectRightContext) {
|
||||
cl_context parm_value = reinterpret_cast<cl_context>(-1);
|
||||
cl_context param_value = reinterpret_cast<cl_context>(-1);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_CONTEXT_INTEL,
|
||||
sizeof(cl_context),
|
||||
reinterpret_cast<void *>(&parm_value),
|
||||
¶m_value,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(sizeof(cl_context), param_value_size_ret);
|
||||
|
||||
cl_context referenceContext = static_cast<cl_context>(pContext);
|
||||
EXPECT_EQ(referenceContext, parm_value);
|
||||
EXPECT_EQ(referenceContext, param_value);
|
||||
}
|
||||
|
||||
TEST_F(IntelAcceleratorGetInfoTest, GetInfoContextShortExpectPass) {
|
||||
cl_context parm_value = reinterpret_cast<cl_context>(-1);
|
||||
cl_context param_value = reinterpret_cast<cl_context>(-1);
|
||||
|
||||
result = clGetAcceleratorInfoINTEL(
|
||||
accelerator,
|
||||
CL_ACCELERATOR_CONTEXT_INTEL,
|
||||
sizeof(cl_context) - 1,
|
||||
reinterpret_cast<void *>(&parm_value),
|
||||
¶m_value,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
|
|
|
@ -247,7 +247,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoDescriptorExactExpectPass) {
|
|||
accelerator,
|
||||
CL_ACCELERATOR_DESCRIPTOR_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel), // exact
|
||||
reinterpret_cast<void *>(&descReturn),
|
||||
&descReturn,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
|
@ -264,7 +264,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoDescriptorShortExpectFail) {
|
|||
accelerator,
|
||||
CL_ACCELERATOR_DESCRIPTOR_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel) - 1, // short
|
||||
reinterpret_cast<void *>(&descReturn),
|
||||
&descReturn,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
|
@ -276,7 +276,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoDescriptorVeryShortExpectFail) {
|
|||
accelerator,
|
||||
CL_ACCELERATOR_DESCRIPTOR_INTEL,
|
||||
0, // very short
|
||||
reinterpret_cast<void *>(&descReturn),
|
||||
&descReturn,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
|
@ -288,7 +288,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoDescriptorLongExpectPass) {
|
|||
accelerator,
|
||||
CL_ACCELERATOR_DESCRIPTOR_INTEL,
|
||||
sizeof(cl_motion_estimation_desc_intel) + 1, // long
|
||||
reinterpret_cast<void *>(&descReturn),
|
||||
&descReturn,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
|
@ -314,7 +314,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoTypeExpectPass) {
|
|||
accelerator,
|
||||
CL_ACCELERATOR_TYPE_INTEL,
|
||||
sizeof(cl_uint),
|
||||
reinterpret_cast<void *>(&type_returned),
|
||||
&type_returned,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
|
@ -328,7 +328,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoTypeExactExpectPass) {
|
|||
accelerator,
|
||||
CL_ACCELERATOR_TYPE_INTEL,
|
||||
sizeof(cl_uint), // exact
|
||||
reinterpret_cast<void *>(&type_returned),
|
||||
&type_returned,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
|
@ -342,7 +342,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoTypeShortExpectFail) {
|
|||
accelerator,
|
||||
CL_ACCELERATOR_TYPE_INTEL,
|
||||
sizeof(cl_uint) - 1, // short
|
||||
reinterpret_cast<void *>(&type_returned),
|
||||
&type_returned,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
|
@ -354,7 +354,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoTypeVeryShortExpectFail) {
|
|||
accelerator,
|
||||
CL_ACCELERATOR_TYPE_INTEL,
|
||||
0, // very short
|
||||
reinterpret_cast<void *>(&type_returned),
|
||||
&type_returned,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, result);
|
||||
|
@ -366,7 +366,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoTypeLongExpectPass) {
|
|||
accelerator,
|
||||
CL_ACCELERATOR_TYPE_INTEL,
|
||||
sizeof(cl_uint) + 1, // long
|
||||
reinterpret_cast<void *>(&type_returned),
|
||||
&type_returned,
|
||||
¶m_value_size_ret);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
|
|
|
@ -17,7 +17,7 @@ TEST(LrcaHelper, WhenLrcaHelperIsInitializedThenLrcaIncludesDebugModeLri) {
|
|||
|
||||
auto lrcaBufferSize = helper.sizeLRCA / sizeof(uint32_t);
|
||||
auto lrca = std::unique_ptr<uint32_t[]>(new uint32_t[lrcaBufferSize]);
|
||||
helper.initialize(reinterpret_cast<void *>(lrca.get()));
|
||||
helper.initialize(lrca.get());
|
||||
|
||||
bool debugModeLriFound = false;
|
||||
for (uint32_t i = 0; i < lrcaBufferSize; i += 2) {
|
||||
|
|
|
@ -207,7 +207,7 @@ TEST_F(AsyncEventsHandlerTests, givenEventsNotHandledByHandlderWhenAsyncExecutio
|
|||
EXPECT_EQ(3, event1->getRefInternalCount());
|
||||
EXPECT_EQ(3, event2->getRefInternalCount());
|
||||
handler->allowAsyncProcess.store(false);
|
||||
MockHandler::asyncProcess(reinterpret_cast<void *>(handler.get())); // enter and exit because of allowAsyncProcess == false
|
||||
MockHandler::asyncProcess(handler.get()); // enter and exit because of allowAsyncProcess == false
|
||||
EXPECT_EQ(2, event1->getRefInternalCount());
|
||||
EXPECT_EQ(2, event2->getRefInternalCount());
|
||||
EXPECT_TRUE(handler->peekIsListEmpty());
|
||||
|
@ -349,7 +349,7 @@ TEST_F(AsyncEventsHandlerTests, givenSleepCandidateWhenProcessedThenCallWaitWith
|
|||
|
||||
EXPECT_CALL(*event1, wait(true, true)).Times(1).WillOnce(Invoke(unsetAsyncFlag));
|
||||
|
||||
MockHandler::asyncProcess(reinterpret_cast<void *>(handler.get()));
|
||||
MockHandler::asyncProcess(handler.get());
|
||||
|
||||
event1->setStatus(CL_COMPLETE);
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ TEST_F(AsyncEventsHandlerTests, asyncProcessCallsProcessListBeforeReturning) {
|
|||
handler->registerEvent(event);
|
||||
handler->allowAsyncProcess.store(false);
|
||||
|
||||
MockHandler::asyncProcess(reinterpret_cast<void *>(handler.get()));
|
||||
MockHandler::asyncProcess(handler.get());
|
||||
EXPECT_TRUE(handler->peekIsListEmpty());
|
||||
EXPECT_EQ(1, event->getRefInternalCount());
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ TEST(castToSamplerTest, GivenGenericPointerWhichHoldsSamplerObjectWhenCastToSamp
|
|||
TEST(castToSamplerTest, GivenGenericPointerWhichDoestNotHoldSamplerObjectWhenCastToSamplerIsCalledThenCastWithAFailure) {
|
||||
auto context = std::make_unique<MockContext>();
|
||||
auto notSamplerObj = std::unique_ptr<Image>(ImageHelper<Image2dDefaults>::create(context.get()));
|
||||
auto ptr = reinterpret_cast<void *>(notSamplerObj.get());
|
||||
void *ptr = notSamplerObj.get();
|
||||
auto notSampler = castToObject<Sampler>(ptr);
|
||||
|
||||
EXPECT_EQ(nullptr, notSampler);
|
||||
|
|
Loading…
Reference in New Issue