Skip to content

Commit

Permalink
Merge tag '埋め込みファイルの数が多いとARMHFでビルドエラーが出るかも' into patch-armhf-large-nu…
Browse files Browse the repository at this point in the history
…mber-embed-test
  • Loading branch information
aoirint committed Jun 27, 2022
2 parents 2750a1c + d6a7dd8 commit 6d4640e
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 10 deletions.
66 changes: 60 additions & 6 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,36 @@ if(EXISTS "${MODEL_DIR}/metas.json"
AND EXISTS "${MODEL_DIR}/yukarin_sa.onnx"
AND EXISTS "${MODEL_DIR}/decode.onnx")
message("Models exist.")
EMBED_TARGET(YUKARIN_S "${MODEL_DIR}/yukarin_s.onnx")
EMBED_TARGET(YUKARIN_SA "${MODEL_DIR}/yukarin_sa.onnx")
EMBED_TARGET(DECODE "${MODEL_DIR}/decode.onnx")
EMBED_TARGET(YUKARIN_S0 "${MODEL_DIR}/yukarin_s.onnx")
EMBED_TARGET(YUKARIN_SA0 "${MODEL_DIR}/yukarin_sa.onnx")
EMBED_TARGET(DECODE0 "${MODEL_DIR}/decode.onnx")
EMBED_TARGET(YUKARIN_S1 "${MODEL_DIR}/yukarin_s.onnx")
EMBED_TARGET(YUKARIN_SA1 "${MODEL_DIR}/yukarin_sa.onnx")
EMBED_TARGET(DECODE1 "${MODEL_DIR}/decode.onnx")
EMBED_TARGET(YUKARIN_S2 "${MODEL_DIR}/yukarin_s.onnx")
EMBED_TARGET(YUKARIN_SA2 "${MODEL_DIR}/yukarin_sa.onnx")
EMBED_TARGET(DECODE2 "${MODEL_DIR}/decode.onnx")
EMBED_TARGET(YUKARIN_S3 "${MODEL_DIR}/yukarin_s.onnx")
EMBED_TARGET(YUKARIN_SA3 "${MODEL_DIR}/yukarin_sa.onnx")
EMBED_TARGET(DECODE3 "${MODEL_DIR}/decode.onnx")
EMBED_TARGET(YUKARIN_S4 "${MODEL_DIR}/yukarin_s.onnx")
EMBED_TARGET(YUKARIN_SA4 "${MODEL_DIR}/yukarin_sa.onnx")
EMBED_TARGET(DECODE4 "${MODEL_DIR}/decode.onnx")
EMBED_TARGET(YUKARIN_S5 "${MODEL_DIR}/yukarin_s.onnx")
EMBED_TARGET(YUKARIN_SA5 "${MODEL_DIR}/yukarin_sa.onnx")
EMBED_TARGET(DECODE5 "${MODEL_DIR}/decode.onnx")
EMBED_TARGET(YUKARIN_S6 "${MODEL_DIR}/yukarin_s.onnx")
EMBED_TARGET(YUKARIN_SA6 "${MODEL_DIR}/yukarin_sa.onnx")
EMBED_TARGET(DECODE6 "${MODEL_DIR}/decode.onnx")
EMBED_TARGET(YUKARIN_S7 "${MODEL_DIR}/yukarin_s.onnx")
EMBED_TARGET(YUKARIN_SA7 "${MODEL_DIR}/yukarin_sa.onnx")
EMBED_TARGET(DECODE7 "${MODEL_DIR}/decode.onnx")
EMBED_TARGET(YUKARIN_S8 "${MODEL_DIR}/yukarin_s.onnx")
EMBED_TARGET(YUKARIN_SA8 "${MODEL_DIR}/yukarin_sa.onnx")
EMBED_TARGET(DECODE8 "${MODEL_DIR}/decode.onnx")
EMBED_TARGET(YUKARIN_S9 "${MODEL_DIR}/yukarin_s.onnx")
EMBED_TARGET(YUKARIN_SA9 "${MODEL_DIR}/yukarin_sa.onnx")
EMBED_TARGET(DECODE9 "${MODEL_DIR}/decode.onnx")
EMBED_TARGET(METAS "${MODEL_DIR}/metas.json")
else()
message(FATAL_ERROR "Unable to find Model. Use option -DMODEL_DIR=...")
Expand All @@ -30,9 +57,36 @@ file(GLOB_RECURSE core_sources "src/*.cpp")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
add_library(core
SHARED ${core_sources}
${EMBED_YUKARIN_S_OUTPUTS}
${EMBED_YUKARIN_SA_OUTPUTS}
${EMBED_DECODE_OUTPUTS}
${EMBED_YUKARIN_S0_OUTPUTS}
${EMBED_YUKARIN_SA0_OUTPUTS}
${EMBED_DECODE0_OUTPUTS}
${EMBED_YUKARIN_S1_OUTPUTS}
${EMBED_YUKARIN_SA1_OUTPUTS}
${EMBED_DECODE1_OUTPUTS}
${EMBED_YUKARIN_S2_OUTPUTS}
${EMBED_YUKARIN_SA2_OUTPUTS}
${EMBED_DECODE2_OUTPUTS}
${EMBED_YUKARIN_S3_OUTPUTS}
${EMBED_YUKARIN_SA3_OUTPUTS}
${EMBED_DECODE3_OUTPUTS}
${EMBED_YUKARIN_S4_OUTPUTS}
${EMBED_YUKARIN_SA4_OUTPUTS}
${EMBED_DECODE4_OUTPUTS}
${EMBED_YUKARIN_S5_OUTPUTS}
${EMBED_YUKARIN_SA5_OUTPUTS}
${EMBED_DECODE5_OUTPUTS}
${EMBED_YUKARIN_S6_OUTPUTS}
${EMBED_YUKARIN_SA6_OUTPUTS}
${EMBED_DECODE6_OUTPUTS}
${EMBED_YUKARIN_S7_OUTPUTS}
${EMBED_YUKARIN_SA7_OUTPUTS}
${EMBED_DECODE7_OUTPUTS}
${EMBED_YUKARIN_S8_OUTPUTS}
${EMBED_YUKARIN_SA8_OUTPUTS}
${EMBED_DECODE8_OUTPUTS}
${EMBED_YUKARIN_S9_OUTPUTS}
${EMBED_YUKARIN_SA9_OUTPUTS}
${EMBED_DECODE9_OUTPUTS}
${EMBED_METAS_OUTPUTS})

