1 | /* Copyright 2016 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 | #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 | |
22 | namespace tensorflow { |
23 | |
24 | TF_CALL_FLOAT_TYPES(REGISTER_BATCH_MATMUL_CPU); |
25 | TF_CALL_int16(REGISTER_BATCH_MATMUL_CPU); |
26 | TF_CALL_int32(REGISTER_BATCH_MATMUL_CPU); |
27 | TF_CALL_int64(REGISTER_BATCH_MATMUL_CPU); |
28 | |
29 | REGISTER_BATCH_MATMUL_TOUT_CPU(bfloat16, bfloat16, bfloat16); |
30 | REGISTER_BATCH_MATMUL_TOUT_CPU(float, float, float); |
31 | REGISTER_BATCH_MATMUL_TOUT_CPU(double, double, double); |
32 | REGISTER_BATCH_MATMUL_TOUT_CPU(int16, int16, int16); |
33 | REGISTER_BATCH_MATMUL_TOUT_CPU(int32, int32, int32); |
34 | REGISTER_BATCH_MATMUL_TOUT_CPU(int64_t, int64_t, int64_t); |
35 | REGISTER_BATCH_MATMUL_TOUT_CPU(int8, int8, int32); |
36 | REGISTER_BATCH_MATMUL_TOUT_CPU(uint8, int8, int32); |
37 | REGISTER_BATCH_MATMUL_TOUT_CPU(int8, uint8, int32); |
38 | REGISTER_BATCH_MATMUL_TOUT_CPU(uint8, uint8, int32); |
39 | |
40 | REGISTER_BATCH_MATMUL_TOUT_CPU(bfloat16, int8, bfloat16); |
41 | REGISTER_BATCH_MATMUL_TOUT_CPU(bfloat16, uint8, bfloat16); |
42 | REGISTER_BATCH_MATMUL_TOUT_CPU(int8, bfloat16, bfloat16); |
43 | REGISTER_BATCH_MATMUL_TOUT_CPU(uint8, bfloat16, bfloat16); |
44 | |
45 | #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM |
46 | TF_CALL_GPU_NUMBER_TYPES(REGISTER_BATCH_MATMUL_GPU); |
47 | REGISTER_BATCH_MATMUL_TOUT_GPU(Eigen::half, Eigen::half, Eigen::half); |
48 | REGISTER_BATCH_MATMUL_TOUT_GPU(float, float, float); |
49 | REGISTER_BATCH_MATMUL_TOUT_GPU(double, double, double); |
50 | #endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM |
51 | |
52 | } // namespace tensorflow |
53 | |