2020-03-24 19:17:13 +08:00
|
|
|
/*
|
2022-01-27 22:42:05 +08:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2020-03-24 19:17:13 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-04-23 01:26:27 +08:00
|
|
|
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
|
2020-03-24 19:17:13 +08:00
|
|
|
|
2020-04-21 19:45:26 +08:00
|
|
|
#include "shared/source/device/device_info.h"
|
2020-10-04 05:11:39 +08:00
|
|
|
#include "shared/source/helpers/hw_helper.h"
|
2021-01-21 20:10:13 +08:00
|
|
|
#include "shared/test/common/helpers/default_hw_info.h"
|
2020-04-21 19:45:26 +08:00
|
|
|
|
2020-03-24 19:17:13 +08:00
|
|
|
#include "opencl/source/cl_device/cl_device.h"
|
2020-04-21 19:45:26 +08:00
|
|
|
#include "opencl/source/context/context.h"
|
2020-10-21 21:10:25 +08:00
|
|
|
#include "opencl/source/helpers/cl_hw_helper.h"
|
2020-10-04 05:11:39 +08:00
|
|
|
#include "opencl/source/kernel/kernel.h"
|
2020-03-24 19:17:13 +08:00
|
|
|
|
|
|
|
using namespace NEO;
|
|
|
|
|
|
|
|
bool TestChecks::supportsSvm(const ClDevice *pClDevice) {
|
|
|
|
return supportsSvm(&pClDevice->getDevice());
|
|
|
|
}
|
2020-04-21 19:45:26 +08:00
|
|
|
|
|
|
|
bool TestChecks::supportsImages(const Context *pContext) {
|
|
|
|
return pContext->getDevice(0)->getSharedDeviceInfo().imageSupport;
|
|
|
|
}
|
2020-04-22 20:03:42 +08:00
|
|
|
|
2020-09-11 16:54:46 +08:00
|
|
|
bool TestChecks::supportsOcl21(const std::unique_ptr<HardwareInfo> &pHardwareInfo) {
|
2022-01-31 21:47:17 +08:00
|
|
|
return (pHardwareInfo->capabilityTable.supportsOcl21Features && pHardwareInfo->capabilityTable.supportsPipes &&
|
|
|
|
pHardwareInfo->capabilityTable.supportsIndependentForwardProgress);
|
2020-09-11 16:54:46 +08:00
|
|
|
}
|
|
|
|
|
2022-11-15 08:46:56 +08:00
|
|
|
bool TestChecks::supportsAuxResolves(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
2020-10-04 05:11:39 +08:00
|
|
|
KernelInfo kernelInfo{};
|
2021-04-08 17:05:45 +08:00
|
|
|
kernelInfo.kernelDescriptor.payloadMappings.explicitArgs.resize(1);
|
|
|
|
kernelInfo.kernelDescriptor.payloadMappings.explicitArgs[0].as<ArgDescPointer>(true).accessedUsingStatelessAddressingMode = true;
|
2020-10-04 05:11:39 +08:00
|
|
|
|
2022-12-01 01:06:04 +08:00
|
|
|
auto &clGfxCoreHelper = rootDeviceEnvironment.getHelper<ClGfxCoreHelper>();
|
|
|
|
return clGfxCoreHelper.requiresAuxResolves(kernelInfo, rootDeviceEnvironment);
|
2020-10-04 05:11:39 +08:00
|
|
|
}
|