mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 17:29:14 +08:00
Test Lrca initialization
- debug mode LRI must be present Change-Id: Idd9f9a85b9610177cb7ca378e37178ce333aa8b2
This commit is contained in:
committed by
sys_ocldev
parent
b728526c4e
commit
e5a8616d26
11
unit_tests/aub_mem_dump/CMakeLists.txt
Normal file
11
unit_tests/aub_mem_dump/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Copyright (C) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_aub_mem_dump_tests
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lrca_helper_tests.cpp
|
||||
)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_aub_mem_dump_tests})
|
||||
31
unit_tests/aub_mem_dump/lrca_helper_tests.cpp
Normal file
31
unit_tests/aub_mem_dump/lrca_helper_tests.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "runtime/aub_mem_dump/aub_mem_dump.h"
|
||||
#include "test.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace AubMemDump;
|
||||
|
||||
TEST(LrcaHelper, WhenLrcaHelperIsInitializedThenLrcaIncludesDebugModeLri) {
|
||||
LrcaHelper helper(0x2000);
|
||||
|
||||
auto lrcaBufferSize = helper.sizeLRCA / sizeof(uint32_t);
|
||||
auto lrca = std::unique_ptr<uint32_t[]>(new uint32_t[lrcaBufferSize]);
|
||||
helper.initialize(reinterpret_cast<void *>(lrca.get()));
|
||||
|
||||
bool debugModeLriFound = false;
|
||||
for (uint32_t i = 0; i < lrcaBufferSize; i += 2) {
|
||||
if (lrca[i] == 0x20d8 && lrca[i + 1] == 0x00200020) {
|
||||
debugModeLriFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_TRUE(debugModeLriFound);
|
||||
}
|
||||
Reference in New Issue
Block a user