mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Remove Platform::getDevice function
Related-To: NEO-3938 Change-Id: Ib93df97573ef2984913e057d165a84404349fd63 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
dd53734c0d
commit
819896bca2
@ -188,19 +188,6 @@ bool Platform::isInitialized() {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Device *Platform::getDevice(size_t deviceOrdinal) {
|
||||
TakeOwnershipWrapper<Platform> platformOwnership(*this);
|
||||
|
||||
if (this->state != StateInited || deviceOrdinal >= clDevices.size()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto pDevice = &clDevices[deviceOrdinal]->getDevice();
|
||||
DEBUG_BREAK_IF(pDevice == nullptr);
|
||||
|
||||
return pDevice;
|
||||
}
|
||||
|
||||
ClDevice *Platform::getClDevice(size_t deviceOrdinal) {
|
||||
TakeOwnershipWrapper<Platform> platformOwnership(*this);
|
||||
|
||||
|
@ -51,7 +51,6 @@ class Platform : public BaseObject<_cl_platform_id> {
|
||||
bool isInitialized();
|
||||
|
||||
size_t getNumDevices() const;
|
||||
Device *getDevice(size_t deviceOrdinal);
|
||||
ClDevice **getClDevices();
|
||||
ClDevice *getClDevice(size_t deviceOrdinal);
|
||||
|
||||
|
@ -95,7 +95,7 @@ TEST_F(clGetDeviceInfoTests, givenOpenCLDeviceWhenAskedForSupportedSvmTypeCorrec
|
||||
nullptr);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
const HardwareInfo &hwInfo = pPlatform->getDevice(testedRootDeviceIndex)->getHardwareInfo();
|
||||
const HardwareInfo &hwInfo = pPlatform->getClDevice(testedRootDeviceIndex)->getHardwareInfo();
|
||||
|
||||
cl_device_svm_capabilities expectedCaps = 0;
|
||||
if (hwInfo.capabilityTable.ftrSvm != 0) {
|
||||
|
@ -116,7 +116,7 @@ TEST_F(clGetPlatformInfoTests, GivenClPlatformHostTimerResolutionWhenGettingPlat
|
||||
retVal = clGetPlatformInfo(pPlatform, CL_PLATFORM_HOST_TIMER_RESOLUTION, retSize, &value, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
auto device = pPlatform->getDevice(0);
|
||||
auto device = pPlatform->getClDevice(0);
|
||||
cl_ulong resolution = static_cast<cl_ulong>(device->getPlatformHostTimerResolution());
|
||||
EXPECT_EQ(resolution, value);
|
||||
}
|
||||
|
@ -662,7 +662,7 @@ TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagWhenEnqueueUnmapIsCalling
|
||||
}
|
||||
|
||||
TEST_F(PerformanceHintEnqueueTest, GivenSVMPointerWhenEnqueueSVMMapIsCallingThenContextProvidesProperHint) {
|
||||
if (!pPlatform->getDevice(0)->getHardwareInfo().capabilityTable.ftrSvm) {
|
||||
if (!pPlatform->getClDevice(0)->getHardwareInfo().capabilityTable.ftrSvm) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
void *svmPtr = context->getSVMAllocsManager()->createSVMAlloc(0, 256, {});
|
||||
@ -778,7 +778,7 @@ TEST_P(PerformanceHintEnqueueKernelBadSizeTest, GivenBadLocalWorkGroupSizeWhenEn
|
||||
|
||||
TEST_F(PerformanceHintEnqueueKernelPrintfTest, GivenKernelWithPrintfWhenEnqueueKernelIsCalledWithWorkDim3ThenContextProvidesProperHint) {
|
||||
size_t preferredWorkGroupSize[3];
|
||||
auto maxWorkGroupSize = static_cast<uint32_t>(pPlatform->getDevice(0)->getDeviceInfo().maxWorkGroupSize);
|
||||
auto maxWorkGroupSize = static_cast<uint32_t>(pPlatform->getClDevice(0)->getSharedDeviceInfo().maxWorkGroupSize);
|
||||
if (DebugManager.flags.EnableComputeWorkSizeND.get()) {
|
||||
WorkSizeInfo wsInfo(maxWorkGroupSize, 0u, 32u, 0u, IGFX_GEN9_CORE, 32u, 0u, false, false);
|
||||
computeWorkgroupSizeND(wsInfo, preferredWorkGroupSize, globalWorkGroupSize, 2);
|
||||
@ -794,7 +794,7 @@ TEST_F(PerformanceHintEnqueueKernelPrintfTest, GivenKernelWithPrintfWhenEnqueueK
|
||||
TEST_F(PerformanceHintEnqueueTest, GivenKernelWithCoherentPtrWhenEnqueueKernelIsCalledWithWorkDim2ThenContextProvidesProperHint) {
|
||||
size_t preferredWorkGroupSize[3];
|
||||
size_t globalWorkGroupSize[3] = {1, 1, 1};
|
||||
auto maxWorkGroupSize = static_cast<uint32_t>(pPlatform->getDevice(0)->getDeviceInfo().maxWorkGroupSize);
|
||||
auto maxWorkGroupSize = static_cast<uint32_t>(pPlatform->getClDevice(0)->getSharedDeviceInfo().maxWorkGroupSize);
|
||||
MockKernelWithInternals mockKernel(*pPlatform->getClDevice(0), context);
|
||||
Kernel::SimpleKernelArgInfo kernelArgInfo;
|
||||
|
||||
|
@ -82,7 +82,7 @@ class D3D9Tests : public PlatformFixture, public ::testing::Test {
|
||||
imgDesc.image_depth = 1;
|
||||
imgDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
|
||||
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr);
|
||||
gmm = MockGmm::queryImgParams(pPlatform->getDevice(0)->getGmmClientContext(), imgInfo).release();
|
||||
gmm = MockGmm::queryImgParams(pPlatform->getClDevice(0)->getGmmClientContext(), imgInfo).release();
|
||||
mockGmmResInfo = reinterpret_cast<NiceMock<MockGmmResourceInfo> *>(gmm->gmmResourceInfo.get());
|
||||
|
||||
memoryManager->forceGmm = gmm;
|
||||
|
@ -108,8 +108,8 @@ TEST(SubDevicesTest, givenCreateMultipleRootDevicesFlagsEnabledWhenDevicesAreCre
|
||||
VariableBackup<UltHwConfig> backup{&ultHwConfig};
|
||||
ultHwConfig.useMockedGetDevicesFunc = false;
|
||||
initPlatform();
|
||||
EXPECT_EQ(0u, platform()->getDevice(0)->getRootDeviceIndex());
|
||||
EXPECT_EQ(1u, platform()->getDevice(1)->getRootDeviceIndex());
|
||||
EXPECT_EQ(0u, platform()->getClDevice(0)->getRootDeviceIndex());
|
||||
EXPECT_EQ(1u, platform()->getClDevice(1)->getRootDeviceIndex());
|
||||
}
|
||||
|
||||
TEST(SubDevicesTest, givenRootDeviceWithSubDevicesWhenOsContextIsCreatedThenItsBitfieldBasesOnSubDevicesCount) {
|
||||
|
@ -54,17 +54,16 @@ TEST(ExecutionEnvironment, givenPlatformAndExecutionEnvironmentWithRefCountsWhen
|
||||
executionEnvironment->decRefInternal();
|
||||
}
|
||||
|
||||
TEST(ExecutionEnvironment, givenPlatformWhenItIsInitializedAndCreatesDevicesThenThoseDevicesAddRefcountsToExecutionEnvironment) {
|
||||
TEST(ExecutionEnvironment, WhenCreatingDevicesThenThoseDevicesAddRefcountsToExecutionEnvironment) {
|
||||
auto executionEnvironment = new ExecutionEnvironment();
|
||||
std::unique_ptr<Platform> platform(new Platform(*executionEnvironment));
|
||||
|
||||
auto expectedRefCounts = executionEnvironment->getRefInternalCount();
|
||||
platform->initialize(DeviceFactory::createDevices(*executionEnvironment));
|
||||
EXPECT_LT(0u, platform->getDevice(0)->getNumAvailableDevices());
|
||||
if (platform->getDevice(0)->getNumAvailableDevices() > 1) {
|
||||
auto devices = DeviceFactory::createDevices(*executionEnvironment);
|
||||
EXPECT_LT(0u, devices[0]->getNumAvailableDevices());
|
||||
if (devices[0]->getNumAvailableDevices() > 1) {
|
||||
expectedRefCounts++;
|
||||
}
|
||||
expectedRefCounts += platform->getDevice(0)->getNumAvailableDevices();
|
||||
expectedRefCounts += devices[0]->getNumAvailableDevices();
|
||||
EXPECT_EQ(expectedRefCounts, executionEnvironment->getRefInternalCount());
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
|
||||
#include "opencl/source/device/cl_device.h"
|
||||
#include "opencl/test/unit_test/fixtures/platform_fixture.h"
|
||||
#include "test.h"
|
||||
|
||||
@ -24,7 +23,7 @@ struct Gen9PlatformCaps : public PlatformFixture, public ::testing::Test {
|
||||
|
||||
GEN9TEST_F(Gen9PlatformCaps, allSkusSupportFP64) {
|
||||
const auto &caps = pPlatform->getPlatformInfo();
|
||||
if (pPlatform->getDevice(0)->getHardwareInfo().capabilityTable.ftrSupportsFP64) {
|
||||
if (pPlatform->getClDevice(0)->getHardwareInfo().capabilityTable.ftrSupportsFP64) {
|
||||
EXPECT_NE(std::string::npos, caps.extensions.find(std::string("cl_khr_fp64")));
|
||||
} else {
|
||||
EXPECT_EQ(std::string::npos, caps.extensions.find(std::string("cl_khr_fp64")));
|
||||
@ -34,7 +33,7 @@ GEN9TEST_F(Gen9PlatformCaps, allSkusSupportFP64) {
|
||||
GEN9TEST_F(Gen9PlatformCaps, SKLVersion) {
|
||||
char *paramValue = new char[12];
|
||||
cl_int retVal = clGetPlatformInfo(pPlatform, CL_PLATFORM_VERSION, 12, paramValue, nullptr);
|
||||
if (pPlatform->getDevice(0)->getHardwareInfo().platform.eProductFamily == IGFX_SKYLAKE) {
|
||||
if (pPlatform->getClDevice(0)->getHardwareInfo().platform.eProductFamily == IGFX_SKYLAKE) {
|
||||
EXPECT_STREQ(paramValue, "OpenCL 2.1 ");
|
||||
}
|
||||
EXPECT_EQ(retVal, CL_SUCCESS);
|
||||
@ -44,7 +43,7 @@ GEN9TEST_F(Gen9PlatformCaps, SKLVersion) {
|
||||
GEN9TEST_F(Gen9PlatformCaps, BXTVersion) {
|
||||
char *paramValue = new char[12];
|
||||
cl_int retVal = clGetPlatformInfo(pPlatform, CL_PLATFORM_VERSION, 12, paramValue, nullptr);
|
||||
if (pPlatform->getDevice(0)->getHardwareInfo().platform.eProductFamily == IGFX_BROXTON) {
|
||||
if (pPlatform->getClDevice(0)->getHardwareInfo().platform.eProductFamily == IGFX_BROXTON) {
|
||||
EXPECT_STREQ(paramValue, "OpenCL 1.2 ");
|
||||
}
|
||||
EXPECT_EQ(retVal, CL_SUCCESS);
|
||||
|
@ -66,7 +66,7 @@ TEST_P(KernelReflectionSurfaceTest, GivenEmptyKernelInfoWhenPassedToGetCurbePara
|
||||
std::vector<IGIL_KernelCurbeParams> curbeParamsForBlock;
|
||||
uint64_t tokenMask = 0;
|
||||
uint32_t firstSSHTokenIndex = 0;
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParamsForBlock, tokenMask, firstSSHTokenIndex, info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParamsForBlock, tokenMask, firstSSHTokenIndex, info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
// 3 params with Binding Table index of type 1024
|
||||
EXPECT_EQ(3u, curbeParamsForBlock.size());
|
||||
@ -114,7 +114,7 @@ TEST_P(KernelReflectionSurfaceTest, GivenKernelInfoWithCorrectlyFilledImageArgum
|
||||
std::vector<IGIL_KernelCurbeParams> curbeParams;
|
||||
uint64_t tokenMask = 0;
|
||||
uint32_t firstSSHTokenIndex = 0;
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
std::vector<uint32_t> supportedImageParamTypes = {iOpenCL::DATA_PARAMETER_IMAGE_WIDTH,
|
||||
iOpenCL::DATA_PARAMETER_IMAGE_HEIGHT,
|
||||
@ -201,7 +201,7 @@ HWTEST_P(KernelReflectionSurfaceTest, GivenKernelInfoWithSetBindingTableStateAnd
|
||||
std::vector<IGIL_KernelCurbeParams> curbeParams;
|
||||
uint64_t tokenMask = 0;
|
||||
uint32_t firstSSHTokenIndex = 0;
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
EXPECT_NE(0u, curbeParams.size());
|
||||
bool foundProperParam = false;
|
||||
@ -253,7 +253,7 @@ HWTEST_P(KernelReflectionSurfaceTest, GivenKernelInfoWithBindingTableStateAndIma
|
||||
std::vector<IGIL_KernelCurbeParams> curbeParams;
|
||||
uint64_t tokenMask = 0;
|
||||
uint32_t firstSSHTokenIndex = 0;
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
EXPECT_EQ(1u, curbeParams.size());
|
||||
bool foundProperParam = false;
|
||||
@ -296,7 +296,7 @@ TEST_P(KernelReflectionSurfaceTest, GivenKernelInfoWithCorrectlyFilledSamplerArg
|
||||
std::vector<IGIL_KernelCurbeParams> curbeParams;
|
||||
uint64_t tokenMask = 0;
|
||||
uint32_t firstSSHTokenIndex = 0;
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
std::vector<uint32_t> supportedSamplerParamTypes = {iOpenCL::DATA_PARAMETER_SAMPLER_ADDRESS_MODE,
|
||||
iOpenCL::DATA_PARAMETER_SAMPLER_NORMALIZED_COORDS,
|
||||
@ -347,7 +347,7 @@ TEST_P(KernelReflectionSurfaceTest, GivenKernelInfoWithBufferAndDataParameterBuf
|
||||
std::vector<IGIL_KernelCurbeParams> curbeParams;
|
||||
uint64_t tokenMask = 0;
|
||||
uint32_t firstSSHTokenIndex = 0;
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
EXPECT_LT(1u, curbeParams.size());
|
||||
bool kernelArgumentTokenFound = false;
|
||||
@ -389,7 +389,7 @@ TEST_P(KernelReflectionSurfaceTest, GivenKernelInfoWithBufferAndNoDataParameterB
|
||||
std::vector<IGIL_KernelCurbeParams> curbeParams;
|
||||
uint64_t tokenMask = 0;
|
||||
uint32_t firstSSHTokenIndex = 0;
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
bool kernelArgumentTokenFound = false;
|
||||
for (const auto &curbeParam : curbeParams) {
|
||||
@ -429,7 +429,7 @@ TEST_P(KernelReflectionSurfaceTest, GivenKernelInfoWithLocalMemoryParameterWhenP
|
||||
std::vector<IGIL_KernelCurbeParams> curbeParams;
|
||||
uint64_t tokenMask = 0;
|
||||
uint32_t firstSSHTokenIndex = 0;
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
bool localMemoryTokenFound = false;
|
||||
for (const auto &curbeParam : curbeParams) {
|
||||
@ -472,7 +472,7 @@ TEST_P(KernelReflectionSurfaceTest, GivenKernelInfoWithoutLocalMemoryParameterWh
|
||||
std::vector<IGIL_KernelCurbeParams> curbeParams;
|
||||
uint64_t tokenMask = 0;
|
||||
uint32_t firstSSHTokenIndex = 0;
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
bool localMemoryTokenFound = false;
|
||||
for (const auto &curbeParam : curbeParams) {
|
||||
@ -933,7 +933,7 @@ TEST_P(KernelReflectionSurfaceTest, GivenKernelInfoWithExecutionParametersWhenPa
|
||||
std::vector<IGIL_KernelCurbeParams> curbeParams;
|
||||
uint64_t tokenMask = 0;
|
||||
uint32_t firstSSHTokenIndex = 0;
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::getCurbeParams(curbeParams, tokenMask, firstSSHTokenIndex, info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
EXPECT_LE(supportedExecutionParamTypes.size(), curbeParams.size());
|
||||
|
||||
@ -1318,12 +1318,12 @@ TEST_P(ReflectionSurfaceHelperSetKernelDataTest, setKernelData) {
|
||||
|
||||
size_t maxConstantBufferSize = 32;
|
||||
size_t samplerCount = 1;
|
||||
size_t samplerHeapSize = alignUp(info.getSamplerStateArraySize(pPlatform->getDevice(0)->getHardwareInfo()), Sampler::samplerStateArrayAlignment) + info.getBorderColorStateSize();
|
||||
size_t samplerHeapSize = alignUp(info.getSamplerStateArraySize(pPlatform->getClDevice(0)->getHardwareInfo()), Sampler::samplerStateArrayAlignment) + info.getBorderColorStateSize();
|
||||
|
||||
uint32_t offsetInKernelDataMemory = 12;
|
||||
uint32_t offset = MockKernel::ReflectionSurfaceHelperPublic::setKernelData(kernelDataMemory.get(), offsetInKernelDataMemory,
|
||||
curbeParams, tokenMask, maxConstantBufferSize, samplerCount,
|
||||
info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
IGIL_KernelData *kernelData = reinterpret_cast<IGIL_KernelData *>(kernelDataMemory.get() + offsetInKernelDataMemory);
|
||||
|
||||
@ -1373,12 +1373,12 @@ TEST_F(ReflectionSurfaceHelperSetKernelDataTest, nullExecutionEnvironment) {
|
||||
|
||||
size_t maxConstantBufferSize = 32;
|
||||
size_t samplerCount = 1;
|
||||
size_t samplerHeapSize = alignUp(info.getSamplerStateArraySize(pPlatform->getDevice(0)->getHardwareInfo()), Sampler::samplerStateArrayAlignment) + info.getBorderColorStateSize();
|
||||
size_t samplerHeapSize = alignUp(info.getSamplerStateArraySize(pPlatform->getClDevice(0)->getHardwareInfo()), Sampler::samplerStateArrayAlignment) + info.getBorderColorStateSize();
|
||||
|
||||
uint32_t offsetInKernelDataMemory = 0;
|
||||
uint32_t offset = MockKernel::ReflectionSurfaceHelperPublic::setKernelData(kernelDataMemory.get(), offsetInKernelDataMemory,
|
||||
curbeParams, tokenMask, maxConstantBufferSize, samplerCount,
|
||||
info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
IGIL_KernelData *kernelData = reinterpret_cast<IGIL_KernelData *>(kernelDataMemory.get() + offsetInKernelDataMemory);
|
||||
|
||||
@ -1403,12 +1403,12 @@ TEST_F(ReflectionSurfaceHelperSetKernelDataTest, nullThreadPayload) {
|
||||
|
||||
size_t maxConstantBufferSize = 32;
|
||||
size_t samplerCount = 1;
|
||||
size_t samplerHeapSize = alignUp(info.getSamplerStateArraySize(pPlatform->getDevice(0)->getHardwareInfo()), Sampler::samplerStateArrayAlignment) + info.getBorderColorStateSize();
|
||||
size_t samplerHeapSize = alignUp(info.getSamplerStateArraySize(pPlatform->getClDevice(0)->getHardwareInfo()), Sampler::samplerStateArrayAlignment) + info.getBorderColorStateSize();
|
||||
|
||||
uint32_t offsetInKernelDataMemory = 0;
|
||||
uint32_t offset = MockKernel::ReflectionSurfaceHelperPublic::setKernelData(kernelDataMemory.get(), offsetInKernelDataMemory,
|
||||
curbeParams, tokenMask, maxConstantBufferSize, samplerCount,
|
||||
info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
IGIL_KernelData *kernelData = reinterpret_cast<IGIL_KernelData *>(kernelDataMemory.get() + offsetInKernelDataMemory);
|
||||
|
||||
@ -1432,12 +1432,12 @@ TEST_F(ReflectionSurfaceHelperSetKernelDataTest, nullPrivateSurface) {
|
||||
|
||||
size_t maxConstantBufferSize = 32;
|
||||
size_t samplerCount = 1;
|
||||
size_t samplerHeapSize = alignUp(info.getSamplerStateArraySize(pPlatform->getDevice(0)->getHardwareInfo()), Sampler::samplerStateArrayAlignment) + info.getBorderColorStateSize();
|
||||
size_t samplerHeapSize = alignUp(info.getSamplerStateArraySize(pPlatform->getClDevice(0)->getHardwareInfo()), Sampler::samplerStateArrayAlignment) + info.getBorderColorStateSize();
|
||||
|
||||
uint32_t offsetInKernelDataMemory = 0;
|
||||
uint32_t offset = MockKernel::ReflectionSurfaceHelperPublic::setKernelData(kernelDataMemory.get(), offsetInKernelDataMemory, curbeParams,
|
||||
tokenMask, maxConstantBufferSize, samplerCount,
|
||||
info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
IGIL_KernelData *kernelData = reinterpret_cast<IGIL_KernelData *>(kernelDataMemory.get() + offsetInKernelDataMemory);
|
||||
|
||||
@ -1461,12 +1461,12 @@ TEST_F(ReflectionSurfaceHelperSetKernelDataTest, nullSamplerState) {
|
||||
|
||||
size_t maxConstantBufferSize = 32;
|
||||
size_t samplerCount = 1;
|
||||
size_t samplerHeapSize = alignUp(info.getSamplerStateArraySize(pPlatform->getDevice(0)->getHardwareInfo()), Sampler::samplerStateArrayAlignment) + info.getBorderColorStateSize();
|
||||
size_t samplerHeapSize = alignUp(info.getSamplerStateArraySize(pPlatform->getClDevice(0)->getHardwareInfo()), Sampler::samplerStateArrayAlignment) + info.getBorderColorStateSize();
|
||||
|
||||
uint32_t offsetInKernelDataMemory = 0;
|
||||
uint32_t offset = MockKernel::ReflectionSurfaceHelperPublic::setKernelData(kernelDataMemory.get(), offsetInKernelDataMemory, curbeParams,
|
||||
tokenMask, maxConstantBufferSize, samplerCount,
|
||||
info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
IGIL_KernelData *kernelData = reinterpret_cast<IGIL_KernelData *>(kernelDataMemory.get() + offsetInKernelDataMemory);
|
||||
|
||||
@ -1495,7 +1495,7 @@ TEST_F(ReflectionSurfaceHelperSetKernelDataTest, setKernelDataWithDisabledConcur
|
||||
uint32_t offsetInKernelDataMemory = 0;
|
||||
MockKernel::ReflectionSurfaceHelperPublic::setKernelData(kernelDataMemory.get(), offsetInKernelDataMemory, curbeParams,
|
||||
tokenMask, maxConstantBufferSize, samplerCount,
|
||||
info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
IGIL_KernelData *kernelData = reinterpret_cast<IGIL_KernelData *>(kernelDataMemory.get() + offsetInKernelDataMemory);
|
||||
EXPECT_EQ(0u, kernelData->m_CanRunConcurently);
|
||||
@ -1508,7 +1508,7 @@ TEST_F(ReflectionSurfaceHelperFixture, setKernelAddressDataWithNullBindingTable)
|
||||
|
||||
std::unique_ptr<char> kernelDataMemory(new char[200]);
|
||||
IGIL_KernelAddressData *kernalAddressData = reinterpret_cast<IGIL_KernelAddressData *>(kernelDataMemory.get());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::setKernelAddressData(kernelDataMemory.get(), 0, 1, 2, 3, 4, 5, 6, info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::setKernelAddressData(kernelDataMemory.get(), 0, 1, 2, 3, 4, 5, 6, info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
EXPECT_EQ(1u, kernalAddressData->m_KernelDataOffset);
|
||||
EXPECT_EQ(2u, kernalAddressData->m_SamplerHeapOffset);
|
||||
@ -1529,7 +1529,7 @@ TEST_F(ReflectionSurfaceHelperFixture, setKernelAddressDataWithSetBindingTable)
|
||||
|
||||
std::unique_ptr<char> kernelDataMemory(new char[200]);
|
||||
IGIL_KernelAddressData *kernalAddressData = reinterpret_cast<IGIL_KernelAddressData *>(kernelDataMemory.get());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::setKernelAddressData(kernelDataMemory.get(), 0, 1, 2, 3, 4, 5, 6, info, pPlatform->getDevice(0)->getHardwareInfo());
|
||||
MockKernel::ReflectionSurfaceHelperPublic::setKernelAddressData(kernelDataMemory.get(), 0, 1, 2, 3, 4, 5, 6, info, pPlatform->getClDevice(0)->getHardwareInfo());
|
||||
|
||||
EXPECT_EQ(1u, kernalAddressData->m_KernelDataOffset);
|
||||
EXPECT_EQ(2u, kernalAddressData->m_SamplerHeapOffset);
|
||||
|
@ -9,13 +9,15 @@
|
||||
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
|
||||
#include "opencl/source/device/cl_device.h"
|
||||
|
||||
using namespace NEO;
|
||||
using namespace std;
|
||||
|
||||
void HwInfoConfigTest::SetUp() {
|
||||
PlatformFixture::SetUp();
|
||||
|
||||
pInHwInfo = pPlatform->getDevice(0)->getHardwareInfo();
|
||||
pInHwInfo = pPlatform->getClDevice(0)->getHardwareInfo();
|
||||
|
||||
testPlatform = &pInHwInfo.platform;
|
||||
testSkuTable = &pInHwInfo.featureTable;
|
||||
|
@ -75,16 +75,13 @@ TEST_F(PlatformTest, WhenGetNumDevicesIsCalledThenExpectedValuesAreReturned) {
|
||||
}
|
||||
|
||||
TEST_F(PlatformTest, WhenGetDeviceIsCalledThenExpectedValuesAreReturned) {
|
||||
EXPECT_EQ(nullptr, pPlatform->getDevice(0));
|
||||
EXPECT_EQ(nullptr, pPlatform->getClDevice(0));
|
||||
|
||||
pPlatform->initializeWithNewDevices();
|
||||
|
||||
EXPECT_NE(nullptr, pPlatform->getDevice(0));
|
||||
EXPECT_NE(nullptr, pPlatform->getClDevice(0));
|
||||
|
||||
auto numDevices = pPlatform->getNumDevices();
|
||||
EXPECT_EQ(nullptr, pPlatform->getDevice(numDevices));
|
||||
EXPECT_EQ(nullptr, pPlatform->getClDevice(numDevices));
|
||||
}
|
||||
|
||||
|
@ -305,7 +305,7 @@ TEST_F(ProgramDataTest, givenConstantAllocationThatIsInUseByGpuWhenProgramIsBein
|
||||
|
||||
buildAndDecodeProgramPatchList();
|
||||
|
||||
auto &csr = *pPlatform->getDevice(0)->getDefaultEngine().commandStreamReceiver;
|
||||
auto &csr = *pPlatform->getClDevice(0)->getDefaultEngine().commandStreamReceiver;
|
||||
auto tagAddress = csr.getTagAddress();
|
||||
auto constantSurface = pProgram->getConstantSurface();
|
||||
constantSurface->updateTaskCount(*tagAddress + 1, csr.getOsContext().getContextId());
|
||||
@ -322,7 +322,7 @@ TEST_F(ProgramDataTest, givenGlobalAllocationThatIsInUseByGpuWhenProgramIsBeingD
|
||||
|
||||
buildAndDecodeProgramPatchList();
|
||||
|
||||
auto &csr = *pPlatform->getDevice(0)->getDefaultEngine().commandStreamReceiver;
|
||||
auto &csr = *pPlatform->getClDevice(0)->getDefaultEngine().commandStreamReceiver;
|
||||
auto tagAddress = csr.getTagAddress();
|
||||
auto globalSurface = pProgram->getGlobalSurface();
|
||||
globalSurface->updateTaskCount(*tagAddress + 1, csr.getOsContext().getContextId());
|
||||
|
@ -709,7 +709,7 @@ TEST_P(ProgramFromSourceTest, GivenSpecificParamatersWhenBuildingProgramThenSucc
|
||||
EXPECT_EQ(CL_BUILD_PROGRAM_FAILURE, retVal);
|
||||
|
||||
// fail build - linked code is corrupted and cannot be postprocessed
|
||||
auto p3 = std::make_unique<FailingGenBinaryProgram>(*pPlatform->getDevice(0)->getExecutionEnvironment());
|
||||
auto p3 = std::make_unique<FailingGenBinaryProgram>(*executionEnvironment);
|
||||
p3->setDevice(&device->getDevice());
|
||||
std::string testFile;
|
||||
size_t sourceSize;
|
||||
@ -1173,8 +1173,8 @@ TEST_P(ProgramFromSourceTest, GivenSpecificParamatersWhenLinkingProgramThenSucce
|
||||
EXPECT_EQ(CL_LINK_PROGRAM_FAILURE, retVal);
|
||||
|
||||
// fail linking - linked code is corrupted and cannot be postprocessed
|
||||
auto p2 = std::make_unique<FailingGenBinaryProgram>(*pPlatform->getDevice(0)->getExecutionEnvironment());
|
||||
ClDevice *device = pPlatform->getClDevice(0);
|
||||
auto device = static_cast<ClDevice *>(usedDevice);
|
||||
auto p2 = std::make_unique<FailingGenBinaryProgram>(*device->getExecutionEnvironment());
|
||||
p2->setDevice(&device->getDevice());
|
||||
retVal = p2->link(0, nullptr, nullptr, 1, &program, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_INVALID_BINARY, retVal);
|
||||
|
@ -99,7 +99,7 @@ TEST_F(ProgramWithBlockKernelsTest, GivenKernelWithBlockKernelsWhenProgramIsLink
|
||||
const char *buildOptions = "-cl-std=CL2.0";
|
||||
|
||||
overwriteBuiltInBinaryName(
|
||||
pPlatform->getDevice(0),
|
||||
&pPlatform->getClDevice(0)->getDevice(),
|
||||
"simple_block_kernel", true);
|
||||
|
||||
ASSERT_NE(nullptr, pProgram);
|
||||
|
@ -58,7 +58,7 @@ GEN11TEST_F(Gen11PreambleVfeState, WaOff) {
|
||||
typedef typename ICLFamily::PIPE_CONTROL PIPE_CONTROL;
|
||||
testWaTable->waSendMIFLUSHBeforeVFE = 0;
|
||||
LinearStream &cs = linearStream;
|
||||
PreambleHelper<ICLFamily>::programVFEState(&linearStream, pPlatform->getDevice(0)->getHardwareInfo(), 0, 0, 168u, aub_stream::EngineType::ENGINE_RCS);
|
||||
PreambleHelper<ICLFamily>::programVFEState(&linearStream, pPlatform->getClDevice(0)->getHardwareInfo(), 0, 0, 168u, aub_stream::EngineType::ENGINE_RCS);
|
||||
|
||||
parseCommands<ICLFamily>(cs);
|
||||
|
||||
@ -76,7 +76,7 @@ GEN11TEST_F(Gen11PreambleVfeState, WaOn) {
|
||||
typedef typename ICLFamily::PIPE_CONTROL PIPE_CONTROL;
|
||||
testWaTable->waSendMIFLUSHBeforeVFE = 1;
|
||||
LinearStream &cs = linearStream;
|
||||
PreambleHelper<ICLFamily>::programVFEState(&linearStream, pPlatform->getDevice(0)->getHardwareInfo(), 0, 0, 168u, aub_stream::EngineType::ENGINE_RCS);
|
||||
PreambleHelper<ICLFamily>::programVFEState(&linearStream, pPlatform->getClDevice(0)->getHardwareInfo(), 0, 0, 168u, aub_stream::EngineType::ENGINE_RCS);
|
||||
|
||||
parseCommands<ICLFamily>(cs);
|
||||
|
||||
|
@ -60,7 +60,7 @@ TGLLPTEST_F(Gen12LpPreambleVfeState, WaOff) {
|
||||
typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL;
|
||||
testWaTable->waSendMIFLUSHBeforeVFE = 0;
|
||||
LinearStream &cs = linearStream;
|
||||
PreambleHelper<FamilyType>::programVFEState(&linearStream, pPlatform->getDevice(0)->getHardwareInfo(), 0, 0, 672u, aub_stream::EngineType::ENGINE_RCS);
|
||||
PreambleHelper<FamilyType>::programVFEState(&linearStream, pPlatform->getClDevice(0)->getHardwareInfo(), 0, 0, 672u, aub_stream::EngineType::ENGINE_RCS);
|
||||
|
||||
parseCommands<FamilyType>(cs);
|
||||
|
||||
@ -79,7 +79,7 @@ TGLLPTEST_F(Gen12LpPreambleVfeState, givenCcsEngineWhenWaIsSetThenAppropriatePip
|
||||
testWaTable->waSendMIFLUSHBeforeVFE = 1;
|
||||
LinearStream &cs = linearStream;
|
||||
|
||||
PreambleHelper<FamilyType>::programVFEState(&linearStream, pPlatform->getDevice(0)->getHardwareInfo(), 0, 0, 672u, aub_stream::EngineType::ENGINE_CCS);
|
||||
PreambleHelper<FamilyType>::programVFEState(&linearStream, pPlatform->getClDevice(0)->getHardwareInfo(), 0, 0, 672u, aub_stream::EngineType::ENGINE_CCS);
|
||||
|
||||
parseCommands<FamilyType>(cs);
|
||||
|
||||
@ -98,7 +98,7 @@ TGLLPTEST_F(Gen12LpPreambleVfeState, givenRcsEngineWhenWaIsSetThenAppropriatePip
|
||||
testWaTable->waSendMIFLUSHBeforeVFE = 1;
|
||||
LinearStream &cs = linearStream;
|
||||
|
||||
PreambleHelper<FamilyType>::programVFEState(&linearStream, pPlatform->getDevice(0)->getHardwareInfo(), 0, 0, 672u, aub_stream::EngineType::ENGINE_RCS);
|
||||
PreambleHelper<FamilyType>::programVFEState(&linearStream, pPlatform->getClDevice(0)->getHardwareInfo(), 0, 0, 672u, aub_stream::EngineType::ENGINE_RCS);
|
||||
|
||||
parseCommands<FamilyType>(cs);
|
||||
|
||||
@ -125,7 +125,7 @@ TGLLPTEST_F(Gen12LpPreambleVfeState, givenCfeFusedEuDispatchFlagsWhenprogramAddi
|
||||
using MEDIA_VFE_STATE = typename FamilyType::MEDIA_VFE_STATE;
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
auto pHwInfo = pPlatform->getDevice(0)->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
auto pHwInfo = pPlatform->getClDevice(0)->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
auto pMediaVfeState = reinterpret_cast<MEDIA_VFE_STATE *>(linearStream.getSpace(sizeof(MEDIA_VFE_STATE)));
|
||||
*pMediaVfeState = FamilyType::cmdInitMediaVfeState;
|
||||
auto &waTable = pHwInfo->workaroundTable;
|
||||
|
@ -108,7 +108,7 @@ GEN9TEST_F(PreambleVfeState, WaOff) {
|
||||
typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL;
|
||||
testWaTable->waSendMIFLUSHBeforeVFE = 0;
|
||||
LinearStream &cs = linearStream;
|
||||
PreambleHelper<FamilyType>::programVFEState(&linearStream, pPlatform->getDevice(0)->getHardwareInfo(), 0, 0, 168u, aub_stream::EngineType::ENGINE_RCS);
|
||||
PreambleHelper<FamilyType>::programVFEState(&linearStream, pPlatform->getClDevice(0)->getHardwareInfo(), 0, 0, 168u, aub_stream::EngineType::ENGINE_RCS);
|
||||
|
||||
parseCommands<FamilyType>(cs);
|
||||
|
||||
@ -126,7 +126,7 @@ GEN9TEST_F(PreambleVfeState, WaOn) {
|
||||
typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL;
|
||||
testWaTable->waSendMIFLUSHBeforeVFE = 1;
|
||||
LinearStream &cs = linearStream;
|
||||
PreambleHelper<FamilyType>::programVFEState(&linearStream, pPlatform->getDevice(0)->getHardwareInfo(), 0, 0, 168u, aub_stream::EngineType::ENGINE_RCS);
|
||||
PreambleHelper<FamilyType>::programVFEState(&linearStream, pPlatform->getClDevice(0)->getHardwareInfo(), 0, 0, 168u, aub_stream::EngineType::ENGINE_RCS);
|
||||
|
||||
parseCommands<FamilyType>(cs);
|
||||
|
||||
|
Reference in New Issue
Block a user