diff --git a/projects/rocprofiler-systems/cmake/Packages.cmake b/projects/rocprofiler-systems/cmake/Packages.cmake index 48bbe4fffe..2ca2d98cd2 100644 --- a/projects/rocprofiler-systems/cmake/Packages.cmake +++ b/projects/rocprofiler-systems/cmake/Packages.cmake @@ -1,3 +1,6 @@ +# Copyright (c) Advanced Micro Devices, Inc. +# SPDX-License-Identifier: MIT + # include guard include_guard(DIRECTORY) @@ -131,9 +134,6 @@ set(THREADS_PREFER_PTHREAD_FLAG OFF) find_library(pthread_LIBRARY NAMES pthread pthreads) find_package_handle_standard_args(pthread-library REQUIRED_VARS pthread_LIBRARY) -find_library(pthread_LIBRARY NAMES pthread pthreads) -find_package_handle_standard_args(pthread-library REQUIRED_VARS pthread_LIBRARY) - if(pthread_LIBRARY) target_link_libraries(rocprofiler-systems-threading INTERFACE ${pthread_LIBRARY}) else() diff --git a/projects/rocprofiler-systems/source/lib/core/CMakeLists.txt b/projects/rocprofiler-systems/source/lib/core/CMakeLists.txt index 694a098d56..824b3d9931 100644 --- a/projects/rocprofiler-systems/source/lib/core/CMakeLists.txt +++ b/projects/rocprofiler-systems/source/lib/core/CMakeLists.txt @@ -1,31 +1,5 @@ -# MIT License -# -# Copyright (c) 2025 Advanced Micro Devices, Inc. All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -# -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/defines.hpp.in - ${CMAKE_CURRENT_BINARY_DIR}/defines.hpp - @ONLY -) +# Copyright (c) Advanced Micro Devices, Inc. +# SPDX-License-Identifier: MIT set(core_sources ${CMAKE_CURRENT_LIST_DIR}/agent_manager.cpp @@ -64,6 +38,7 @@ set(core_headers ${CMAKE_CURRENT_LIST_DIR}/constraint.hpp ${CMAKE_CURRENT_LIST_DIR}/cpu.hpp ${CMAKE_CURRENT_LIST_DIR}/debug.hpp + ${CMAKE_CURRENT_LIST_DIR}/defines.hpp ${CMAKE_CURRENT_LIST_DIR}/demangler.hpp ${CMAKE_CURRENT_LIST_DIR}/dynamic_library.hpp ${CMAKE_CURRENT_LIST_DIR}/exception.hpp @@ -88,10 +63,7 @@ add_library( ALIAS rocprofiler-systems-core-library ) -target_sources( - rocprofiler-systems-core-library - PRIVATE ${core_sources} ${core_headers} ${CMAKE_CURRENT_BINARY_DIR}/defines.hpp -) +target_sources(rocprofiler-systems-core-library PRIVATE ${core_sources} ${core_headers}) add_subdirectory(binary) add_subdirectory(components) add_subdirectory(containers) diff --git a/projects/rocprofiler-systems/source/lib/core/defines.hpp b/projects/rocprofiler-systems/source/lib/core/defines.hpp new file mode 100644 index 0000000000..409e32eb24 --- /dev/null +++ b/projects/rocprofiler-systems/source/lib/core/defines.hpp @@ -0,0 +1,25 @@ +// Copyright (c) Advanced Micro Devices, Inc. +// SPDX-License-Identifier: MIT + +#pragma once + +#include "common/defines.h" + +#define ROCPROFSYS_METADATA(...) ::tim::manager::add_metadata(__VA_ARGS__) + +#if !defined(ROCPROFSYS_DEFAULT_OBJECT) +# define ROCPROFSYS_DEFAULT_OBJECT(NAME) \ + NAME() = default; \ + NAME(const NAME&) = default; \ + NAME(NAME&&) noexcept = default; \ + NAME& operator=(const NAME&) = default; \ + NAME& operator=(NAME&&) noexcept = default; +#endif + +#if !defined(ROCPROFSYS_DEFAULT_COPY_MOVE) +# define ROCPROFSYS_DEFAULT_COPY_MOVE(NAME) \ + NAME(const NAME&) = default; \ + NAME(NAME&&) noexcept = default; \ + NAME& operator=(const NAME&) = default; \ + NAME& operator=(NAME&&) noexcept = default; +#endif diff --git a/projects/rocprofiler-systems/source/lib/core/defines.hpp.in b/projects/rocprofiler-systems/source/lib/core/defines.hpp.in deleted file mode 100644 index 77e4c7ba7b..0000000000 --- a/projects/rocprofiler-systems/source/lib/core/defines.hpp.in +++ /dev/null @@ -1,44 +0,0 @@ -// MIT License -// -// Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All Rights Reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#pragma once - -#include "common/defines.h" - -#define ROCPROFSYS_METADATA(...) ::tim::manager::add_metadata(__VA_ARGS__) - -#if !defined(ROCPROFSYS_DEFAULT_OBJECT) -# define ROCPROFSYS_DEFAULT_OBJECT(NAME) \ - NAME() = default; \ - NAME(const NAME&) = default; \ - NAME(NAME&&) noexcept = default; \ - NAME& operator=(const NAME&) = default; \ - NAME& operator=(NAME&&) noexcept = default; -#endif - -#if !defined(ROCPROFSYS_DEFAULT_COPY_MOVE) -# define ROCPROFSYS_DEFAULT_COPY_MOVE(NAME) \ - NAME(const NAME&) = default; \ - NAME(NAME&&) noexcept = default; \ - NAME& operator=(const NAME&) = default; \ - NAME& operator=(NAME&&) noexcept = default; -#endif