|  | 
| 31 | 31 | #include "test.h" | 
| 32 | 32 | #include "unit_tests/fixtures/device_fixture.h" | 
| 33 | 33 | #include "unit_tests/fixtures/memory_management_fixture.h" | 
| 34 |  | -#include "unit_tests/fixtures/platform_fixture.h" | 
| 35 | 34 | #include "unit_tests/gen_common/matchers.h" | 
| 36 | 35 | #include "unit_tests/helpers/debug_manager_state_restore.h" | 
| 37 | 36 | #include "unit_tests/helpers/memory_management.h" | 
| @@ -613,30 +612,25 @@ INSTANTIATE_TEST_CASE_P( | 
| 613 | 612 | 
 | 
| 614 | 613 | struct ValidHostPtr | 
| 615 | 614 |     : public BufferTest, | 
| 616 |  | -      public MemoryManagementFixture, | 
| 617 |  | -      public PlatformFixture { | 
|  | 615 | +      public MemoryManagementFixture { | 
| 618 | 616 |     typedef BufferTest BaseClass; | 
| 619 | 617 | 
 | 
| 620 | 618 |     using BufferTest::SetUp; | 
| 621 | 619 |     using MemoryManagementFixture::SetUp; | 
| 622 |  | -    using PlatformFixture::SetUp; | 
| 623 | 620 | 
 | 
| 624 | 621 |     ValidHostPtr() { | 
| 625 | 622 |     } | 
| 626 | 623 | 
 | 
| 627 | 624 |     void SetUp() override { | 
| 628 | 625 |         MemoryManagementFixture::SetUp(); | 
| 629 |  | -        PlatformFixture::SetUp(); | 
| 630 | 626 |         BaseClass::SetUp(); | 
| 631 | 627 | 
 | 
| 632 |  | -        auto pDevice = pPlatform->getDevice(0); | 
| 633 | 628 |         ASSERT_NE(nullptr, pDevice); | 
| 634 | 629 |     } | 
| 635 | 630 | 
 | 
| 636 | 631 |     void TearDown() override { | 
| 637 | 632 |         delete buffer; | 
| 638 | 633 |         BaseClass::TearDown(); | 
| 639 |  | -        PlatformFixture::TearDown(); | 
| 640 | 634 |         MemoryManagementFixture::TearDown(); | 
| 641 | 635 |     } | 
| 642 | 636 | 
 | 
| @@ -809,17 +803,17 @@ TEST_P(ValidHostPtr, failedAllocationInjection) { | 
| 809 | 803 | } | 
| 810 | 804 | 
 | 
| 811 | 805 | TEST_P(ValidHostPtr, SvmHostPtr) { | 
| 812 |  | -    const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo(); | 
|  | 806 | +    const DeviceInfo &devInfo = pDevice->getDeviceInfo(); | 
| 813 | 807 |     if (devInfo.svmCapabilities != 0) { | 
| 814 |  | -        auto ptr = clSVMAlloc(context.get(), CL_MEM_READ_WRITE, 64, 64); | 
|  | 808 | +        auto ptr = context->getSVMAllocsManager()->createSVMAlloc(64, false); | 
| 815 | 809 | 
 | 
| 816 | 810 |         auto bufferSvm = Buffer::create(context.get(), CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, 64, ptr, retVal); | 
| 817 | 811 |         EXPECT_NE(nullptr, bufferSvm); | 
| 818 | 812 |         EXPECT_TRUE(bufferSvm->isMemObjWithHostPtrSVM()); | 
| 819 | 813 |         EXPECT_EQ(context->getSVMAllocsManager()->getSVMAlloc(ptr), bufferSvm->getGraphicsAllocation()); | 
| 820 | 814 |         EXPECT_EQ(CL_SUCCESS, retVal); | 
| 821 | 815 | 
 | 
| 822 |  | -        clSVMFree(context.get(), ptr); | 
|  | 816 | +        context->getSVMAllocsManager()->freeSVMAlloc(ptr); | 
| 823 | 817 |         delete bufferSvm; | 
| 824 | 818 |     } | 
| 825 | 819 | } | 
|  | 
0 commit comments