1 /* Copyright 2021 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_GPU_BEF_THUNK_H_ 17 #define TENSORFLOW_COMPILER_XLA_SERVICE_GPU_BEF_THUNK_H_ 18 19 #include "mlir/IR/Operation.h" 20 #include "tensorflow/compiler/xla/service/gpu/buffer_allocations.h" 21 #include "tensorflow/compiler/xla/service/gpu/thunk.h" 22 #include "tensorflow/core/platform/statusor.h" 23 24 namespace tfrt { 25 class ExecutionContext; 26 } 27 28 namespace xla { 29 namespace gpu { 30 31 // Return whether --//...:enable_bef_thunk was specified on the command line. 32 bool IsBefThunkEnabled(); 33 34 // Creates a Thunk that uses TFRT BEF execution to perform the work of various 35 // Thunk types. A BefThunk is not restricted to a particular op function, unlike 36 // GemmThunk, ConvolutionThunk, etc. Rather, a BefThunk is to stand in place of 37 // an other Thunk type. 38 StatusOr<std::unique_ptr<Thunk>> CreateBefThunk( 39 Thunk::ThunkInfo thunk_info, mlir::Operation* op, 40 std::vector<BufferAllocation::Slice> inputs, 41 std::vector<BufferAllocation::Slice> outputs); 42 43 } // namespace gpu 44 } // namespace xla 45 46 #endif // TENSORFLOW_COMPILER_XLA_SERVICE_GPU_BEF_THUNK_H_ 47