HMLP: High-performance Machine Learning Primitives
knn_d6x32.hpp
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <hmlp_internal.hpp>
4 
6 BLIS_GEMM_KERNEL(bli_sgemm_opt_12x32_l2,float);
7 BLIS_GEMM_KERNEL(bli_dgemm_opt_6x32_l2,double);
8 
10 {
11  const size_t mr = 12;
12  const size_t nr = 32;
13  const size_t pack_mr = 12;
14  const size_t pack_nr = 32;
15  const size_t align_size = 64;
16  const bool row_major = true;
17 
18  inline void operator()
19  (
20  int k,
21  int r,
22  float *a, float *aa,
23  float *b, float *bb, int *bmap,
24  float *c,
25  float *Keys, int *Values, int ldr,
27  ) const
28  {
29  float ctmp[ mr * nr ];
30  float alpha = 1.0;
32  float beta = aux->pc ? 1.0 : 0.0;
34  if ( !pc ) c = ctmp;
35 
37  bli_sgemm_opt_12x32_l2
38  (
39  k,
40  &alpha,
41  a,
42  b,
43  &beta,
44  c, rs_c, cs_c,
45  aux
46  );
47 
48  for ( size_t i = 0; i < aux->ib; i ++ )
49  {
50  for ( size_t j = 0; j < aux->jb; j ++ )
51  {
52  c[ i * nr + j ] = aa[ i ] - 2.0 * c[ i * nr + j ] + bb[ j ];
53  c[ i * nr + j ] = std::max( c[ i * nr + j ], 0 );
54  }
55  hmlp::heap_select<float>
56  (
57  aux->jb, r,
58  c + i * nr, bmap,
59  Keys + i * ldr,
60  Values + i * ldr
61  );
62  }
63 
64  };
65 
66 };
69 {
70  const size_t mr = 8;
71  const size_t nr = 4;
72  const size_t pack_mr = 8;
73  const size_t pack_nr = 4;
74  const size_t align_size = 32;
75  const bool row_major = true;
76 
77  inline void operator()
78  (
79  int k,
80  int r,
81  double *a, double *aa,
82  double *b, double *bb, int *bmap,
83  double *c,
84  double *Keys, int *Values, int ldr,
86  ) const
87  {
88  };
89 };
Definition: knn_d6x32.hpp:68
Definition: knn_d6x32.hpp:9
Definition: hmlp_internal.hpp:38