1/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "tensorflow/core/kernels/matmul_op_impl.h"
17
18#if GOOGLE_CUDA
19#include "third_party/gpus/cuda/include/cuda.h"
20#endif // GOOGLE_CUDA
21
22namespace tensorflow {
23
24TF_CALL_FLOAT_TYPES(REGISTER_BATCH_MATMUL_CPU);
25TF_CALL_int16(REGISTER_BATCH_MATMUL_CPU);
26TF_CALL_int32(REGISTER_BATCH_MATMUL_CPU);
27TF_CALL_int64(REGISTER_BATCH_MATMUL_CPU);
28
29REGISTER_BATCH_MATMUL_TOUT_CPU(bfloat16, bfloat16, bfloat16);
30REGISTER_BATCH_MATMUL_TOUT_CPU(float, float, float);
31REGISTER_BATCH_MATMUL_TOUT_CPU(double, double, double);
32REGISTER_BATCH_MATMUL_TOUT_CPU(int16, int16, int16);
33REGISTER_BATCH_MATMUL_TOUT_CPU(int32, int32, int32);
34REGISTER_BATCH_MATMUL_TOUT_CPU(int64_t, int64_t, int64_t);
35REGISTER_BATCH_MATMUL_TOUT_CPU(int8, int8, int32);
36REGISTER_BATCH_MATMUL_TOUT_CPU(uint8, int8, int32);
37REGISTER_BATCH_MATMUL_TOUT_CPU(int8, uint8, int32);
38REGISTER_BATCH_MATMUL_TOUT_CPU(uint8, uint8, int32);
39
40REGISTER_BATCH_MATMUL_TOUT_CPU(bfloat16, int8, bfloat16);
41REGISTER_BATCH_MATMUL_TOUT_CPU(bfloat16, uint8, bfloat16);
42REGISTER_BATCH_MATMUL_TOUT_CPU(int8, bfloat16, bfloat16);
43REGISTER_BATCH_MATMUL_TOUT_CPU(uint8, bfloat16, bfloat16);
44
45#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
46TF_CALL_GPU_NUMBER_TYPES(REGISTER_BATCH_MATMUL_GPU);
47REGISTER_BATCH_MATMUL_TOUT_GPU(Eigen::half, Eigen::half, Eigen::half);
48REGISTER_BATCH_MATMUL_TOUT_GPU(float, float, float);
49REGISTER_BATCH_MATMUL_TOUT_GPU(double, double, double);
50#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
51
52} // namespace tensorflow
53