From 92eb283fd0b44871f4df4497c46f3575796b568a Mon Sep 17 00:00:00 2001 From: zhanghao0689 Date: Mon, 15 Sep 2025 09:38:15 +0800 Subject: [PATCH] edit kernel type --- tests/activation/gelu/test_operator_fast_gelu.cpp | 8 ++++++-- .../activation/gelu/test_operator_fast_gelu_v2.cpp | 8 ++++++-- tests/activation/gelu/test_operator_gelu.cpp | 8 ++++++-- .../sigmoid/test_operator_vec_sigmoid.cpp | 8 ++++++-- tests/activation/silu/test_operator_silu.cpp | 8 ++++++-- tests/activation/swish/test_operator_swish.cpp | 8 ++++++-- .../test_operator_confusion_transpose.cpp | 14 +++++++------- 7 files changed, 43 insertions(+), 19 deletions(-) diff --git a/tests/activation/gelu/test_operator_fast_gelu.cpp b/tests/activation/gelu/test_operator_fast_gelu.cpp index 9594b068..ec97dba5 100644 --- a/tests/activation/gelu/test_operator_fast_gelu.cpp +++ b/tests/activation/gelu/test_operator_fast_gelu.cpp @@ -98,8 +98,12 @@ protected: { std::cout << "FastGeluTestSuite TearDownTestCase" << std::endl; } - virtual void SetUp() {} - virtual void TearDown() {} + virtual void SetUp() { + AscendC::SetGCoreType(2); + } + virtual void TearDown() { + AscendC::SetGCoreType(0); + } }; INSTANTIATE_TEST_CASE_P(TEST_PACKAGE_FastGelu, FastGeluTestSuite, diff --git a/tests/activation/gelu/test_operator_fast_gelu_v2.cpp b/tests/activation/gelu/test_operator_fast_gelu_v2.cpp index 2b9cb77b..f4d98b55 100644 --- a/tests/activation/gelu/test_operator_fast_gelu_v2.cpp +++ b/tests/activation/gelu/test_operator_fast_gelu_v2.cpp @@ -98,8 +98,12 @@ protected: { std::cout << "FastGeluV2TestSuite TearDownTestCase" << std::endl; } - virtual void SetUp() {} - virtual void TearDown() {} + virtual void SetUp() { + AscendC::SetGCoreType(2); + } + virtual void TearDown() { + AscendC::SetGCoreType(0); + } }; INSTANTIATE_TEST_CASE_P(TEST_PACKAGE_FastGeluV2, FastGeluV2TestSuite, diff --git a/tests/activation/gelu/test_operator_gelu.cpp b/tests/activation/gelu/test_operator_gelu.cpp index 030b030c..387727a0 100644 --- a/tests/activation/gelu/test_operator_gelu.cpp +++ b/tests/activation/gelu/test_operator_gelu.cpp @@ -98,8 +98,12 @@ protected: { std::cout << "GeluTestSuite TearDownTestCase" << std::endl; } - virtual void SetUp() {} - virtual void TearDown() {} + virtual void SetUp() { + AscendC::SetGCoreType(2); + } + virtual void TearDown() { + AscendC::SetGCoreType(0); + } }; INSTANTIATE_TEST_CASE_P(TEST_PACKAGE_Gelu, GeluTestSuite, diff --git a/tests/activation/sigmoid/test_operator_vec_sigmoid.cpp b/tests/activation/sigmoid/test_operator_vec_sigmoid.cpp index 8b101205..4d387301 100644 --- a/tests/activation/sigmoid/test_operator_vec_sigmoid.cpp +++ b/tests/activation/sigmoid/test_operator_vec_sigmoid.cpp @@ -57,8 +57,12 @@ struct SigmoidTestParams { class SigmoidTestsuite : public testing::Test, public testing::WithParamInterface { protected: - void SetUp() {} - void TearDown() {} + void SetUp() { + AscendC::SetGCoreType(2); + } + void TearDown() { + AscendC::SetGCoreType(0); + } }; INSTANTIATE_TEST_CASE_P(TEST_SIGMOID, SigmoidTestsuite, diff --git a/tests/activation/silu/test_operator_silu.cpp b/tests/activation/silu/test_operator_silu.cpp index 47c4b398..a001b04e 100644 --- a/tests/activation/silu/test_operator_silu.cpp +++ b/tests/activation/silu/test_operator_silu.cpp @@ -98,8 +98,12 @@ protected: { std::cout << "SiluTestSuite TearDownTestCase" << std::endl; } - virtual void SetUp() {} - virtual void TearDown() {} + virtual void SetUp() { + AscendC::SetGCoreType(2); + } + virtual void TearDown() { + AscendC::SetGCoreType(0); + } }; INSTANTIATE_TEST_CASE_P(TEST_PACKAGE_Silu, SiluTestSuite, diff --git a/tests/activation/swish/test_operator_swish.cpp b/tests/activation/swish/test_operator_swish.cpp index 6eafac45..9e9103f3 100644 --- a/tests/activation/swish/test_operator_swish.cpp +++ b/tests/activation/swish/test_operator_swish.cpp @@ -104,9 +104,13 @@ protected: std::cout << "SwishTestSuite TearDownTestCase" << std::endl; } virtual void SetUp() - {} + { + AscendC::SetGCoreType(2); + } virtual void TearDown() - {} + { + AscendC::SetGCoreType(0); + } }; INSTANTIATE_TEST_CASE_P(TEST_PACKAGE_Swish, SwishTestSuite, diff --git a/tests/transpose/confusion_transpose/test_operator_confusion_transpose.cpp b/tests/transpose/confusion_transpose/test_operator_confusion_transpose.cpp index 30b20218..c0624cc1 100644 --- a/tests/transpose/confusion_transpose/test_operator_confusion_transpose.cpp +++ b/tests/transpose/confusion_transpose/test_operator_confusion_transpose.cpp @@ -311,7 +311,7 @@ class ConfusionTransposeFirstTestsuite : public testing::Test, protected: void SetUp() { - AscendC::SetGCoreType(1); + AscendC::SetGCoreType(2); } void TearDown() { @@ -430,7 +430,7 @@ class ConfusionTransposeSecondTestsuite : public testing::Test, protected: void SetUp() { - AscendC::SetGCoreType(1); + AscendC::SetGCoreType(2); } void TearDown() { @@ -575,7 +575,7 @@ class ConfusionTransposeThirdTestsuite : public testing::Test, protected: void SetUp() { - AscendC::SetGCoreType(1); + AscendC::SetGCoreType(2); } void TearDown() { @@ -721,7 +721,7 @@ class ConfusionTransposeFourthTestsuite : public testing::Test, protected: void SetUp() { - AscendC::SetGCoreType(1); + AscendC::SetGCoreType(2); } void TearDown() { @@ -867,7 +867,7 @@ class ConfusionTransposeFifthTestsuite : public testing::Test, protected: void SetUp() { - AscendC::SetGCoreType(1); + AscendC::SetGCoreType(2); } void TearDown() { @@ -1013,7 +1013,7 @@ class ConfusionTransposeSixthTestsuite : public testing::Test, protected: void SetUp() { - AscendC::SetGCoreType(1); + AscendC::SetGCoreType(2); } void TearDown() { @@ -1138,7 +1138,7 @@ class ConfusionTransposeSeventhTestsuite : public testing::Test, protected: void SetUp() { - AscendC::SetGCoreType(1); + AscendC::SetGCoreType(2); } void TearDown() { -- Gitee