Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#include "test_conv2d_nchwc.h"
#include "test_conv2d_fixture.h"
 
static size_t Conv2dNchwcRegistLongExecute() {
  size_t count = 0;
 
  if (MlasNchwcGetBlockSize() > 1) {
    count += MlasLongExecuteTests<MlasNchwcConv2DTest<false>>::RegisterLongExecute();
    if (GetMlasThreadPool() != nullptr) {
      count += MlasLongExecuteTests<MlasNchwcConv2DTest<true>>::RegisterLongExecute();
    }
#if defined(__aarch64__) && defined(__linux__)
    if (MlasBf16AccelerationSupported()) {
      count += MlasLongExecuteTests<MlasNchwcConv2DBf16Test<false>>::RegisterLongExecute();
      if (GetMlasThreadPool() != nullptr) {
        count += MlasLongExecuteTests<MlasNchwcConv2DBf16Test<true>>::RegisterLongExecute();
      }
    }
#endif
  }
 
  return count;
}
 
static size_t Conv2dNchwcRegistShortExecute() {
  size_t count = 0;
 
  if (MlasNchwcGetBlockSize() > 1) {
    count += Conv2dShortExecuteTest<MlasNchwcConv2DTest<false>>::RegisterShortExecuteTests(false);
    if (GetMlasThreadPool() != nullptr) {
      count += Conv2dShortExecuteTest<MlasNchwcConv2DTest<true>>::RegisterShortExecuteTests(false);
    }
#if defined(__aarch64__) && defined(__linux__)
    if (MlasBf16AccelerationSupported()) {
      count += Conv2dShortExecuteTest<MlasNchwcConv2DBf16Test<false>>::RegisterShortExecuteTests(false);
      if (GetMlasThreadPool() != nullptr) {
        count += Conv2dShortExecuteTest<MlasNchwcConv2DBf16Test<true>>::RegisterShortExecuteTests(false);
      }
    }
#endif
  }
 
  return count;
}
 
static UNUSED_VARIABLE bool added_to_main = AddTestRegister([](bool is_short_execute) {
  return is_short_execute ? Conv2dNchwcRegistShortExecute() : Conv2dNchwcRegistLongExecute();
});