mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Method to get attention bitmask from threads vector
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9bca773b91
commit
c4950eb892
@@ -7,6 +7,7 @@
|
||||
set(NEO_CORE_test_macros
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/header${BRANCH_DIR_SUFFIX}/test.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/matchers.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_checks_shared.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_checks_shared.h
|
||||
)
|
||||
|
||||
29
shared/test/common/test_macros/matchers.h
Normal file
29
shared/test/common/test_macros/matchers.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "gmock/gmock.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <string.h>
|
||||
|
||||
MATCHER_P2(MemCompare, memory, size, "") {
|
||||
return memcmp(arg, memory, size) == 0;
|
||||
}
|
||||
|
||||
MATCHER_P(MemoryZeroed, size, "") {
|
||||
size_t sizeLeft = (size_t)size;
|
||||
bool memoryZeroed = true;
|
||||
while (--sizeLeft) {
|
||||
uint8_t *pMem = (uint8_t *)arg;
|
||||
if (pMem[sizeLeft] != 0) {
|
||||
memoryZeroed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return memoryZeroed;
|
||||
}
|
||||
Reference in New Issue
Block a user