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_LLVM_IR_RUNTIME_H_
     17 #define TENSORFLOW_COMPILER_XLA_SERVICE_CPU_LLVM_IR_RUNTIME_H_
     18 
     19 #include "llvm/IR/Module.h"
     20 #include "tensorflow/compiler/xla/service/llvm_ir/llvm_util.h"
     21 
     22 namespace xla {
     23 namespace cpu {
     24 namespace runtime {
     25 
     26 extern const char* const kTanhV4F32SymbolName;
     27 extern const char* const kTanhV8F32SymbolName;
     28 extern const char* const kExpV4F32SymbolName;
     29 extern const char* const kExpV8F32SymbolName;
     30 extern const char* const kLogV4F32SymbolName;
     31 extern const char* const kLogV8F32SymbolName;
     32 
     33 // The following CPU runtime functions have LLVM-IR only implementations:
     34 //
     35 //  - __xla_cpu_runtime_TanhV4F32
     36 //  - __xla_cpu_runtime_TanhV8F32
     37 //
     38 // |LinkIRRuntimeFunctions| rewrites calls to these functions into generic LLVM
     39 // IR.
     40 
     41 void RewriteIRRuntimeFunctions(llvm::Module* module, bool enable_fast_math);
     42 
     43 }  // namespace runtime
     44 }  // namespace cpu
     45 }  // namespace xla
     46 
     47 #endif  // TENSORFLOW_COMPILER_XLA_SERVICE_CPU_LLVM_IR_RUNTIME_H_
     48