# -DONNXRUNTIME_DIRで指定されたパスをもとにonnxruntimeのライブラリを取得する。失敗した場合はfatal error
Expand Down
44 changes: 40 additions & 4 deletions core/src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,36 @@ static std::string supported_devices_str;
EMBED_DECL(METAS);

namespace EMBED_DECL_NAMESPACE {
EMBED_DECL(YUKARIN_S);
EMBED_DECL(YUKARIN_SA);
EMBED_DECL(DECODE);
EMBED_DECL(YUKARIN_S0);
EMBED_DECL(YUKARIN_SA0);
EMBED_DECL(DECODE0);
EMBED_DECL(YUKARIN_S1);
EMBED_DECL(YUKARIN_SA1);
EMBED_DECL(DECODE1);
EMBED_DECL(YUKARIN_S2);
EMBED_DECL(YUKARIN_SA2);
EMBED_DECL(DECODE2);
EMBED_DECL(YUKARIN_S3);
EMBED_DECL(YUKARIN_SA3);
EMBED_DECL(DECODE3);
EMBED_DECL(YUKARIN_S4);
EMBED_DECL(YUKARIN_SA4);
EMBED_DECL(DECODE4);
EMBED_DECL(YUKARIN_S5);
EMBED_DECL(YUKARIN_SA5);
EMBED_DECL(DECODE5);
EMBED_DECL(YUKARIN_S6);
EMBED_DECL(YUKARIN_SA6);
EMBED_DECL(DECODE6);
EMBED_DECL(YUKARIN_S7);
EMBED_DECL(YUKARIN_SA7);
EMBED_DECL(DECODE7);
EMBED_DECL(YUKARIN_S8);
EMBED_DECL(YUKARIN_SA8);
EMBED_DECL(DECODE8);
EMBED_DECL(YUKARIN_S9);
EMBED_DECL(YUKARIN_SA9);
EMBED_DECL(DECODE9);

/**
* 3種類のモデルを一纏めにしたもの
Expand All @@ -51,7 +78,16 @@ struct VVMODEL {
embed::EMBED_RES (*DECODE)();
};
const VVMODEL VVMODEL_LIST[] = {
{YUKARIN_S, YUKARIN_SA, DECODE},
{YUKARIN_S0, YUKARIN_SA0, DECODE0},
{YUKARIN_S1, YUKARIN_SA1, DECODE1},
{YUKARIN_S2, YUKARIN_SA2, DECODE2},
{YUKARIN_S3, YUKARIN_SA3, DECODE3},
{YUKARIN_S4, YUKARIN_SA4, DECODE4},
{YUKARIN_S5, YUKARIN_SA5, DECODE5},
{YUKARIN_S6, YUKARIN_SA6, DECODE6},
{YUKARIN_S7, YUKARIN_SA7, DECODE7},
{YUKARIN_S8, YUKARIN_SA8, DECODE8},
{YUKARIN_S9, YUKARIN_SA9, DECODE9},
};
} // namespace EMBED_DECL_NAMESPACE
using EMBED_DECL_NAMESPACE::VVMODEL_LIST;
Expand Down

0 comments on commit 6d4640e

Please sign in to comment.