Skip to content

Commit

Permalink
#13556: Unvendor magic_enum and upgrade to latest release (v0.9.6) (#…
Browse files Browse the repository at this point in the history
…13557)

* #13556: Unvendor magic_enum and upgrade to latest release (v0.9.6)

* #13556: Use <> to designate it's third-party
  • Loading branch information
tt-rkim authored Oct 9, 2024
1 parent facce1f commit 2f09f89
Show file tree
Hide file tree
Showing 40 changed files with 41 additions and 1,526 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
build-artifact:
needs: build-docker-image
if: always()
timeout-minutes: 30
strategy:
matrix:
arch: ${{ fromJson(inputs.arch || '["grayskull", "wormhole_b0", "blackhole"]') }}
Expand Down
6 changes: 6 additions & 0 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@ CPMAddPackage(
GITHUB_REPOSITORY boost-ext/reflect
GIT_TAG v1.1.1
)

CPMAddPackage(
NAME magic_enum
GITHUB_REPOSITORY Neargye/magic_enum
GIT_TAG v0.9.6
)
3 changes: 1 addition & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
enable_testing()
include(GoogleTest)
add_library(test_common_libs INTERFACE)
target_link_libraries(test_common_libs INTERFACE pthread gtest gtest_main)
target_link_libraries(test_common_libs INTERFACE pthread gtest gtest_main magic_enum)

if(TT_METAL_BUILD_TESTS)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tt_metal/tt_metal)
Expand All @@ -12,4 +12,3 @@ if(TTNN_BUILD_TESTS)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tt_eager) # this should go away and be replaced with link to ttnn
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ttnn/unit_tests/gtests)
endif(TTNN_BUILD_TESTS)

2 changes: 1 addition & 1 deletion tests/tt_eager/ops/test_bcast_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "ttnn/tensor/tensor.hpp"
#include "ttnn/operations/data_movement/bcast/bcast.hpp"
#include "common/constants.hpp"
#include "third_party/magic_enum/magic_enum.hpp"
#include <magic_enum.hpp>
#include <ttnn/operations/numpy/functions.hpp>

#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion tests/tt_eager/ops/test_sfpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <cmath>
#include <sstream>

#include "third_party/magic_enum/magic_enum.hpp"
#include <magic_enum.hpp>

#include "tt_metal/host_api.hpp"
#include "tt_metal/detail/tt_metal.hpp"
Expand Down
2 changes: 1 addition & 1 deletion tests/tt_metal/tt_metal/unit_tests_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set(UNIT_TESTS_COMMON_SRC
${CMAKE_CURRENT_SOURCE_DIR}/watcher/test_link_training.cpp
)
add_library(unit_tests_common_o OBJECT ${UNIT_TESTS_COMMON_SRC})
target_link_libraries(unit_tests_common_o PUBLIC compiler_flags metal_header_directories gtest gtest_main)
target_link_libraries(unit_tests_common_o PUBLIC compiler_flags metal_header_directories gtest gtest_main magic_enum)
target_include_directories(unit_tests_common_o PUBLIC
${UMD_HOME}
${PROJECT_SOURCE_DIR}
Expand Down
3 changes: 1 addition & 2 deletions tt_metal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ set(TT_METAL_OBJECTS

add_library(tt_metal ${TT_METAL_OBJECTS})

target_link_libraries(tt_metal PUBLIC metal_header_directories umd_device metal_common_libs)
target_link_libraries(tt_metal PUBLIC metal_header_directories umd_device metal_common_libs magic_enum)

target_precompile_headers(tt_metal PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/third_party/magic_enum/magic_enum.hpp
${CMAKE_CURRENT_SOURCE_DIR}/third_party/tracy/public/tracy/Tracy.hpp
${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmt/fmt/core.h
${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmt/fmt/format.h
Expand Down
2 changes: 1 addition & 1 deletion tt_metal/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(COMMON_SRCS

add_library(common OBJECT ${COMMON_SRCS})
target_link_libraries(common PRIVATE yaml-cpp::yaml-cpp)
target_link_libraries(common PUBLIC compiler_flags metal_header_directories)
target_link_libraries(common PUBLIC compiler_flags metal_header_directories magic_enum)

target_include_directories(common PUBLIC
${UMD_HOME}
Expand Down
2 changes: 1 addition & 1 deletion tt_metal/common/tt_backend_api_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

#include "tt_backend_api_types.hpp"
#include "third_party/magic_enum/magic_enum.hpp"
#include <magic_enum.hpp>

std::string tt::get_string(tt::ARCH arch) {
switch (arch) {
Expand Down
2 changes: 1 addition & 1 deletion tt_metal/impl/allocator/allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "tt_metal/impl/allocator/allocator.hpp"

#include "third_party/magic_enum/magic_enum.hpp"
#include <magic_enum.hpp>
#include "tt_metal/common/math.hpp"
#include "tt_metal/detail/util.hpp"
#include "tt_metal/hostdevcommon/common_runtime_address_map.h"
Expand Down
2 changes: 1 addition & 1 deletion tt_metal/impl/dispatch/command_queue_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "tt_metal/llrt/llrt.hpp"
#include "tt_metal/llrt/hal.hpp"

#include "third_party/magic_enum/magic_enum.hpp"
#include <magic_enum.hpp>

using namespace tt::tt_metal;

Expand Down
2 changes: 1 addition & 1 deletion tt_metal/impl/dispatch/data_collection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "tt_metal/impl/kernels/kernel.hpp"
#include "tt_metal/common/core_coord.h"

#include "third_party/magic_enum/magic_enum.hpp"
#include <magic_enum.hpp>

using namespace tt;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "common/bfloat16.hpp"

#include "third_party/magic_enum/magic_enum.hpp"
#include <magic_enum.hpp>

using namespace tt;
using namespace tt::tt_metal;
Expand Down
2 changes: 1 addition & 1 deletion tt_metal/programming_examples/matmul_common/bmm_op.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "tt_metal/common/bfloat16.hpp"

#include "third_party/umd/device/tt_xy_pair.h"
#include "third_party/magic_enum/magic_enum.hpp"
#include <magic_enum.hpp>

#include "tt_metal/common/work_split.hpp"

Expand Down
21 changes: 0 additions & 21 deletions tt_metal/third_party/magic_enum/LICENSE

This file was deleted.

30 changes: 0 additions & 30 deletions tt_metal/third_party/magic_enum/LICENSE.txt

This file was deleted.

Loading

0 comments on commit 2f09f89

Please sign in to comment.