mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Add tests for AdapterBDF/FileDescriptor passed to gmm
Related-To: NEO-4168 Change-Id: Ic68ac8a6d8eb0c33cb51fc7ff10e85510d470241 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
e50039b9f0
commit
877b82a8e7
11
core/unit_tests/os_interface/linux/CMakeLists.txt
Normal file
11
core/unit_tests/os_interface/linux/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(NEO_CORE_OS_INTERFACE_TESTS_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper_tests_linux.cpp
|
||||
)
|
||||
set_property(GLOBAL PROPERTY NEO_CORE_OS_INTERFACE_TESTS_LINUX ${NEO_CORE_OS_INTERFACE_TESTS_LINUX})
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "core/gmm_helper/gmm_helper.h"
|
||||
#include "core/helpers/options.h"
|
||||
#include "unit_tests/helpers/variable_backup.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
extern GMM_INIT_IN_ARGS passedInputArgs;
|
||||
extern bool copyInputArgs;
|
||||
|
||||
TEST(GmmHelperTest, whenCreateGmmHelperWithoutOsInterfaceThenPassedFileDescriptorIsZeroed) {
|
||||
std::unique_ptr<GmmHelper> gmmHelper;
|
||||
VariableBackup<decltype(passedInputArgs)> passedInputArgsBackup(&passedInputArgs);
|
||||
VariableBackup<decltype(copyInputArgs)> copyInputArgsBackup(©InputArgs, true);
|
||||
|
||||
uint32_t expectedFileDescriptor = 0u;
|
||||
|
||||
gmmHelper.reset(new GmmHelper(nullptr, platformDevices[0]));
|
||||
EXPECT_EQ(expectedFileDescriptor, passedInputArgs.FileDescriptor);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user