mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
use test_files from source location in ults
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
685b9396d4
commit
dc78375d46
@@ -10,10 +10,13 @@
|
||||
#include "shared/source/helpers/file_io.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "test_files_setup.h"
|
||||
|
||||
std::string testFiles("test_files/" NEO_ARCH "/");
|
||||
std::string testFilesApiSpecific("test_files/" NEO_ARCH "/");
|
||||
std::string clFiles("test_files/");
|
||||
std::string sharedFiles(NEO_SHARED_TEST_FILES_DIR);
|
||||
std::string sharedBuiltinsDir(NEO_SHARED_BUILTINS_DIR);
|
||||
std::string binaryNameSuffix("");
|
||||
|
||||
void retrieveBinaryKernelFilename(std::string &outputFilename, const std::string &kernelName, const std::string &extension, const std::string &options) {
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
extern std::string testFiles;
|
||||
extern std::string testFilesApiSpecific;
|
||||
extern std::string sharedFiles;
|
||||
extern std::string sharedBuiltinsDir;
|
||||
extern std::string clFiles;
|
||||
extern std::string binaryNameSuffix;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -7,22 +7,27 @@
|
||||
|
||||
#include "shared/source/utilities/directory.h"
|
||||
|
||||
#include "test_files_setup.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <dirent.h>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
std::string byPathPattern(std::string(NEO_SHARED_TEST_FILES_DIR) + "/linux/by-path");
|
||||
std::string deviceDrmPath(std::string(NEO_SHARED_TEST_FILES_DIR) + "/linux/devices/device/drm");
|
||||
|
||||
std::vector<std::string> Directory::getFiles(const std::string &path) {
|
||||
std::vector<std::string> files;
|
||||
if (path == "./test_files/linux/by-path") {
|
||||
files.push_back("./test_files/linux/by-path/pci-0000:00:02.0-card");
|
||||
files.push_back("./test_files/linux/by-path/pci-0000:00:02.0-render");
|
||||
files.push_back("./test_files/linux/by-path/pci-0000:00:03.0-card");
|
||||
files.push_back("./test_files/linux/by-path/pci-0000:00:03.0-render");
|
||||
if (path == byPathPattern) {
|
||||
files.push_back(byPathPattern + "/pci-0000:00:02.0-card");
|
||||
files.push_back(byPathPattern + "/pci-0000:00:02.0-render");
|
||||
files.push_back(byPathPattern + "/pci-0000:00:03.0-card");
|
||||
files.push_back(byPathPattern + "/pci-0000:00:03.0-render");
|
||||
return files;
|
||||
}
|
||||
if (path == "./test_files/linux/devices/device/drm") {
|
||||
files.push_back("./test_files/linux/devices/device/drm/card1");
|
||||
if (path == deviceDrmPath) {
|
||||
files.push_back(deviceDrmPath + "/card1");
|
||||
return files;
|
||||
}
|
||||
if (path == "/sys/class/intel_pmt") {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "common/gtsysinfo.h"
|
||||
#include "igfxfmid.h"
|
||||
#include "test_files_setup.h"
|
||||
|
||||
namespace Os {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -24,9 +25,9 @@ const char *metricsLibraryDllName = "";
|
||||
const char *gdiDllName = "";
|
||||
const char *dxcoreDllName = "";
|
||||
#endif
|
||||
const char *sysFsPciPathPrefix = "./test_files/linux/devices/";
|
||||
const char *pciDevicesDirectory = "./test_files/linux/by-path";
|
||||
const char *sysFsProcPathPrefix = "./test_files/linux/proc/";
|
||||
const char *sysFsPciPathPrefix = NEO_SHARED_TEST_FILES_DIR "/linux/devices/";
|
||||
const char *pciDevicesDirectory = NEO_SHARED_TEST_FILES_DIR "/linux/by-path";
|
||||
const char *sysFsProcPathPrefix = NEO_SHARED_TEST_FILES_DIR "/linux/proc/";
|
||||
} // namespace Os
|
||||
|
||||
NEO::OsLibrary *setAdapterInfo(const PLATFORM *platform, const GT_SYSTEM_INFO *gtSystemInfo, uint64_t gpuAddressSpace) {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "shared/source/os_interface/linux/sys_calls.h"
|
||||
|
||||
#include "drm/i915_drm.h"
|
||||
#include "test_files_setup.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
@@ -68,7 +69,7 @@ int open(const char *file, int flags) {
|
||||
if (strcmp(file, "/dev/dri/by-path/pci-0000:invalid-render") == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (strcmp(file, "./test_files/linux/by-path/pci-0000:00:02.0-render") == 0) {
|
||||
if (strcmp(file, NEO_SHARED_TEST_FILES_DIR "/linux/by-path/pci-0000:00:02.0-render") == 0) {
|
||||
return fakeFileDescriptor;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,23 +49,6 @@ function(compile_kernels_gen platform_name_with_type revision_id platform_name s
|
||||
set(compiled_kernels_${platform_name_with_type}_${revision_id} ${compiled_kernels_${platform_name_with_type}_${revision_id}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(neo_shared_copy_test_files target product revision_id)
|
||||
string(TOLOWER ${product} product)
|
||||
set(dest_dir "${TargetDir}/${product}/${revision_id}/test_files")
|
||||
set(source_dir "${NEO_SOURCE_DIR}/shared/test/common/test_files")
|
||||
add_custom_target(${target})
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND echo copying test files from ${source_dir} to ${dest_dir}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${source_dir} ${dest_dir}
|
||||
WORKING_DIRECTORY ${TargetDir}
|
||||
DEPENDS ${source_dir}
|
||||
)
|
||||
add_dependencies(${target} copy_compiler_files)
|
||||
set_target_properties(${target} PROPERTIES FOLDER "${SHARED_TEST_PROJECTS_FOLDER}/${SHARED_TEST_PROJECTS_SUB_FOLDER}/${PLATFORM_SPECIFIC_TEST_TARGETS_FOLDER}/${product}/${revision_id}")
|
||||
endfunction()
|
||||
|
||||
file(GLOB_RECURSE TEST_KERNELS *.cl)
|
||||
file(GLOB_RECURSE TEST_KERNELS_IMAGES *_images.cl)
|
||||
add_custom_target(prepare_test_kernels_for_shared)
|
||||
@@ -80,8 +63,7 @@ macro(macro_for_each_platform)
|
||||
foreach(PLATFORM_TYPE ${PLATFORM_TYPES})
|
||||
foreach(REVISION_ID ${${PLATFORM_TYPE}_${CORE_TYPE}_REVISIONS})
|
||||
if(${PLATFORM_IT}_IS_${PLATFORM_TYPE})
|
||||
neo_shared_copy_test_files(copy_test_kernel_${PLATFORM_IT_LOWER}_${REVISION_ID} ${PLATFORM_IT} ${REVISION_ID})
|
||||
add_dependencies(prepare_test_kernels_for_shared copy_test_kernel_${PLATFORM_IT_LOWER}_${REVISION_ID})
|
||||
add_dependencies(prepare_test_kernels_for_shared copy_compiler_files)
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
3000
|
||||
@@ -0,0 +1 @@
|
||||
4000
|
||||
@@ -0,0 +1 @@
|
||||
2000
|
||||
@@ -0,0 +1 @@
|
||||
2.0
|
||||
19
shared/test/common/test_files/linux/proc/self/maps
Normal file
19
shared/test/common/test_files/linux/proc/self/maps
Normal file
@@ -0,0 +1,19 @@
|
||||
564fcd1fa000-564fcd202000 r-xp 00000000 08:03 3670041 /bin/cat
|
||||
564fcd401000-564fcd402000 r--p 00007000 08:03 3670041 /bin/cat
|
||||
564fcd402000-564fcd403000 rw-p 00008000 08:03 3670041 /bin/cat
|
||||
564fcdf40000-564fcdf61000 rw-p 00000000 00:00 0 [heap]
|
||||
7fded3d79000-7fded4879000 r--p 00000000 08:03 3938831 /usr/lib/locale/locale-archive
|
||||
7fded4879000-7fded4a60000 r-xp 00000000 08:03 4199137 /lib/x86_64-linux-gnu/libc-2.27.so
|
||||
7fded4a60000-7fded4c60000 ---p 001e7000 08:03 4199137 /lib/x86_64-linux-gnu/libc-2.27.so
|
||||
7fded4c60000-7fded4c64000 r--p 001e7000 08:03 4199137 /lib/x86_64-linux-gnu/libc-2.27.so
|
||||
7fded4c64000-7fded4c66000 rw-p 001eb000 08:03 4199137 /lib/x86_64-linux-gnu/libc-2.27.so
|
||||
7fded4c66000-7fded4c6a000 rw-p 00000000 00:00 0
|
||||
7fded4c6a000-7fded4c91000 r-xp 00000000 08:03 4199109 /lib/x86_64-linux-gnu/ld-2.27.so
|
||||
7fded4e54000-7fded4e78000 rw-p 00000000 00:00 0
|
||||
7fded4e91000-7fded4e92000 r--p 00027000 08:03 4199109 /lib/x86_64-linux-gnu/ld-2.27.so
|
||||
7fded4e92000-7fded4e93000 rw-p 00028000 08:03 4199109 /lib/x86_64-linux-gnu/ld-2.27.so
|
||||
7fded4e93000-7fded4e94000 rw-p 00000000 00:00 0
|
||||
7ffd6dfa2000-7ffd6dfc3000 rw-p 00000000 00:00 0 [stack]
|
||||
7ffd6dfe8000-7ffd6dfeb000 r--p 00000000 00:00 0 [vvar]
|
||||
7ffd6dfeb000-7ffd6dfec000 r-xp 00000000 00:00 0 [vdso]
|
||||
ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall]
|
||||
Reference in New Issue
Block a user