@@ -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" ,
@@ -190,6 +194,7 @@ cc_library(
190194 srcs = ["elemental_ir_emitter.cc" ],
191195 hdrs = ["elemental_ir_emitter.h" ],
192196 deps = [
197+ ":ir_emission_utils" ,
193198 "//tensorflow/compiler/xla:literal_util" ,
194199 "//tensorflow/compiler/xla:shape_util" ,
195200 "//tensorflow/compiler/xla:status_macros" ,
@@ -246,7 +251,8 @@ cc_library(
246251 "thunk_schedule.cc" ,
247252 "tuple_thunk.cc" ,
248253 "while_thunk.cc" ,
249- ],
254+ ] + if_cuda_is_configured (if_cuda (["nvptx_executable.cc" ])) +
255+ if_rocm_is_configured (if_rocm (["amdgpu_executable.cc" ])),
250256 hdrs = [
251257 "conditional_thunk.h" ,
252258 "convolution_thunk.h" ,
@@ -264,7 +270,8 @@ cc_library(
264270 "thunk_schedule.h" ,
265271 "tuple_thunk.h" ,
266272 "while_thunk.h" ,
267- ],
273+ ] + if_cuda_is_configured (if_cuda (["nvptx_executable.h" ])) +
274+ if_rocm_is_configured (if_rocm (["amdgpu_executable.h" ])),
268275 deps = [
269276 ":buffer_allocations" ,
270277 ":cudnn_convolution_runner" ,
@@ -296,6 +303,7 @@ cc_library(
296303 "//tensorflow/core/platform/default/build_config:cudnn_plugin" ,
297304 "//tensorflow/core/platform/default/build_config:cufft_plugin" ,
298305 "//tensorflow/core/platform/default/build_config:stream_executor_cuda" , # build_cleaner: keep
306+ "//tensorflow/core/platform/default/build_config:stream_executor_rocm" ,
299307 "//tensorflow/stream_executor" ,
300308 ],
301309)
@@ -490,8 +498,10 @@ cc_library(
490498
491499cc_library (
492500 name = "gpu_compiler" ,
493- srcs = ["gpu_compiler.cc" ],
494- hdrs = ["gpu_compiler.h" ],
501+ srcs = if_cuda_is_configured (if_cuda (["nvptx_compiler.cc" ])) +
502+ if_rocm_is_configured (if_rocm (["amdgpu_compiler.cc" ])),
503+ hdrs = if_cuda_is_configured (if_cuda (["nvptx_compiler.h" ])) +
504+ if_rocm_is_configured (if_rocm (["amdgpu_compiler.h" ])),
495505 deps = [
496506 ":cudnn_convolution_algorithm_picker" ,
497507 ":cudnn_convolution_rewriter" ,
@@ -545,6 +555,7 @@ cc_library(
545555 "//tensorflow/compiler/xla/service/gpu/llvm_gpu_backend" ,
546556 "//tensorflow/compiler/xla/service/llvm_ir:llvm_util" ,
547557 "//tensorflow/core:cuda_libdevice_path" ,
558+ "//tensorflow/core:rocm_rocdl_path" ,
548559 "//tensorflow/core:lib" ,
549560 "//tensorflow/core:lib_internal" ,
550561 "//tensorflow/core:regexp_internal" ,
0 commit comments