mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Enable sfence instruction programming for DirectSubmission dispatch
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f4407064a4
commit
6e9c890890
@@ -38,6 +38,12 @@ struct TagData {
|
||||
uint64_t tagValue = 0ull;
|
||||
};
|
||||
|
||||
enum class DirectSubmissionSfenceMode : int32_t {
|
||||
Disabled = 0,
|
||||
BeforeSemaphoreOnly = 1,
|
||||
BeforeAndAfterSemaphore = 2
|
||||
};
|
||||
|
||||
namespace UllsDefaults {
|
||||
constexpr bool defaultDisableCacheFlush = true;
|
||||
constexpr bool defaultDisableMonitorFence = false;
|
||||
@@ -153,6 +159,7 @@ class DirectSubmissionHw {
|
||||
uint32_t workloadModeOneExpectedValue = 0u;
|
||||
uint32_t activeTiles = 1u;
|
||||
uint32_t postSyncOffset = 0u;
|
||||
DirectSubmissionSfenceMode sfenceMode = DirectSubmissionSfenceMode::BeforeAndAfterSemaphore;
|
||||
volatile uint32_t reserved = 0u;
|
||||
|
||||
bool ringStart = false;
|
||||
|
||||
@@ -39,6 +39,10 @@ DirectSubmissionHw<GfxFamily, Dispatcher>::DirectSubmissionHw(Device &device,
|
||||
disableCacheFlush = !!DebugManager.flags.DirectSubmissionDisableCacheFlush.get();
|
||||
}
|
||||
|
||||
if (DebugManager.flags.DirectSubmissionInsertSfenceInstructionPriorToSubmission.get() != -1) {
|
||||
sfenceMode = static_cast<DirectSubmissionSfenceMode>(DebugManager.flags.DirectSubmissionInsertSfenceInstructionPriorToSubmission.get());
|
||||
}
|
||||
|
||||
int32_t disableCacheFlushKey = DebugManager.flags.DirectSubmissionDisableCpuCacheFlush.get();
|
||||
if (disableCacheFlushKey != -1) {
|
||||
disableCpuCacheFlush = disableCacheFlushKey == 1 ? true : false;
|
||||
@@ -435,14 +439,14 @@ bool DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchCommandBuffer(BatchBuffe
|
||||
reserved = *ringBufferStart;
|
||||
}
|
||||
|
||||
if (DebugManager.flags.DirectSubmissionInsertSfenceInstructionPriorToSubmission.get() >= 1) {
|
||||
if (sfenceMode >= DirectSubmissionSfenceMode::BeforeSemaphoreOnly) {
|
||||
CpuIntrinsics::sfence();
|
||||
}
|
||||
|
||||
//unblock GPU
|
||||
semaphoreData->QueueWorkCount = currentQueueWorkCount;
|
||||
|
||||
if (DebugManager.flags.DirectSubmissionInsertSfenceInstructionPriorToSubmission.get() == 2) {
|
||||
if (sfenceMode == DirectSubmissionSfenceMode::BeforeAndAfterSemaphore) {
|
||||
CpuIntrinsics::sfence();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user