Skip to content

Commit 66f9fa0

Browse files
fix: init buffer in BarrierBetweenKernels
Initialize buffer data in both cases. New allocation is not guaranteed to be zero initialized. Related-To: NEO-6893 Signed-off-by: Dominik Dabek <[email protected]>
1 parent 67628e5 commit 66f9fa0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

source/benchmarks/gpu_cmds_benchmark/implementations/l0/barrier_between_kernels_l0.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,17 @@ static TestResult run(const BarrierBetweenKernelsArguments &arguments, Statistic
6060

6161
ASSERT_ZE_RESULT_SUCCESS(zeContextMakeMemoryResident(levelzero.context, levelzero.device, outputBuffer, outputBufferSize));
6262

63-
if (arguments.onlyReads == 0) {
64-
// Create command list
63+
{
64+
// Initialize buffer data
6565
ze_command_list_desc_t cmdListDesc{};
6666
cmdListDesc.commandQueueGroupOrdinal = levelzero.commandQueueDesc.ordinal;
6767
ze_command_list_handle_t cmdListForFill{};
6868

6969
ASSERT_ZE_RESULT_SUCCESS(zeCommandListCreate(levelzero.context, levelzero.device, &cmdListDesc, &cmdListForFill));
70-
uint32_t pattern = 1u;
70+
uint32_t pattern = arguments.onlyReads == 0 ? 1u : 0u;
7171
ASSERT_ZE_RESULT_SUCCESS(zeCommandListAppendMemoryFill(cmdListForFill, outputBuffer, &pattern, sizeof(uint32_t), outputBufferSize, nullptr, 0, nullptr));
7272
ASSERT_ZE_RESULT_SUCCESS(zeCommandListClose(cmdListForFill));
7373

74-
// Warmup
7574
ASSERT_ZE_RESULT_SUCCESS(zeCommandQueueExecuteCommandLists(levelzero.commandQueue, 1, &cmdListForFill, nullptr));
7675
ASSERT_ZE_RESULT_SUCCESS(zeCommandQueueSynchronize(levelzero.commandQueue, std::numeric_limits<uint64_t>::max()));
7776
}

0 commit comments

Comments
 (0)