1 /* Copyright 2018 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/platform/rocm_rocdl_path.h" 17 18 #include <stdlib.h> 19 20 #include "tensorflow/core/platform/path.h" 21 22 #if !defined(PLATFORM_GOOGLE) && TENSORFLOW_USE_ROCM 23 #include "rocm/rocm_config.h" 24 #endif 25 #include "tensorflow/core/platform/logging.h" 26 27 namespace tensorflow { 28 RocmRoot()29string RocmRoot() { 30 #if TENSORFLOW_USE_ROCM 31 VLOG(3) << "ROCM root = " << TF_ROCM_TOOLKIT_PATH; 32 return TF_ROCM_TOOLKIT_PATH; 33 #else 34 return ""; 35 #endif 36 } 37 RocdlRoot()38string RocdlRoot() { 39 #if TF_ROCM_VERSION >= 30900 40 return tensorflow::io::JoinPath(tensorflow::RocmRoot(), "amdgcn/bitcode"); 41 #else 42 return tensorflow::io::JoinPath(tensorflow::RocmRoot(), "lib"); 43 #endif 44 } 45 46 } // namespace tensorflow 47