2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2018-09-18 15:11:08 +08:00
|
|
|
* Copyright (C) 2018 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "gtsysinfo.h"
|
2018-07-18 20:11:05 +08:00
|
|
|
#include "igfxfmid.h"
|
2018-01-09 21:08:34 +08:00
|
|
|
#include "sku_info.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2017-11-14 18:15:09 +08:00
|
|
|
#include "runtime/helpers/engine_node.h"
|
2018-03-21 17:00:49 +08:00
|
|
|
#include "runtime/helpers/kmd_notify_properties.h"
|
2018-02-19 16:50:17 +08:00
|
|
|
#include <cstddef>
|
2017-11-14 18:15:09 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
namespace OCLRT {
|
|
|
|
|
2018-01-08 11:07:46 +08:00
|
|
|
enum class PreemptionMode : uint32_t {
|
2017-12-21 07:45:38 +08:00
|
|
|
// Keep in sync with ForcePreemptionMode debug variable
|
2018-02-08 20:41:02 +08:00
|
|
|
Initial = 0,
|
2017-12-21 07:45:38 +08:00
|
|
|
Disabled = 1,
|
|
|
|
MidBatch,
|
|
|
|
ThreadGroup,
|
2018-02-08 20:41:02 +08:00
|
|
|
MidThread,
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct WhitelistedRegisters {
|
|
|
|
bool csChicken1_0x2580;
|
|
|
|
bool chicken0hdc_0xE5F0;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RuntimeCapabilityTable {
|
|
|
|
uint32_t maxRenderFrequency;
|
|
|
|
double defaultProfilingTimerResolution;
|
|
|
|
|
|
|
|
unsigned int clVersionSupport;
|
|
|
|
bool ftrSupportsFP64;
|
|
|
|
bool ftrSupports64BitMath;
|
|
|
|
bool ftrSvm;
|
|
|
|
bool ftrSupportsCoherency;
|
|
|
|
bool ftrSupportsVmeAvcTextureSampler;
|
|
|
|
bool ftrSupportsVmeAvcPreemption;
|
2018-07-18 20:11:05 +08:00
|
|
|
bool ftrRenderCompressedBuffers;
|
|
|
|
bool ftrRenderCompressedImages;
|
2017-12-21 07:45:38 +08:00
|
|
|
PreemptionMode defaultPreemptionMode;
|
|
|
|
WhitelistedRegisters whitelistedRegisters;
|
|
|
|
|
|
|
|
bool (*isSimulation)(unsigned short);
|
|
|
|
bool instrumentationEnabled;
|
|
|
|
|
|
|
|
bool forceStatelessCompilationFor32Bit;
|
|
|
|
|
2018-03-21 17:00:49 +08:00
|
|
|
KmdNotifyProperties kmdNotifyProperties;
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
bool ftr64KBpages;
|
|
|
|
|
2017-11-14 18:15:09 +08:00
|
|
|
EngineType defaultEngineType;
|
2018-02-21 23:06:09 +08:00
|
|
|
|
|
|
|
size_t requiredPreemptionSurfaceSize;
|
2018-04-27 15:42:32 +08:00
|
|
|
bool isCore;
|
2018-05-22 19:22:56 +08:00
|
|
|
bool sourceLevelDebuggerSupported;
|
2018-06-06 23:03:46 +08:00
|
|
|
uint32_t aubDeviceId;
|
2018-06-22 19:04:02 +08:00
|
|
|
|
|
|
|
uint32_t extraQuantityThreadsPerEU;
|
2018-08-24 21:23:45 +08:00
|
|
|
uint64_t gpuAddressSpace;
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
|
|
|
|
2018-02-19 16:50:17 +08:00
|
|
|
struct HardwareCapabilities {
|
|
|
|
size_t image3DMaxWidth;
|
|
|
|
size_t image3DMaxHeight;
|
2018-06-08 22:42:29 +08:00
|
|
|
uint64_t maxMemAllocSize;
|
2018-07-10 19:22:11 +08:00
|
|
|
bool isStatelesToStatefullWithOffsetSupported;
|
2018-08-17 17:00:21 +08:00
|
|
|
bool localMemorySupported;
|
2018-02-19 16:50:17 +08:00
|
|
|
};
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
struct HardwareInfo {
|
2018-06-12 15:42:47 +08:00
|
|
|
HardwareInfo() = default;
|
|
|
|
HardwareInfo(const PLATFORM *platform, const FeatureTable *skuTable, const WorkaroundTable *waTable,
|
2018-07-02 19:42:23 +08:00
|
|
|
const GT_SYSTEM_INFO *sysInfo, const RuntimeCapabilityTable &capabilityTable);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-06-12 15:42:47 +08:00
|
|
|
const PLATFORM *pPlatform = nullptr;
|
|
|
|
const FeatureTable *pSkuTable = nullptr;
|
|
|
|
const WorkaroundTable *pWaTable = nullptr;
|
|
|
|
const GT_SYSTEM_INFO *pSysInfo = nullptr;
|
|
|
|
|
|
|
|
RuntimeCapabilityTable capabilityTable = {};
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
extern const WorkaroundTable emptyWaTable;
|
|
|
|
extern const FeatureTable emptySkuTable;
|
|
|
|
|
|
|
|
template <PRODUCT_FAMILY product>
|
|
|
|
struct HwMapper {};
|
|
|
|
|
|
|
|
template <GFXCORE_FAMILY gfxFamily>
|
|
|
|
struct GfxFamilyMapper {};
|
|
|
|
|
|
|
|
// Global table of hardware prefixes
|
|
|
|
extern bool familyEnabled[IGFX_MAX_CORE];
|
|
|
|
extern const char *familyName[IGFX_MAX_CORE];
|
|
|
|
extern const char *hardwarePrefix[];
|
|
|
|
extern const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT];
|
2018-08-27 18:11:07 +08:00
|
|
|
extern void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(GT_SYSTEM_INFO *gtSystemInfo, FeatureTable *featureTable, bool setupFeatureTable);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
template <GFXCORE_FAMILY gfxFamily>
|
|
|
|
struct EnableGfxFamilyHw {
|
|
|
|
EnableGfxFamilyHw() {
|
|
|
|
familyEnabled[gfxFamily] = true;
|
|
|
|
familyName[gfxFamily] = GfxFamilyMapper<gfxFamily>::name;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-04-18 00:11:50 +08:00
|
|
|
const char *getPlatformType(const HardwareInfo &hwInfo);
|
2018-06-07 22:18:53 +08:00
|
|
|
bool getHwInfoForPlatformString(const char *str, const HardwareInfo *&hwInfoIn);
|
2018-10-02 04:36:15 +08:00
|
|
|
EngineType getChosenEngineType(const HardwareInfo &hwInfo);
|
2017-12-21 07:45:38 +08:00
|
|
|
} // namespace OCLRT
|