mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Add localMemorySupported flag to HardwareCapabilities
Change-Id: Ie57aa6418eecdd288001ded2605c731dd61b9879
This commit is contained in:
committed by
sys_ocldev
parent
17de60254a
commit
0723455cb5
@@ -92,6 +92,8 @@ Device::Device(const HardwareInfo &hwInfo, ExecutionEnvironment *executionEnviro
|
||||
this->executionEnvironment->initSourceLevelDebugger(hwInfo);
|
||||
}
|
||||
this->executionEnvironment->incRefInternal();
|
||||
auto &hwHelper = HwHelper::get(hwInfo.pPlatform->eRenderCoreFamily);
|
||||
hwHelper.setupHardwareCapabilities(&this->hardwareCapabilities);
|
||||
}
|
||||
|
||||
Device::~Device() {
|
||||
|
||||
@@ -130,6 +130,7 @@ class Device : public BaseObject<_cl_device_id> {
|
||||
bool isSourceLevelDebuggerActive() const;
|
||||
SourceLevelDebugger *getSourceLevelDebugger() { return executionEnvironment->sourceLevelDebugger.get(); }
|
||||
ExecutionEnvironment *getExecutionEnvironment() const { return executionEnvironment; }
|
||||
const HardwareCapabilities &getHardwareCapabilities() { return hardwareCapabilities; }
|
||||
|
||||
protected:
|
||||
Device() = delete;
|
||||
@@ -153,6 +154,7 @@ class Device : public BaseObject<_cl_device_id> {
|
||||
unsigned int enabledClVersion;
|
||||
|
||||
const HardwareInfo &hwInfo;
|
||||
HardwareCapabilities hardwareCapabilities = {};
|
||||
DeviceInfo deviceInfo;
|
||||
|
||||
volatile uint32_t *tagAddress;
|
||||
|
||||
@@ -110,9 +110,7 @@ void Device::initializeCaps() {
|
||||
driverVersion.assign(driverInfo.get()->getVersion(driverVersion).c_str());
|
||||
}
|
||||
|
||||
HardwareCapabilities hwCaps = {0};
|
||||
auto &hwHelper = HwHelper::get(hwInfo.pPlatform->eRenderCoreFamily);
|
||||
hwHelper.setupHardwareCapabilities(&hwCaps);
|
||||
|
||||
deviceInfo.name = name.c_str();
|
||||
deviceInfo.driverVersion = driverVersion.c_str();
|
||||
@@ -256,7 +254,7 @@ void Device::initializeCaps() {
|
||||
|
||||
// OpenCL 1.2 requires 128MB minimum
|
||||
auto maxMemAllocSize = std::max((uint64_t)(deviceInfo.globalMemSize / 2), (uint64_t)(128 * MB));
|
||||
deviceInfo.maxMemAllocSize = std::min(maxMemAllocSize, hwCaps.maxMemAllocSize);
|
||||
deviceInfo.maxMemAllocSize = std::min(maxMemAllocSize, this->hardwareCapabilities.maxMemAllocSize);
|
||||
|
||||
deviceInfo.maxConstantBufferSize = deviceInfo.maxMemAllocSize;
|
||||
|
||||
@@ -312,8 +310,8 @@ void Device::initializeCaps() {
|
||||
deviceInfo.imageSupport = CL_TRUE;
|
||||
deviceInfo.image2DMaxWidth = 16384;
|
||||
deviceInfo.image2DMaxHeight = 16384;
|
||||
deviceInfo.image3DMaxWidth = hwCaps.image3DMaxWidth;
|
||||
deviceInfo.image3DMaxHeight = hwCaps.image3DMaxHeight;
|
||||
deviceInfo.image3DMaxWidth = this->hardwareCapabilities.image3DMaxWidth;
|
||||
deviceInfo.image3DMaxHeight = this->hardwareCapabilities.image3DMaxHeight;
|
||||
deviceInfo.image3DMaxDepth = 2048;
|
||||
deviceInfo.imageMaxArraySize = 2048;
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps) {
|
||||
//Reason to subtract 8KB is that driver may pad the buffer with addition pages for over fetching..
|
||||
caps->maxMemAllocSize = (4ULL * MemoryConstants::gigaByte) - (8ULL * MemoryConstants::kiloByte);
|
||||
caps->isStatelesToStatefullWithOffsetSupported = true;
|
||||
caps->localMemorySupported = false;
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
|
||||
@@ -85,6 +85,7 @@ struct HardwareCapabilities {
|
||||
size_t image3DMaxHeight;
|
||||
uint64_t maxMemAllocSize;
|
||||
bool isStatelesToStatefullWithOffsetSupported;
|
||||
bool localMemorySupported;
|
||||
};
|
||||
|
||||
struct HardwareInfo {
|
||||
|
||||
@@ -90,9 +90,7 @@ Program::Program(ExecutionEnvironment &executionEnvironment, Context *context, b
|
||||
}
|
||||
kernelDebugEnabled = pDevice->isSourceLevelDebuggerActive();
|
||||
|
||||
HardwareCapabilities hwCaps = {0};
|
||||
HwHelper::get(pDevice->getHardwareInfo().pPlatform->eRenderCoreFamily).setupHardwareCapabilities(&hwCaps);
|
||||
auto enableStatelessToStatefullWithOffset = hwCaps.isStatelesToStatefullWithOffsetSupported;
|
||||
auto enableStatelessToStatefullWithOffset = pDevice->getHardwareCapabilities().isStatelesToStatefullWithOffsetSupported;
|
||||
if (DebugManager.flags.EnableStatelessToStatefulBufferOffsetOpt.get() != -1) {
|
||||
enableStatelessToStatefullWithOffset = DebugManager.flags.EnableStatelessToStatefulBufferOffsetOpt.get() != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user