mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 18:06:32 +08:00
Use hwInfo from root device environment [1/N]
Related-To: NEO-3857 Change-Id: I270e53fb5334c39d41d38b4d2a75c7a3cd05aa56 Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
70322b858f
commit
ad21b7672e
@@ -72,9 +72,9 @@ CommandQueue::CommandQueue(Context *context, ClDevice *device, const cl_queue_pr
|
||||
if (gpgpuEngine->commandStreamReceiver->peekTimestampPacketWriteEnabled()) {
|
||||
timestampPacketContainer = std::make_unique<TimestampPacketContainer>();
|
||||
}
|
||||
auto hwInfo = device->getExecutionEnvironment()->getHardwareInfo();
|
||||
if (hwInfo->capabilityTable.blitterOperationsSupported) {
|
||||
bcsEngine = &device->getDeviceById(0)->getEngine(EngineHelpers::getBcsEngineType(*hwInfo), false);
|
||||
auto hwInfo = device->getHardwareInfo();
|
||||
if (hwInfo.capabilityTable.blitterOperationsSupported) {
|
||||
bcsEngine = &device->getDeviceById(0)->getEngine(EngineHelpers::getBcsEngineType(hwInfo), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,7 +563,7 @@ bool CommandQueue::queueDependenciesClearRequired() const {
|
||||
}
|
||||
|
||||
bool CommandQueue::blitEnqueueAllowed(cl_command_type cmdType) const {
|
||||
bool blitAllowed = device->getExecutionEnvironment()->getHardwareInfo()->capabilityTable.blitterOperationsSupported;
|
||||
bool blitAllowed = device->getHardwareInfo().capabilityTable.blitterOperationsSupported;
|
||||
|
||||
if (DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get() != -1) {
|
||||
blitAllowed &= !!DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get();
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "runtime/command_stream/aub_command_stream_receiver.h"
|
||||
|
||||
#include "core/execution_environment/execution_environment.h"
|
||||
#include "core/execution_environment/root_device_environment.h"
|
||||
#include "core/helpers/debug_helpers.h"
|
||||
#include "core/helpers/hw_helper.h"
|
||||
#include "core/helpers/hw_info.h"
|
||||
@@ -50,7 +51,7 @@ std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwI
|
||||
}
|
||||
|
||||
CommandStreamReceiver *AUBCommandStreamReceiver::create(const std::string &baseName, bool standalone, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) {
|
||||
auto hwInfo = executionEnvironment.getHardwareInfo();
|
||||
auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
||||
std::string filePath = AUBCommandStreamReceiver::createFullFilePath(*hwInfo, baseName);
|
||||
if (DebugManager.flags.AUBDumpCaptureFileName.get() != "unk") {
|
||||
filePath.assign(DebugManager.flags.AUBDumpCaptureFileName.get());
|
||||
|
||||
@@ -396,7 +396,7 @@ bool CommandStreamReceiver::createGlobalFenceAllocation() {
|
||||
}
|
||||
|
||||
bool CommandStreamReceiver::createPreemptionAllocation() {
|
||||
auto hwInfo = executionEnvironment.getHardwareInfo();
|
||||
auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
||||
AllocationProperties properties{rootDeviceIndex, true, hwInfo->capabilityTable.requiredPreemptionSurfaceSize, GraphicsAllocation::AllocationType::PREEMPTION, false};
|
||||
properties.flags.uncacheable = hwInfo->workaroundTable.waCSRUncachable;
|
||||
properties.alignment = 256 * MemoryConstants::kiloByte;
|
||||
@@ -479,7 +479,7 @@ int32_t CommandStreamReceiver::expectMemory(const void *gfxAddress, const void *
|
||||
}
|
||||
|
||||
bool CommandStreamReceiver::needsPageTableManager(aub_stream::EngineType engineType) const {
|
||||
auto hwInfo = executionEnvironment.getHardwareInfo();
|
||||
auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
||||
auto defaultEngineType = getChosenEngineType(*hwInfo);
|
||||
if (engineType != defaultEngineType) {
|
||||
return false;
|
||||
|
||||
@@ -57,7 +57,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
|
||||
void adjustComputeMode(LinearStream &csr, DispatchFlags &dispatchFlags, void *const stateComputeMode);
|
||||
|
||||
void waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, bool forcePowerSavingMode) override;
|
||||
const HardwareInfo &peekHwInfo() const { return *executionEnvironment.getHardwareInfo(); }
|
||||
const HardwareInfo &peekHwInfo() const;
|
||||
|
||||
void collectStateBaseAddresPatchInfo(
|
||||
uint64_t commandBufferAddress,
|
||||
|
||||
@@ -341,7 +341,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
|
||||
DBG_LOG(LogTaskCounts, __FUNCTION__, "Line: ", __LINE__, "this->taskLevel", (uint32_t)this->taskLevel);
|
||||
|
||||
if (executionEnvironment.getHardwareInfo()->workaroundTable.waSamplerCacheFlushBetweenRedescribedSurfaceReads) {
|
||||
if (executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->workaroundTable.waSamplerCacheFlushBetweenRedescribedSurfaceReads) {
|
||||
if (this->samplerCacheFlushRequired != SamplerCacheFlushState::samplerCacheFlushNotRequired) {
|
||||
auto pCmd = addPipeControlCmd(commandStreamCSR);
|
||||
pCmd->setTextureCacheInvalidationEnable(true);
|
||||
@@ -649,7 +649,7 @@ size_t CommandStreamReceiverHw<GfxFamily>::getRequiredCmdStreamSize(const Dispat
|
||||
size += getCmdSizeForEpilogue(dispatchFlags);
|
||||
size += getCmdSizeForPrologue(dispatchFlags);
|
||||
|
||||
if (executionEnvironment.getHardwareInfo()->workaroundTable.waSamplerCacheFlushBetweenRedescribedSurfaceReads) {
|
||||
if (executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->workaroundTable.waSamplerCacheFlushBetweenRedescribedSurfaceReads) {
|
||||
if (this->samplerCacheFlushRequired != SamplerCacheFlushState::samplerCacheFlushNotRequired) {
|
||||
size += sizeof(typename GfxFamily::PIPE_CONTROL);
|
||||
}
|
||||
@@ -714,6 +714,11 @@ inline void CommandStreamReceiverHw<GfxFamily>::waitForTaskCountWithKmdNotifyFal
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline const HardwareInfo &CommandStreamReceiverHw<GfxFamily>::peekHwInfo() const {
|
||||
return *executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline void CommandStreamReceiverHw<GfxFamily>::programPreemption(LinearStream &csr, DispatchFlags &dispatchFlags) {
|
||||
PreemptionHelper::programCmdStream<GfxFamily>(csr, dispatchFlags.preemptionMode, this->lastPreemptionMode, preemptionAllocation);
|
||||
|
||||
@@ -169,16 +169,19 @@ bool Context::createImpl(const cl_context_properties *properties,
|
||||
if (devices.size() > 0) {
|
||||
auto device = this->getDevice(0);
|
||||
this->memoryManager = device->getMemoryManager();
|
||||
if (device->getHardwareInfo().capabilityTable.ftrSvm) {
|
||||
this->svmAllocsManager = new SVMAllocsManager(this->memoryManager);
|
||||
}
|
||||
if (memoryManager->isAsyncDeleterEnabled()) {
|
||||
memoryManager->getDeferredDeleter()->addClient();
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &device : devices) {
|
||||
device->incRefInternal();
|
||||
bool anySvmSupport = false;
|
||||
for (auto &device : devices) {
|
||||
device->incRefInternal();
|
||||
anySvmSupport |= device->getHardwareInfo().capabilityTable.ftrSvm;
|
||||
}
|
||||
|
||||
if (anySvmSupport) {
|
||||
this->svmAllocsManager = new SVMAllocsManager(this->memoryManager);
|
||||
}
|
||||
}
|
||||
|
||||
auto commandQueue = CommandQueue::create(this, devices[0], nullptr, true, errcodeRet);
|
||||
|
||||
Reference in New Issue
Block a user