Skip to content

Commit

Permalink
[refactoring, tools] Remove get_numa_id duplication (#1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhukova authored Sep 9, 2024
1 parent 4a45a93 commit 566e77f
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 20 deletions.
2 changes: 2 additions & 0 deletions tools/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ add_executable(qpl_benchmarks

target_link_libraries(qpl_benchmarks
PRIVATE qpl
PRIVATE tool_common
PRIVATE tool_hw_dispatcher
PRIVATE benchmark
"$<$<PLATFORM_ID:Linux>:stdc++fs>"
Expand All @@ -32,6 +33,7 @@ get_target_property(GBENCH_SOURCE_DIR benchmark SOURCE_DIR)
target_include_directories(qpl_benchmarks
PRIVATE $<BUILD_INTERFACE:${QPL_PROJECT_DIR}/include/> $<INSTALL_INTERFACE:include>
PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/include
PRIVATE $<TARGET_PROPERTY:tool_common,INTERFACE_INCLUDE_DIRECTORIES>
PRIVATE $<TARGET_PROPERTY:tool_hw_dispatcher,INTERFACE_INCLUDE_DIRECTORIES>
PRIVATE ${GBENCH_SOURCE_DIR})

Expand Down
4 changes: 3 additions & 1 deletion tools/utils/common/dispatcher_checks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
#ifndef QPL_TOOLS_UTILS_COMMON_DISPATCHER_CHECKS_HPP_
#define QPL_TOOLS_UTILS_COMMON_DISPATCHER_CHECKS_HPP_

// tool_hw_dispatcher
#include "test_hw_dispatcher.hpp"

// tool_common
#include "system_info.hpp"
#include "topology.hpp"

namespace qpl::test {

Expand Down
4 changes: 3 additions & 1 deletion tools/utils/common/opcfg_checks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
#ifndef QPL_TOOLS_UTILS_COMMON_OPCFG_CHECKS_HPP_
#define QPL_TOOLS_UTILS_COMMON_OPCFG_CHECKS_HPP_

// tool_hw_dispatcher
#include "test_hw_dispatcher.hpp"

// tool_common
#include "system_info.hpp"
#include "topology.hpp"

namespace qpl::test {

Expand Down
18 changes: 0 additions & 18 deletions tools/utils/common/system_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,24 +192,6 @@ static inline bool is_madv_pageout_available() {
return is_version_ge_5_4;
}

/**
* @brief Returns current numa_id, -1 on error
*
*/
static inline int32_t get_numa_id() {
#if defined(__linux__)
uint32_t tsc_aux = 0U;

__rdtscp(&tsc_aux);

// Linux encodes NUMA node into [32:12] of TSC_AUX
return static_cast<int32_t>(tsc_aux >> 12);
#else
// Not supported in Windows yet
return -1;
#endif
}

} // namespace qpl::test

#endif // QPL_TOOLS_UTILS_COMMON_SYSTEM_INFO_HPP_
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tools/utils/hw_dispatcher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ add_library(tool_hw_dispatcher OBJECT ${TOOLS_HW_DISPATCH_SRC})

target_include_directories(tool_hw_dispatcher
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PRIVATE $<TARGET_PROPERTY:tool_common,INTERFACE_INCLUDE_DIRECTORIES>
PRIVATE $<TARGET_PROPERTY:qpl,INTERFACE_INCLUDE_DIRECTORIES>)

set_target_properties(tool_hw_dispatcher PROPERTIES
Expand Down
2 changes: 2 additions & 0 deletions tools/utils/hw_dispatcher/test_hw_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <queue>

#include "test_hw_device.hpp"

// tool_common
#include "topology.hpp"

constexpr uint8_t accelerator_name[] = "iax"; /**< Accelerator name */
Expand Down

0 comments on commit 566e77f

Please sign in to comment.