tensorflow/lite/experimental/ruy/pack_sse42.cc
// TODO(b/147376783): SSE 4.2 and AVX-VNNI support is incomplete / placeholder.
// Optimization is not finished. In particular the dimensions of the kernel
// blocks can be changed as desired.
//
// When removing this comment, update profiling label below.


When removing this comment, update profiling label below.
When removing this comment update profiling label below .
void PackFloatSse42(const float* src_ptr, const float* zerobuf, int src_stride,
                    int remaining_src_cols, int src_rows, float* packed_ptr) {
  profiler::ScopeLabel label("Pack kSse42 float (UNFINISHED)");
  static constexpr int kPackCols = 8;  
  static constexpr int kPackRows = 8;  
  float trailing_buf[(kPackRows - 1) * kPackCols];
  if (remaining_src_cols < 8) {
    memset(trailing_buf, 0, sizeof(trailing_buf));
  }
  PackFloatSse42Packer(src_ptr, zerobuf, src_stride, remaining_src_cols,
                       src_rows, packed_ptr, trailing_buf);
  const int trailing_rows = src_rows & (kPackRows - 1);
  if (trailing_rows > 0) {
    const int non_trailing_rows = src_rows & ~(kPackRows - 1);
    memcpy(packed_ptr + kPackCols * non_trailing_rows, trailing_buf,
           kPackCols * trailing_rows * sizeof(float));
  }
}
void PackFloatSse42 ( const float * src_ptr , const float * zerobuf , int src_stride , int remaining_src_cols , int src_rows , float * packed_ptr ) { profiler :: ScopeLabel label ( " " ) ; static constexpr int kPackCols = 8 ; static constexpr int kPackRows = 8 ; float trailing_buf [ ( kPackRows - 1 ) * kPackCols ] ; if ( remaining_src_cols < 8 ) { memset ( trailing_buf , 0 , sizeof ( trailing_buf ) ) ; } PackFloatSse42Packer ( src_ptr , zerobuf , src_stride , remaining_src_cols , src_rows , packed_ptr , trailing_buf ) ; const int trailing_rows = src_rows & ( kPackRows - 1 ) ; if ( trailing_rows > 0 ) { const int non_trailing_rows = src_rows & ~ ( kPackRows - 1 ) ; memcpy ( packed_ptr + kPackCols * non_trailing_rows , trailing_buf , kPackCols * trailing_rows * sizeof ( float ) ) ; } }
TODO(b/147376783): SSE 4.2 and AVX-VNNI support is incomplete / placeholder.
TODO ( b / 147376783 ) : SSE 4 . 2 and AVX - VNNI support is incomplete / placeholder .
// Source cols packed together. // Short input is padded.