mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Simplify code with offsetof.
Change-Id: I23c1904daecc85623c01198c1e71232454ef2bb3 Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
This commit is contained in:
@ -101,11 +101,7 @@ GEN10TEST_F(GEN10AUBParentKernelFixture, DISABLED_EnqueueParentKernel) {
|
|||||||
pCmdQ->finish(false);
|
pCmdQ->finish(false);
|
||||||
|
|
||||||
uint32_t expectedNumberOfEnqueues = 1;
|
uint32_t expectedNumberOfEnqueues = 1;
|
||||||
IGIL_CommandQueue *igilQueue = reinterpret_cast<IGIL_CommandQueue *>(devQueue->getQueueBuffer()->getUnderlyingBuffer());
|
uint64_t gpuAddress = devQueue->getQueueBuffer()->getGpuAddress() + offsetof(IGIL_CommandQueue, m_controls.m_TotalNumberOfQueues);
|
||||||
uint64_t gpuAddress = devQueue->getQueueBuffer()->getGpuAddress();
|
|
||||||
uint32_t *pointerTonumberOfEnqueues = &igilQueue->m_controls.m_TotalNumberOfQueues;
|
|
||||||
size_t offsetToEnqueues = ptrDiff(pointerTonumberOfEnqueues, igilQueue);
|
|
||||||
gpuAddress = gpuAddress + offsetToEnqueues;
|
|
||||||
|
|
||||||
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)gpuAddress, &expectedNumberOfEnqueues, sizeof(uint32_t));
|
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)gpuAddress, &expectedNumberOfEnqueues, sizeof(uint32_t));
|
||||||
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)buffer->getGraphicsAllocation()->getGpuAddress(), &argScalar, sizeof(size_t));
|
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)buffer->getGraphicsAllocation()->getGpuAddress(), &argScalar, sizeof(size_t));
|
||||||
|
@ -101,11 +101,7 @@ GEN11TEST_F(GEN11AUBParentKernelFixture, EnqueueParentKernel) {
|
|||||||
pCmdQ->finish(false);
|
pCmdQ->finish(false);
|
||||||
|
|
||||||
uint32_t expectedNumberOfEnqueues = 1;
|
uint32_t expectedNumberOfEnqueues = 1;
|
||||||
IGIL_CommandQueue *igilQueue = reinterpret_cast<IGIL_CommandQueue *>(devQueue->getQueueBuffer()->getUnderlyingBuffer());
|
uint64_t gpuAddress = devQueue->getQueueBuffer()->getGpuAddress() + offsetof(IGIL_CommandQueue, m_controls.m_TotalNumberOfQueues);
|
||||||
uint64_t gpuAddress = devQueue->getQueueBuffer()->getGpuAddress();
|
|
||||||
uint32_t *pointerTonumberOfEnqueues = &igilQueue->m_controls.m_TotalNumberOfQueues;
|
|
||||||
size_t offsetToEnqueues = ptrDiff(pointerTonumberOfEnqueues, igilQueue);
|
|
||||||
gpuAddress = gpuAddress + offsetToEnqueues;
|
|
||||||
|
|
||||||
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)gpuAddress, &expectedNumberOfEnqueues, sizeof(uint32_t));
|
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)gpuAddress, &expectedNumberOfEnqueues, sizeof(uint32_t));
|
||||||
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)buffer->getGraphicsAllocation()->getGpuAddress(), &argScalar, sizeof(size_t));
|
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)buffer->getGraphicsAllocation()->getGpuAddress(), &argScalar, sizeof(size_t));
|
||||||
|
@ -101,11 +101,7 @@ GEN8TEST_F(GEN8AUBParentKernelFixture, EnqueueParentKernel) {
|
|||||||
pCmdQ->finish(false);
|
pCmdQ->finish(false);
|
||||||
|
|
||||||
uint32_t expectedNumberOfEnqueues = 1;
|
uint32_t expectedNumberOfEnqueues = 1;
|
||||||
IGIL_CommandQueue *igilQueue = reinterpret_cast<IGIL_CommandQueue *>(devQueue->getQueueBuffer()->getUnderlyingBuffer());
|
uint64_t gpuAddress = devQueue->getQueueBuffer()->getGpuAddress() + offsetof(IGIL_CommandQueue, m_controls.m_TotalNumberOfQueues);
|
||||||
uint64_t gpuAddress = devQueue->getQueueBuffer()->getGpuAddress();
|
|
||||||
uint32_t *pointerTonumberOfEnqueues = &igilQueue->m_controls.m_TotalNumberOfQueues;
|
|
||||||
size_t offsetToEnqueues = ptrDiff(pointerTonumberOfEnqueues, igilQueue);
|
|
||||||
gpuAddress = gpuAddress + offsetToEnqueues;
|
|
||||||
|
|
||||||
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)gpuAddress, &expectedNumberOfEnqueues, sizeof(uint32_t));
|
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)gpuAddress, &expectedNumberOfEnqueues, sizeof(uint32_t));
|
||||||
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)buffer->getGraphicsAllocation()->getGpuAddress(), &argScalar, sizeof(size_t));
|
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)buffer->getGraphicsAllocation()->getGpuAddress(), &argScalar, sizeof(size_t));
|
||||||
|
@ -99,11 +99,7 @@ GEN9TEST_F(AUBParentKernelFixture, EnqueueParentKernel) {
|
|||||||
pCmdQ->finish(false);
|
pCmdQ->finish(false);
|
||||||
|
|
||||||
uint32_t expectedNumberOfEnqueues = 1;
|
uint32_t expectedNumberOfEnqueues = 1;
|
||||||
IGIL_CommandQueue *igilQueue = reinterpret_cast<IGIL_CommandQueue *>(devQueue->getQueueBuffer()->getUnderlyingBuffer());
|
uint64_t gpuAddress = devQueue->getQueueBuffer()->getGpuAddress() + offsetof(IGIL_CommandQueue, m_controls.m_TotalNumberOfQueues);
|
||||||
uint64_t gpuAddress = devQueue->getQueueBuffer()->getGpuAddress();
|
|
||||||
uint32_t *pointerTonumberOfEnqueues = &igilQueue->m_controls.m_TotalNumberOfQueues;
|
|
||||||
size_t offsetToEnqueues = ptrDiff(pointerTonumberOfEnqueues, igilQueue);
|
|
||||||
gpuAddress = gpuAddress + offsetToEnqueues;
|
|
||||||
|
|
||||||
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)gpuAddress, &expectedNumberOfEnqueues, sizeof(uint32_t));
|
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)gpuAddress, &expectedNumberOfEnqueues, sizeof(uint32_t));
|
||||||
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)buffer->getGraphicsAllocation()->getGpuAddress(), &argScalar, sizeof(size_t));
|
AUBCommandStreamFixture::expectMemory<FamilyType>((void *)(uintptr_t)buffer->getGraphicsAllocation()->getGpuAddress(), &argScalar, sizeof(size_t));
|
||||||
|
Reference in New Issue
Block a user