/* * Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. */ #ifndef ASCENDC_KERNEL_PROF_TRACE_IMPL_H #define ASCENDC_KERNEL_PROF_TRACE_IMPL_H #include "kernel_utils.h" namespace AscendC { #ifdef ASCENDC_TRACE_ON constexpr uint32_t PROF_START_EVENT = 0x80000000; constexpr uint32_t PROF_STOP_EVENT = 0xc0000000; __aicore__ __inline__ void ProfMarkEvent(void) { if (g_coreType == AIV) { __asm__ volatile("NOP_BAR.V"); } else if (g_coreType == AIC) { __asm__ volatile("NOP_BAR.M"); __asm__ volatile("NOP_BAR.MTE1"); } else { __asm__ volatile("NOP_BAR.V"); __asm__ volatile("NOP_BAR.M"); __asm__ volatile("NOP_BAR.MTE1"); } __asm__ volatile("NOP_BAR.MTE2"); __asm__ volatile("NOP_BAR.MTE3"); } #endif } // namespace AscendC #endif // ASCENDC_KERNEL_PROF_TRACE_IMPL_H