Browse Source

fix(tee): fix tee crash

GitOrigin-RevId: 379f970c87
release-1.5
Megvii Engine Team huangxinda 4 years ago
parent
commit
20ab82d00c
3 changed files with 16 additions and 0 deletions
  1. +6
    -0
      dnn/src/aarch64/matrix_mul/algos.cpp
  2. +6
    -0
      dnn/src/aarch64/matrix_mul/fp32/strategy.cpp
  3. +4
    -0
      dnn/src/arm_common/conv_bias/fp32/direct_kernels/f32_direct_nchw_nchw44_kern_common.h

+ 6
- 0
dnn/src/aarch64/matrix_mul/algos.cpp View File

@@ -908,6 +908,9 @@ bool MatrixMulImpl::AlgoInt8x8x16MK4_16x12x4::preferred(
return false;
#else
auto arch = cpuinfo_get_current_core()->uarch;
#ifdef __IN_TEE_ENV__
arch = cpuinfo_uarch_unknown;
#endif
bool little_core = arch == cpuinfo_uarch_cortex_a53 ||
arch == cpuinfo_uarch_cortex_a55;
return little_core;
@@ -986,6 +989,9 @@ bool MatrixMulImpl::AlgoInt8x8x16MK4_4x4x8::preferred(
return false;
#else
auto arch = cpuinfo_get_current_core()->uarch;
#ifdef __IN_TEE_ENV__
arch = cpuinfo_uarch_unknown;
#endif
bool little_core = arch == cpuinfo_uarch_cortex_a53 ||
arch == cpuinfo_uarch_cortex_a55;
return !little_core;


+ 6
- 0
dnn/src/aarch64/matrix_mul/fp32/strategy.cpp View File

@@ -181,6 +181,9 @@ void sgemm_8x12::kern(const float* packA, const float* packB, size_t M,
is_first_k);
#else
auto arch = cpuinfo_get_current_core()->uarch;
#ifdef __IN_TEE_ENV__
arch = cpuinfo_uarch_unknown;
#endif
if (arch == cpuinfo_uarch_cortex_a53) {
sgemm_8x12_helper<matmul_general_8x12_a53>(packA, packB, M, N, K, C,
LDC, is_first_k);
@@ -274,6 +277,9 @@ void sgemm_mk4_8x12::kern(const float* packA, const float* packB, size_t M,
is_first_k);
#else
auto arch = cpuinfo_get_current_core()->uarch;
#ifdef __IN_TEE_ENV__
arch = cpuinfo_uarch_unknown;
#endif
if (arch == cpuinfo_uarch_cortex_a53) {
sgemm_mk4_8x12_helper<matmul_mk4_8x12_a53>(packA, packB, M, N, K, C,
LDC, is_first_k);


+ 4
- 0
dnn/src/arm_common/conv_bias/fp32/direct_kernels/f32_direct_nchw_nchw44_kern_common.h View File

@@ -851,6 +851,10 @@ struct ConvDirectFp32NchwNchw44<bias_mode, Op, 3, 2> {
#else
auto arch_tag = CpuTag::A7_TAG;
#endif

#ifdef __IN_TEE_ENV__
arch_tag = CpuTag::DEFAULT_CPU_TAG;
#endif
if (arch_tag == CpuTag::A7_TAG) {
for (int oc_idx = 0; oc_idx < oc_end; oc_idx += big_oc_step) {
const int weight_offset = oc_idx * ic * fh * fw;


Loading…
Cancel
Save