Home | History | Annotate | Download | only in cpu
      1 /* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
      2 
      3 Licensed under the Apache License, Version 2.0 (the "License");
      4 you may not use this file except in compliance with the License.
      5 You may obtain a copy of the License at
      6 
      7     http://www.apache.org/licenses/LICENSE-2.0
      8 
      9 Unless required by applicable law or agreed to in writing, software
     10 distributed under the License is distributed on an "AS IS" BASIS,
     11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 See the License for the specific language governing permissions and
     13 limitations under the License.
     14 ==============================================================================*/
     15 
     16 #ifndef TENSORFLOW_COMPILER_XLA_SERVICE_CPU_RUNTIME_MATVEC_H_
     17 #define TENSORFLOW_COMPILER_XLA_SERVICE_CPU_RUNTIME_MATVEC_H_
     18 
     19 #include "tensorflow/core/platform/types.h"
     20 
     21 namespace xla {
     22 
     23 // Performs a matrix-vector multiplication using Eigen. 'lhs' and 'rhs' are
     24 // pointers to buffers containing input matrices in column-major order. 'out' is
     25 // a pointer to a buffer sufficiently large to hold the result of the
     26 // operation. Following standard nomenclature: lhs is m x k, rhs is k x n, and
     27 // out is m x n.
     28 //
     29 // This requires that m = 1 or n = 1.
     30 //
     31 // TODO(b/64684907): Compare runtime performance of these functions with dot
     32 // simplification.
     33 void EigenMatVecF32(float* out, float* lhs, float* rhs, tensorflow::int64 m,
     34                     tensorflow::int64 n, tensorflow::int64 k,
     35                     tensorflow::int32 transpose_lhs,
     36                     tensorflow::int32 transpose_rhs);
     37 
     38 void EigenMatVecF64(double* out, double* lhs, double* rhs, tensorflow::int64 m,
     39                     tensorflow::int64 n, tensorflow::int64 k,
     40                     tensorflow::int32 transpose_lhs,
     41                     tensorflow::int32 transpose_rhs);
     42 
     43 }  // namespace xla
     44 
     45 #endif  // TENSORFLOW_COMPILER_XLA_SERVICE_CPU_RUNTIME_MATVEC_H_
     46