Skip to content

Commit 1599ea8

Browse files
Pass execution environment to command stream receiver.
Change-Id: I598f67f8b005b5ce8249b638e080657eb6dc3547
1 parent 287d33d commit 1599ea8

File tree

76 files changed

+362
-334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+362
-334
lines changed

runtime/command_stream/aub_command_stream_receiver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
namespace OCLRT {
3434
AubCommandStreamReceiverCreateFunc aubCommandStreamReceiverFactory[IGFX_MAX_CORE] = {};
3535

36-
CommandStreamReceiver *AUBCommandStreamReceiver::create(const HardwareInfo &hwInfo, const std::string &baseName, bool standalone) {
36+
CommandStreamReceiver *AUBCommandStreamReceiver::create(const HardwareInfo &hwInfo, const std::string &baseName, bool standalone, ExecutionEnvironment &executionEnvironment) {
3737
std::string hwPrefix = hardwarePrefix[hwInfo.pPlatform->eProductFamily];
3838

3939
// Generate the full filename
@@ -57,7 +57,7 @@ CommandStreamReceiver *AUBCommandStreamReceiver::create(const HardwareInfo &hwIn
5757
}
5858

5959
auto pCreate = aubCommandStreamReceiverFactory[hwInfo.pPlatform->eRenderCoreFamily];
60-
return pCreate ? pCreate(hwInfo, filePath, standalone) : nullptr;
60+
return pCreate ? pCreate(hwInfo, filePath, standalone, executionEnvironment) : nullptr;
6161
}
6262
} // namespace OCLRT
6363

runtime/command_stream/aub_command_stream_receiver.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@
2727
namespace OCLRT {
2828
struct HardwareInfo;
2929
class CommandStreamReceiver;
30+
class ExecutionEnvironment;
3031

3132
struct AUBCommandStreamReceiver {
32-
static CommandStreamReceiver *create(const HardwareInfo &hwInfo, const std::string &filename, bool standalone);
33+
static CommandStreamReceiver *create(const HardwareInfo &hwInfo, const std::string &filename, bool standalone, ExecutionEnvironment &executionEnvironment);
3334

3435
using AubFileStream = AubMemDump::AubFileStream;
3536
};
3637

37-
typedef CommandStreamReceiver *(*AubCommandStreamReceiverCreateFunc)(const HardwareInfo &hwInfoIn, const std::string &fileName, bool standalone);
38+
typedef CommandStreamReceiver *(*AubCommandStreamReceiverCreateFunc)(const HardwareInfo &hwInfoIn, const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment);
3839
} // namespace OCLRT

runtime/command_stream/aub_command_stream_receiver_hw.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverHw<GfxFamily> {
5757

5858
void addContextToken();
5959

60-
static CommandStreamReceiver *create(const HardwareInfo &hwInfoIn, const std::string &fileName, bool standalone);
60+
static CommandStreamReceiver *create(const HardwareInfo &hwInfoIn, const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment);
6161

62-
AUBCommandStreamReceiverHw(const HardwareInfo &hwInfoIn, const std::string &fileName, bool standalone);
62+
AUBCommandStreamReceiverHw(const HardwareInfo &hwInfoIn, const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment);
6363
~AUBCommandStreamReceiverHw() override;
6464

6565
AUBCommandStreamReceiverHw(const AUBCommandStreamReceiverHw &) = delete;

runtime/command_stream/aub_command_stream_receiver_hw.inl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
namespace OCLRT {
3737

3838
template <typename GfxFamily>
39-
AUBCommandStreamReceiverHw<GfxFamily>::AUBCommandStreamReceiverHw(const HardwareInfo &hwInfoIn, const std::string &fileName, bool standalone)
40-
: BaseClass(hwInfoIn),
39+
AUBCommandStreamReceiverHw<GfxFamily>::AUBCommandStreamReceiverHw(const HardwareInfo &hwInfoIn, const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment)
40+
: BaseClass(hwInfoIn, executionEnvironment),
4141
stream(std::unique_ptr<AUBCommandStreamReceiver::AubFileStream>(new AUBCommandStreamReceiver::AubFileStream())),
4242
subCaptureManager(std::unique_ptr<AubSubCaptureManager>(new AubSubCaptureManager(fileName))),
4343
standalone(standalone) {
@@ -233,8 +233,8 @@ void AUBCommandStreamReceiverHw<GfxFamily>::freeEngineInfoTable() {
233233
}
234234

235235
template <typename GfxFamily>
236-
CommandStreamReceiver *AUBCommandStreamReceiverHw<GfxFamily>::create(const HardwareInfo &hwInfoIn, const std::string &fileName, bool standalone) {
237-
auto csr = new AUBCommandStreamReceiverHw<GfxFamily>(hwInfoIn, fileName, standalone);
236+
CommandStreamReceiver *AUBCommandStreamReceiverHw<GfxFamily>::create(const HardwareInfo &hwInfoIn, const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment) {
237+
auto csr = new AUBCommandStreamReceiverHw<GfxFamily>(hwInfoIn, fileName, standalone, executionEnvironment);
238238

239239
if (!csr->subCaptureManager->isSubCaptureMode()) {
240240
csr->initFile(fileName);

runtime/command_stream/command_stream_receiver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace OCLRT {
3737
// Global table of CommandStreamReceiver factories for HW and tests
3838
CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE] = {};
3939

40-
CommandStreamReceiver::CommandStreamReceiver() {
40+
CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvironment) : executionEnvironment(executionEnvironment) {
4141
latestSentStatelessMocsConfig = CacheSettings::unknownMocs;
4242
submissionAggregator.reset(new SubmissionAggregator());
4343
if (DebugManager.flags.CsrDispatchMode.get()) {

runtime/command_stream/command_stream_receiver.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class IndirectHeap;
4343
class LinearStream;
4444
class MemoryManager;
4545
class OSInterface;
46+
class ExecutionEnvironment;
4647

4748
enum class DispatchMode {
4849
DeviceDefault = 0, //default for given device
@@ -60,7 +61,7 @@ class CommandStreamReceiver {
6061
samplerCacheFlushAfter //add sampler cache flush after Walker with redescribed image
6162
};
6263
using MutexType = std::recursive_mutex;
63-
CommandStreamReceiver();
64+
CommandStreamReceiver(ExecutionEnvironment &executionEnvironment);
6465
virtual ~CommandStreamReceiver();
6566

6667
virtual FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency) = 0;
@@ -203,7 +204,8 @@ class CommandStreamReceiver {
203204
std::unique_ptr<ExperimentalCommandBuffer> experimentalCmdBuffer;
204205
MutexType ownershipMutex;
205206
std::unique_ptr<KmdNotifyHelper> kmdNotifyHelper;
207+
ExecutionEnvironment &executionEnvironment;
206208
};
207209

208-
typedef CommandStreamReceiver *(*CommandStreamReceiverCreateFunc)(const HardwareInfo &hwInfoIn, bool withAubDump);
210+
typedef CommandStreamReceiver *(*CommandStreamReceiverCreateFunc)(const HardwareInfo &hwInfoIn, bool withAubDump, ExecutionEnvironment &executionEnvironment);
209211
} // namespace OCLRT

runtime/command_stream/command_stream_receiver_hw.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
3737
typedef typename GfxFamily::PIPE_CONTROL PIPE_CONTROL;
3838

3939
public:
40-
static CommandStreamReceiver *create(const HardwareInfo &hwInfoIn) {
41-
return new CommandStreamReceiverHw<GfxFamily>(hwInfoIn);
40+
static CommandStreamReceiver *create(const HardwareInfo &hwInfoIn, ExecutionEnvironment &executionEnvironment) {
41+
return new CommandStreamReceiverHw<GfxFamily>(hwInfoIn, executionEnvironment);
4242
}
4343

44-
CommandStreamReceiverHw(const HardwareInfo &hwInfoIn);
44+
CommandStreamReceiverHw(const HardwareInfo &hwInfoIn, ExecutionEnvironment &executionEnvironment);
4545

4646
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency) override;
4747

runtime/command_stream/command_stream_receiver_hw.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
namespace OCLRT {
4141

4242
template <typename GfxFamily>
43-
CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiverHw(const HardwareInfo &hwInfoIn) : hwInfo(hwInfoIn) {
43+
CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiverHw(const HardwareInfo &hwInfoIn, ExecutionEnvironment &executionEnvironment) : CommandStreamReceiver(executionEnvironment), hwInfo(hwInfoIn) {
4444
requiredThreadArbitrationPolicy = PreambleHelper<GfxFamily>::getDefaultThreadArbitrationPolicy();
4545
resetKmdNotifyHelper(new KmdNotifyHelper(&(hwInfoIn.capabilityTable.kmdNotifyProperties)));
4646
flatBatchBufferHelper.reset(new FlatBatchBufferHelperHw<GfxFamily>(this->memoryManager));

runtime/command_stream/command_stream_receiver_with_aub_dump.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace OCLRT {
2828
template <typename BaseCSR>
2929
class CommandStreamReceiverWithAUBDump : public BaseCSR {
3030
public:
31-
CommandStreamReceiverWithAUBDump(const HardwareInfo &hwInfoIn);
31+
CommandStreamReceiverWithAUBDump(const HardwareInfo &hwInfoIn, ExecutionEnvironment &executionEnvironment);
3232
~CommandStreamReceiverWithAUBDump() override;
3333

3434
CommandStreamReceiverWithAUBDump(const CommandStreamReceiverWithAUBDump &) = delete;

runtime/command_stream/command_stream_receiver_with_aub_dump.inl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ namespace OCLRT {
2828
extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE];
2929

3030
template <typename BaseCSR>
31-
CommandStreamReceiverWithAUBDump<BaseCSR>::CommandStreamReceiverWithAUBDump(const HardwareInfo &hwInfoIn)
32-
: BaseCSR(hwInfoIn, nullptr) {
33-
aubCSR = AUBCommandStreamReceiver::create(hwInfoIn, "aubfile", false);
31+
CommandStreamReceiverWithAUBDump<BaseCSR>::CommandStreamReceiverWithAUBDump(const HardwareInfo &hwInfoIn, ExecutionEnvironment &executionEnvironment)
32+
: BaseCSR(hwInfoIn, nullptr, executionEnvironment) {
33+
aubCSR = AUBCommandStreamReceiver::create(hwInfoIn, "aubfile", false, executionEnvironment);
3434
}
3535

3636
template <typename BaseCSR>

0 commit comments

Comments
 (0)