已合并
fix clock ut fail #1039
ruoshuisixue创建于 3月20日
fix clock ut fail #1039
已合并
从已删除 :cherry-pick-mr-913-1773970496066-auto合入到cann/asc-devkit9.0.0
共 3 个文件变更+4-32
| @@ -23,10 +23,12 @@ | |||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | namespace __asc_simt_vf { | 25 | namespace __asc_simt_vf { |
| 26 | + | ||
| 26 | __SIMT_DEVICE_FUNCTIONS_DECL__ inline uint64_t clock(void) | 27 | __SIMT_DEVICE_FUNCTIONS_DECL__ inline uint64_t clock(void) |
| 27 | { | 28 | { |
| 28 | return static_cast<uint64_t>(__cce_simt_get_CLOCK64()); | 29 | return static_cast<uint64_t>(__cce_simt_get_CLOCK64()); |
| 29 | } | 30 | } |
| 31 | + | ||
| 30 | } // namespace __asc_simt_vf | 32 | } // namespace __asc_simt_vf |
| 31 | 33 | ||
| 32 | 34 | ||
| @@ -332,11 +332,11 @@ __SIMT_DEVICE_FUNCTIONS_DECL__ inline half asc_ldca(__gm__ half* address); | |||
| 332 | 332 | ||
| 333 | __SIMT_DEVICE_FUNCTIONS_DECL__ inline half2 asc_ldca(__gm__ half2* address); | 333 | __SIMT_DEVICE_FUNCTIONS_DECL__ inline half2 asc_ldca(__gm__ half2* address); |
| 334 | 334 | ||
| 335 | -__SIMT_DEVICE_FUNCTIONS_DECL__ inline void asc_stcg(__gm__ half* address, half2 val); | 335 | +__SIMT_DEVICE_FUNCTIONS_DECL__ inline void asc_stcg(__gm__ half* address, half val); |
| 336 | 336 | ||
| 337 | __SIMT_DEVICE_FUNCTIONS_DECL__ inline void asc_stcg(__gm__ half2* address, half2 val); | 337 | __SIMT_DEVICE_FUNCTIONS_DECL__ inline void asc_stcg(__gm__ half2* address, half2 val); |
| 338 | 338 | ||
| 339 | -__SIMT_DEVICE_FUNCTIONS_DECL__ inline void asc_stwt(__gm__ half* address, half2 val); | 339 | +__SIMT_DEVICE_FUNCTIONS_DECL__ inline void asc_stwt(__gm__ half* address, half val); |
| 340 | 340 | ||
| 341 | __SIMT_DEVICE_FUNCTIONS_DECL__ inline void asc_stwt(__gm__ half2* address, half2 val); | 341 | __SIMT_DEVICE_FUNCTIONS_DECL__ inline void asc_stwt(__gm__ half2* address, half2 val); |
| 342 | 342 | ||
| @@ -1,30 +0,0 @@ | |||
| 1 | -/** | ||
| 2 | -* Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 3 | -* This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 4 | -* CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 5 | -* Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 6 | -* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 7 | -* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 8 | -* See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | -*/ | ||
| 10 | - | ||
| 11 | - | ||
| 12 | - | ||
| 13 | - | ||
| 14 | - | ||
| 15 | - | ||
| 16 | -uint64_t __cce_simt_get_CLOCK64(); | ||
| 17 | - | ||
| 18 | - | ||
| 19 | -class ClockTestsuite : public testing::Test { | ||
| 20 | -protected: | ||
| 21 | - void SetUp() {} | ||
| 22 | - void TearDown() {} | ||
| 23 | -}; | ||
| 24 | - | ||
| 25 | -TEST_F(ClockTestsuite, ClockTest) | ||
| 26 | -{ | ||
| 27 | - uint64_t t1 = __asc_simt_vf::clock(); | ||
| 28 | - uint64_t t2 = __asc_simt_vf::clock(); | ||
| 29 | - EXPECT_LE(t1, t2); | ||
| 30 | -} | ||