@@ -22,6 +22,10 @@ filegroup(
2222)
2323
2424load ("//tensorflow:tensorflow.bzl" , "tf_cc_test" )
25+ load ("@local_config_cuda//cuda:build_defs.bzl" , "if_cuda" )
26+ load ("@local_config_cuda//cuda:build_defs.bzl" , "if_cuda_is_configured" )
27+ load ("@local_config_rocm//rocm:build_defs.bzl" , "if_rocm" )
28+ load ("@local_config_rocm//rocm:build_defs.bzl" , "if_rocm_is_configured" )
2529
2630cc_library (
2731 name = "gpu_constants" ,
@@ -296,6 +300,7 @@ cc_library(
296300 "//tensorflow/core/platform/default/build_config:cudnn_plugin" ,
297301 "//tensorflow/core/platform/default/build_config:cufft_plugin" ,
298302 "//tensorflow/core/platform/default/build_config:stream_executor_cuda" , # build_cleaner: keep
303+ "//tensorflow/core/platform/default/build_config:stream_executor_rocm" ,
299304 "//tensorflow/stream_executor" ,
300305 ],
301306)
@@ -490,8 +495,10 @@ cc_library(
490495
491496cc_library (
492497 name = "gpu_compiler" ,
493- srcs = ["gpu_compiler.cc" ],
494- hdrs = ["gpu_compiler.h" ],
498+ srcs = if_cuda_is_configured (if_cuda (["nvptx_compiler.cc" ])) +
499+ if_rocm_is_configured (if_rocm (["amdgpu_compiler.cc" ])),
500+ hdrs = if_cuda_is_configured (if_cuda (["nvptx_compiler.h" ])) +
501+ if_rocm_is_configured (if_rocm (["amdgpu_compiler.h" ])),
495502 deps = [
496503 ":cudnn_convolution_algorithm_picker" ,
497504 ":cudnn_convolution_rewriter" ,
@@ -545,6 +552,7 @@ cc_library(
545552 "//tensorflow/compiler/xla/service/gpu/llvm_gpu_backend" ,
546553 "//tensorflow/compiler/xla/service/llvm_ir:llvm_util" ,
547554 "//tensorflow/core:cuda_libdevice_path" ,
555+ "//tensorflow/core:rocm_rocdl_path" ,
548556 "//tensorflow/core:lib" ,
549557 "//tensorflow/core:lib_internal" ,
550558 "//tensorflow/core:regexp_internal" ,
0 commit comments