Home | History | Annotate | Download | only in cpu
      1 # Description:
      2 #    LLVM-based CPU backend for XLA.
      3 
      4 licenses(["notice"])  # Apache 2.0
      5 
      6 package(
      7     default_visibility = [":friends"],
      8 )
      9 
     10 package_group(
     11     name = "friends",
     12     includes = [
     13         "//tensorflow/compiler/xla:friends",
     14     ],
     15 )
     16 
     17 load(":build_defs.bzl", "runtime_copts")
     18 load("//tensorflow:tensorflow.bzl", "tf_cc_test")
     19 load("//tensorflow:tensorflow.bzl", "tf_cc_binary")
     20 load("//tensorflow/compiler/xla:xla.bzl", "ORC_JIT_MEMORY_MAPPER_TARGETS")
     21 
     22 # Filegroup used to collect source files for dependency checking.
     23 filegroup(
     24     name = "c_srcs",
     25     data = glob([
     26         "**/*.cc",
     27         "**/*.h",
     28     ]),
     29 )
     30 
     31 cc_library(
     32     name = "cpu_transfer_manager",
     33     srcs = ["cpu_transfer_manager.cc"],
     34     hdrs = ["cpu_transfer_manager.h"],
     35     deps = [
     36         "//tensorflow/compiler/xla:literal_util",
     37         "//tensorflow/compiler/xla:shape_util",
     38         "//tensorflow/compiler/xla:status_macros",
     39         "//tensorflow/compiler/xla:statusor",
     40         "//tensorflow/compiler/xla:types",
     41         "//tensorflow/compiler/xla:util",
     42         "//tensorflow/compiler/xla:xla_data_proto",
     43         "//tensorflow/compiler/xla/service:generic_transfer_manager",
     44         "//tensorflow/compiler/xla/service:transfer_manager",
     45         "//tensorflow/compiler/xla/service/cpu:cpu_runtime",
     46         "//tensorflow/core:lib",
     47         "//tensorflow/core:stream_executor_no_cuda",
     48     ],
     49     alwayslink = True,  # Contains per-platform transfer manager registration
     50 )
     51 
     52 cc_library(
     53     name = "external_constant_pool",
     54     srcs = ["external_constant_pool.cc"],
     55     hdrs = ["external_constant_pool.h"],
     56     deps = [
     57         "//tensorflow/compiler/xla:literal_util",
     58         "//tensorflow/compiler/xla:shape_util",
     59         "//tensorflow/compiler/xla:util",
     60         "//tensorflow/core:lib",
     61     ],
     62 )
     63 
     64 tf_cc_test(
     65     name = "external_constant_pool_test",
     66     srcs = ["external_constant_pool_test.cc"],
     67     deps = [
     68         ":external_constant_pool",
     69         "//tensorflow/compiler/xla:shape_util",
     70         "//tensorflow/compiler/xla/tests:xla_internal_test_main",
     71         "//tensorflow/core:test",
     72     ],
     73 )
     74 
     75 cc_library(
     76     name = "cpu_compiler",
     77     srcs = ["cpu_compiler.cc"],
     78     hdrs = ["cpu_compiler.h"],
     79     deps = [
     80         ":compiler_functor",
     81         ":conv_canonicalization",
     82         ":cpu_copy_insertion",
     83         ":cpu_executable",
     84         ":cpu_hlo_support_checker",
     85         ":cpu_instruction_fusion",
     86         ":cpu_layout_assignment",
     87         ":cpu_options",
     88         ":cpu_parallelization_preparation",
     89         ":disassembler",
     90         ":dot_op_emitter",
     91         ":ir_emission_utils",
     92         ":ir_emitter",
     93         ":parallel_cpu_executable",
     94         ":parallel_task_assignment",
     95         ":simple_orc_jit",
     96         "//tensorflow/compiler/xla:literal_util",
     97         "//tensorflow/compiler/xla:protobuf_util",
     98         "//tensorflow/compiler/xla:status_macros",
     99         "//tensorflow/compiler/xla:statusor",
    100         "//tensorflow/compiler/xla:types",
    101         "//tensorflow/compiler/xla:util",
    102         "//tensorflow/compiler/xla:xla_data_proto",
    103         "//tensorflow/compiler/xla/service:algebraic_simplifier",
    104         "//tensorflow/compiler/xla/service:batchnorm_expander",
    105         "//tensorflow/compiler/xla/service:buffer_assignment",
    106         "//tensorflow/compiler/xla/service:buffer_liveness",
    107         "//tensorflow/compiler/xla/service:call_inliner",
    108         "//tensorflow/compiler/xla/service:dot_decomposer",
    109         "//tensorflow/compiler/xla/service:executable",
    110         "//tensorflow/compiler/xla/service:flatten_call_graph",
    111         "//tensorflow/compiler/xla/service:hlo",
    112         "//tensorflow/compiler/xla/service:hlo_constant_folding",
    113         "//tensorflow/compiler/xla/service:hlo_cse",
    114         "//tensorflow/compiler/xla/service:hlo_dce",
    115         "//tensorflow/compiler/xla/service:hlo_element_type_converter",
    116         "//tensorflow/compiler/xla/service:hlo_ordering",
    117         "//tensorflow/compiler/xla/service:hlo_pass",
    118         "//tensorflow/compiler/xla/service:hlo_pass_pipeline",
    119         "//tensorflow/compiler/xla/service:hlo_proto",
    120         "//tensorflow/compiler/xla/service:hlo_proto_util",
    121         "//tensorflow/compiler/xla/service:hlo_scheduling",
    122         "//tensorflow/compiler/xla/service:hlo_subcomputation_unification",
    123         "//tensorflow/compiler/xla/service:hlo_verifier",
    124         "//tensorflow/compiler/xla/service:inliner",
    125         "//tensorflow/compiler/xla/service:llvm_compiler",
    126         "//tensorflow/compiler/xla/service:reduce_precision_insertion",
    127         "//tensorflow/compiler/xla/service:reshape_mover",
    128         "//tensorflow/compiler/xla/service:transpose_folding",
    129         "//tensorflow/compiler/xla/service:tuple_simplifier",
    130         "//tensorflow/compiler/xla/service:while_loop_invariant_code_motion",
    131         "//tensorflow/compiler/xla/service:while_loop_simplifier",
    132         "//tensorflow/compiler/xla/service:zero_sized_hlo_elimination",
    133         "//tensorflow/compiler/xla/service/llvm_ir:llvm_util",  # fixdeps: keep
    134         "//tensorflow/core:lib",  # fixdeps: keep
    135         "//tensorflow/core:stream_executor_no_cuda",
    136         "@llvm//:aarch64_code_gen",  # fixdeps: keep
    137         "@llvm//:aarch64_disassembler",  # fixdeps: keep
    138         "@llvm//:arm_code_gen",  # fixdeps: keep
    139         "@llvm//:arm_disassembler",  # fixdeps: keep
    140         "@llvm//:core",
    141         "@llvm//:mc",  # fixdeps: keep
    142         "@llvm//:object",
    143         "@llvm//:support",
    144         "@llvm//:target",  # fixdeps: keep
    145         "@llvm//:x86_code_gen",  # fixdeps: keep
    146         "@llvm//:x86_disassembler",  # fixdeps: keep
    147     ],
    148     alwayslink = True,  # Contains compiler registration
    149 )
    150 
    151 cc_library(
    152     name = "simple_orc_jit",
    153     srcs = [
    154         "simple_orc_jit.cc",
    155         "windows_compatibility.cc",
    156         "windows_compatibility.h",
    157     ],
    158     hdrs = ["simple_orc_jit.h"],
    159     deps = [
    160         ":compiler_functor",
    161         ":cpu_runtime",
    162         ":custom_call_target_registry",
    163         ":disassembler",
    164         ":external_constant_pool",
    165         ":orc_jit_memory_mapper",
    166         ":runtime_conv2d",
    167         ":runtime_fft",
    168         ":runtime_fork_join",
    169         ":runtime_matmul",
    170         ":runtime_single_threaded_conv2d",
    171         ":runtime_single_threaded_matmul",
    172         "@llvm//:execution_engine",
    173         "@llvm//:core",
    174         "@llvm//:mc",  # fixdeps: keep
    175         "@llvm//:orc_jit",
    176         "@llvm//:support",
    177         "@llvm//:target",  # fixdeps: keep
    178         "//tensorflow/compiler/xla:types",
    179         "//tensorflow/compiler/xla:util",
    180         "//tensorflow/core:lib",
    181         "//tensorflow/core:lib_internal",
    182     ] + ORC_JIT_MEMORY_MAPPER_TARGETS,
    183 )
    184 
    185 cc_library(
    186     name = "cpu_executable",
    187     srcs = ["cpu_executable.cc"],
    188     hdrs = ["cpu_executable.h"],
    189     deps = [
    190         ":simple_orc_jit",
    191         "//tensorflow/compiler/xla:shape_tree",
    192         "//tensorflow/compiler/xla:shape_util",
    193         "//tensorflow/compiler/xla:status_macros",
    194         "//tensorflow/compiler/xla:statusor",
    195         "//tensorflow/compiler/xla:types",
    196         "//tensorflow/compiler/xla:util",
    197         "//tensorflow/compiler/xla:xla_data_proto",
    198         "//tensorflow/compiler/xla/service:buffer_assignment",
    199         "//tensorflow/compiler/xla/service:computation_layout",
    200         "//tensorflow/compiler/xla/service:device_memory_allocator",
    201         "//tensorflow/compiler/xla/service:executable",
    202         "//tensorflow/compiler/xla/service:hlo",
    203         "//tensorflow/compiler/xla/service:hlo_execution_profile",
    204         "//tensorflow/compiler/xla/service:logical_buffer",
    205         "//tensorflow/compiler/xla/service:shaped_buffer",
    206         "//tensorflow/compiler/xla/service:tuple_points_to_analysis",
    207         "//tensorflow/core:lib",
    208         "//tensorflow/core:stream_executor_no_cuda",
    209         "@llvm//:orc_jit",
    210     ],
    211 )
    212 
    213 cc_library(
    214     name = "parallel_cpu_executable",
    215     srcs = ["parallel_cpu_executable.cc"],
    216     hdrs = [
    217         "parallel_cpu_executable.h",
    218     ],
    219     deps = [
    220         ":cpu_runtime",
    221         ":shape_partition",
    222         ":simple_orc_jit",
    223         "//tensorflow/compiler/xla:shape_util",
    224         "//tensorflow/compiler/xla:status_macros",
    225         "//tensorflow/compiler/xla:statusor",
    226         "//tensorflow/compiler/xla:types",
    227         "//tensorflow/compiler/xla:util",
    228         "//tensorflow/compiler/xla:xla_data_proto",
    229         "//tensorflow/compiler/xla/service:buffer_assignment",
    230         "//tensorflow/compiler/xla/service:device_memory_allocator",
    231         "//tensorflow/compiler/xla/service:executable",
    232         "//tensorflow/compiler/xla/service:hlo",
    233         "//tensorflow/compiler/xla/service:hlo_execution_profile",
    234         "//tensorflow/compiler/xla/service:logical_buffer",
    235         "//tensorflow/compiler/xla/service:shaped_buffer",
    236         "//tensorflow/core:lib",
    237         "//tensorflow/core:stream_executor_no_cuda",
    238         "@llvm//:orc_jit",
    239     ],
    240 )
    241 
    242 cc_library(
    243     name = "ir_emitter",
    244     srcs = [
    245         "elemental_ir_emitter.cc",
    246         "ir_emitter.cc",
    247     ],
    248     hdrs = [
    249         "elemental_ir_emitter.h",
    250         "ir_emitter.h",
    251     ],
    252     deps = [
    253         ":cpu_options",
    254         ":cpu_runtime",
    255         ":dot_op_emitter",
    256         ":external_constant_pool",
    257         ":ir_emission_utils",
    258         ":ir_function",
    259         ":parallel_loop_emitter",
    260         ":shape_partition",
    261         ":simple_orc_jit",
    262         ":target_machine_features",
    263         "//tensorflow/compiler/xla:shape_util",
    264         "//tensorflow/compiler/xla:status_macros",
    265         "//tensorflow/compiler/xla:statusor",
    266         "//tensorflow/compiler/xla:types",
    267         "//tensorflow/compiler/xla:util",
    268         "//tensorflow/compiler/xla:window_util",
    269         "//tensorflow/compiler/xla:xla_data_proto",
    270         "//tensorflow/compiler/xla/service:buffer_assignment",
    271         "//tensorflow/compiler/xla/service:elemental_ir_emitter",
    272         "//tensorflow/compiler/xla/service:hlo",
    273         "//tensorflow/compiler/xla/service:hlo_module_config",
    274         "//tensorflow/compiler/xla/service:name_uniquer",
    275         "//tensorflow/compiler/xla/service/llvm_ir:alias_analysis",
    276         "//tensorflow/compiler/xla/service/llvm_ir:fused_ir_emitter",
    277         "//tensorflow/compiler/xla/service/llvm_ir:ir_array",
    278         "//tensorflow/compiler/xla/service/llvm_ir:llvm_loop",
    279         "//tensorflow/compiler/xla/service/llvm_ir:llvm_util",
    280         "//tensorflow/compiler/xla/service/llvm_ir:loop_emitter",
    281         "//tensorflow/compiler/xla/service/llvm_ir:ops",
    282         "//tensorflow/compiler/xla/service/llvm_ir:tuple_ops",
    283         "//tensorflow/core:lib",
    284         "@llvm//:code_gen",
    285         "@llvm//:core",
    286         "@llvm//:support",
    287         "@llvm//:target",
    288     ],
    289 )
    290 
    291 cc_library(
    292     name = "target_machine_features",
    293     srcs = [
    294         "target_machine_features.cc",
    295     ],
    296     hdrs = ["target_machine_features.h"],
    297     deps = [
    298         "//tensorflow/compiler/xla:shape_util",
    299         "//tensorflow/core:lib",
    300         "@llvm//:analysis",
    301         "@llvm//:target",
    302     ],
    303 )
    304 
    305 cc_library(
    306     name = "ir_function",
    307     srcs = ["ir_function.cc"],
    308     hdrs = ["ir_function.h"],
    309     deps = [
    310         ":ir_emission_utils",
    311         ":shape_partition",
    312         "//tensorflow/compiler/xla:shape_util",
    313         "//tensorflow/compiler/xla:status_macros",
    314         "//tensorflow/compiler/xla:statusor",
    315         "//tensorflow/compiler/xla:types",
    316         "//tensorflow/compiler/xla/service/cpu:cpu_runtime",
    317         "//tensorflow/compiler/xla/service/llvm_ir:llvm_util",
    318         "//tensorflow/core:lib",
    319         "@llvm//:core",
    320     ],
    321 )
    322 
    323 cc_library(
    324     name = "parallel_loop_emitter",
    325     srcs = ["parallel_loop_emitter.cc"],
    326     hdrs = ["parallel_loop_emitter.h"],
    327     deps = [
    328         ":ir_emission_utils",
    329         "//tensorflow/compiler/xla:xla_data_proto",
    330         "//tensorflow/compiler/xla/service/llvm_ir:ir_array",
    331         "//tensorflow/compiler/xla/service/llvm_ir:llvm_loop",
    332         "//tensorflow/compiler/xla/service/llvm_ir:llvm_util",
    333         "//tensorflow/compiler/xla/service/llvm_ir:loop_emitter",
    334         "//tensorflow/core:lib",
    335         "@llvm//:core",
    336     ],
    337 )
    338 
    339 cc_library(
    340     name = "dot_op_emitter",
    341     srcs = ["dot_op_emitter.cc"],
    342     hdrs = ["dot_op_emitter.h"],
    343     deps = [
    344         ":cpu_options",
    345         ":cpu_runtime",
    346         ":target_machine_features",
    347         ":vector_support_library",
    348         "//tensorflow/compiler/xla:shape_util",
    349         "//tensorflow/compiler/xla:status_macros",
    350         "//tensorflow/compiler/xla:types",
    351         "//tensorflow/compiler/xla:util",
    352         "//tensorflow/compiler/xla:xla_data_proto",
    353         "//tensorflow/compiler/xla/service:hlo",
    354         "//tensorflow/compiler/xla/service:hlo_module_config",
    355         "//tensorflow/compiler/xla/service/llvm_ir:ir_array",
    356         "//tensorflow/compiler/xla/service/llvm_ir:kernel_support_library",
    357         "//tensorflow/compiler/xla/service/llvm_ir:llvm_loop",
    358         "//tensorflow/compiler/xla/service/llvm_ir:llvm_util",
    359         "//tensorflow/core:lib",
    360         "@llvm//:core",
    361     ],
    362 )
    363 
    364 tf_cc_binary(
    365     name = "sample_harness",
    366     srcs = ["sample_harness.cc"],
    367     deps = [
    368         "//tensorflow/compiler/xla:array4d",
    369         "//tensorflow/compiler/xla:literal_util",
    370         "//tensorflow/compiler/xla:statusor",
    371         "//tensorflow/compiler/xla:types",
    372         "//tensorflow/compiler/xla:xla_data_proto",
    373         "//tensorflow/compiler/xla/client",
    374         "//tensorflow/compiler/xla/client:client_library",
    375         "//tensorflow/compiler/xla/client:computation",
    376         "//tensorflow/compiler/xla/client:computation_builder",
    377         "//tensorflow/compiler/xla/client:global_data",
    378         "//tensorflow/compiler/xla/client:local_client",
    379         "//tensorflow/core:lib",
    380     ],
    381 )
    382 
    383 cc_library(
    384     name = "disassembler",
    385     srcs = ["disassembler.cc"],
    386     hdrs = ["disassembler.h"],
    387     deps = [
    388         "//tensorflow/compiler/xla:status_macros",
    389         "//tensorflow/compiler/xla:statusor",
    390         "//tensorflow/compiler/xla:types",
    391         "//tensorflow/compiler/xla:util",
    392         "//tensorflow/core:lib",
    393         "@llvm//:mc",
    394         "@llvm//:mc_disassembler",
    395         "@llvm//:object",
    396         "@llvm//:support",
    397         "@llvm//:target",
    398         "@llvm//:x86_disassembler",  # fixdeps: keep
    399     ],
    400 )
    401 
    402 cc_library(
    403     name = "compiler_functor",
    404     srcs = ["compiler_functor.cc"],
    405     hdrs = ["compiler_functor.h"],
    406     deps = [
    407         ":cpu_runtime",
    408         ":disassembler",
    409         ":llvm_ir_runtime",
    410         "//tensorflow/compiler/xla:statusor",
    411         "//tensorflow/compiler/xla:types",
    412         "//tensorflow/compiler/xla:util",
    413         "//tensorflow/compiler/xla/service:llvm_compiler",
    414         "//tensorflow/compiler/xla/service/llvm_ir:llvm_util",
    415         "//tensorflow/core:lib",
    416         "@llvm//:analysis",
    417         "@llvm//:core",
    418         "@llvm//:execution_engine",
    419         "@llvm//:ipo",
    420         "@llvm//:mc",
    421         "@llvm//:object",
    422         "@llvm//:support",
    423         "@llvm//:target",
    424     ],
    425 )
    426 
    427 cc_library(
    428     name = "cpu_runtime",
    429     srcs = [
    430         "cpu_runtime.cc",
    431         "xfeed_manager.cc",
    432     ],
    433     hdrs = [
    434         "cpu_runtime.h",
    435         "xfeed_manager.h",
    436     ],
    437     copts = runtime_copts(),
    438     deps = [
    439         "//tensorflow/compiler/xla:shape_util",
    440         "//tensorflow/compiler/xla:statusor",
    441         "//tensorflow/compiler/xla:types",
    442         "//tensorflow/compiler/xla:xla_data_proto",
    443         "//tensorflow/compiler/xla/service/llvm_ir:llvm_util",
    444         "//tensorflow/core:lib",
    445     ],
    446 )
    447 
    448 cc_library(
    449     name = "llvm_ir_runtime",
    450     srcs = [
    451         "llvm_ir_runtime.cc",
    452     ],
    453     hdrs = [
    454         "llvm_ir_runtime.h",
    455     ],
    456     deps = [
    457         ":vector_support_library",
    458         "//tensorflow/compiler/xla/service/llvm_ir:llvm_util",
    459         "//tensorflow/core:lib",
    460         "@llvm//:core",
    461         "@llvm//:transform_utils",
    462     ],
    463 )
    464 
    465 cc_library(
    466     name = "runtime_conv2d",
    467     srcs = [
    468         "runtime_conv2d.cc",
    469         "runtime_conv2d_impl.h",
    470     ],
    471     hdrs = ["runtime_conv2d.h"],
    472     copts = runtime_copts(),
    473     visibility = ["//visibility:public"],
    474     deps = [
    475         "//tensorflow/compiler/xla:executable_run_options",
    476         "//tensorflow/core:framework_lite",
    477         "//tensorflow/core/kernels:eigen_helpers",
    478         "//third_party/eigen3",
    479     ],
    480 )
    481 
    482 cc_library(
    483     name = "runtime_fft",
    484     srcs = [
    485         "runtime_fft.cc",
    486         "runtime_fft_impl.h",
    487     ],
    488     hdrs = ["runtime_fft.h"],
    489     copts = runtime_copts(),
    490     visibility = ["//visibility:public"],
    491     deps = [
    492         "//tensorflow/compiler/xla:executable_run_options",
    493         "//tensorflow/compiler/xla:xla_data_proto",
    494         "//tensorflow/core:framework",
    495         "//tensorflow/core:framework_lite",
    496         "//third_party/eigen3",
    497     ],
    498 )
    499 
    500 cc_library(
    501     name = "runtime_matvec",
    502     srcs = ["runtime_matvec.cc"],
    503     hdrs = ["runtime_matvec.h"],
    504     copts = runtime_copts(),
    505     deps = [
    506         "//tensorflow/core:framework_lite",
    507         "//third_party/eigen3",
    508     ],
    509 )
    510 
    511 cc_library(
    512     name = "runtime_matmul",
    513     srcs = ["runtime_matmul.cc"],
    514     hdrs = ["runtime_matmul.h"],
    515     copts = runtime_copts(),
    516     visibility = ["//visibility:public"],
    517     deps = [
    518         ":runtime_matvec",
    519         "//tensorflow/compiler/xla:executable_run_options",
    520         "//tensorflow/core:framework_lite",
    521         "//third_party/eigen3",
    522     ],
    523 )
    524 
    525 cc_library(
    526     name = "runtime_single_threaded_conv2d",
    527     srcs = [
    528         "runtime_conv2d_impl.h",
    529         "runtime_single_threaded_conv2d.cc",
    530     ],
    531     hdrs = ["runtime_single_threaded_conv2d.h"],
    532     copts = runtime_copts(),
    533     visibility = ["//visibility:public"],
    534     deps = [
    535         "//tensorflow/core:framework_lite",
    536         "//tensorflow/core/kernels:eigen_helpers",
    537         "//third_party/eigen3",
    538     ],
    539 )
    540 
    541 cc_library(
    542     name = "runtime_single_threaded_matmul",
    543     srcs = ["runtime_single_threaded_matmul.cc"],
    544     hdrs = ["runtime_single_threaded_matmul.h"],
    545     copts = runtime_copts(),
    546     visibility = ["//visibility:public"],
    547     deps = [
    548         ":runtime_matvec",
    549         "//tensorflow/core:framework_lite",
    550         "//third_party/eigen3",
    551     ],
    552 )
    553 
    554 cc_library(
    555     name = "runtime_fork_join",
    556     srcs = ["runtime_fork_join.cc"],
    557     hdrs = ["runtime_fork_join.h"],
    558     copts = runtime_copts(),
    559     visibility = ["//visibility:public"],
    560     deps = [
    561         "//tensorflow/compiler/xla:executable_run_options",
    562         "//tensorflow/core:lib",
    563         "//tensorflow/core:lib_internal",
    564         "//third_party/eigen3",
    565     ],
    566 )
    567 
    568 tf_cc_test(
    569     name = "cpu_runtime_test",
    570     srcs = ["cpu_runtime_test.cc"],
    571     tags = ["optonly"],
    572     deps = [
    573         ":cpu_runtime",
    574         ":runtime_matmul",
    575         ":runtime_single_threaded_matmul",
    576         "//tensorflow/compiler/xla:array2d",
    577         "//tensorflow/compiler/xla:types",
    578         "//tensorflow/compiler/xla:util",
    579         "//tensorflow/compiler/xla/client:local_client",
    580         "//tensorflow/compiler/xla/tests:xla_internal_test_main",
    581         "//tensorflow/core:core_cpu_internal",
    582         "//tensorflow/core:lib",
    583         "//tensorflow/core:test",
    584         "//third_party/eigen3",
    585     ],
    586 )
    587 
    588 tf_cc_test(
    589     name = "cpu_instruction_fusion_test",
    590     srcs = ["cpu_instruction_fusion_test.cc"],
    591     deps = [
    592         ":cpu_instruction_fusion",
    593         "//tensorflow/compiler/xla/service:hlo_matchers",
    594         "//tensorflow/compiler/xla/service:transpose_folding",
    595         "//tensorflow/compiler/xla/tests:hlo_test_base",
    596         "//tensorflow/compiler/xla/tests:xla_internal_test_main",
    597         "//tensorflow/core:lib",
    598     ],
    599 )
    600 
    601 tf_cc_test(
    602     name = "xfeed_manager_test",
    603     size = "small",
    604     srcs = ["xfeed_manager_test.cc"],
    605     deps = [
    606         ":cpu_runtime",
    607         "//tensorflow/compiler/xla:shape_util",
    608         "//tensorflow/compiler/xla/tests:xla_internal_test_main",
    609         "//tensorflow/core:lib",
    610         "//tensorflow/core:test",
    611     ],
    612 )
    613 
    614 cc_library(
    615     name = "cpu_instruction_fusion",
    616     srcs = ["cpu_instruction_fusion.cc"],
    617     hdrs = ["cpu_instruction_fusion.h"],
    618     deps = [
    619         ":ir_emission_utils",
    620         "//tensorflow/compiler/xla/service:hlo",
    621         "//tensorflow/compiler/xla/service:instruction_fusion",
    622     ],
    623 )
    624 
    625 cc_library(
    626     name = "cpu_parallelization_preparation",
    627     srcs = ["cpu_parallelization_preparation.cc"],
    628     hdrs = [
    629         "cpu_parallelization_preparation.h",
    630     ],
    631     deps = [
    632         ":ir_emission_utils",
    633         ":parallel_task_assignment",
    634         ":shape_partition",
    635         "//tensorflow/compiler/xla:types",
    636         "//tensorflow/compiler/xla:util",
    637         "//tensorflow/compiler/xla/service:hlo",
    638         "//tensorflow/compiler/xla/service:hlo_cost_analysis",
    639         "//tensorflow/compiler/xla/service:hlo_pass",
    640         "//tensorflow/core:lib",
    641     ],
    642 )
    643 
    644 cc_library(
    645     name = "ir_emission_utils",
    646     srcs = ["ir_emission_utils.cc"],
    647     hdrs = ["ir_emission_utils.h"],
    648     deps = [
    649         ":cpu_runtime",
    650         "//tensorflow/compiler/xla:shape_util",
    651         "//tensorflow/compiler/xla:window_util",
    652         "//tensorflow/compiler/xla/service:hlo",
    653         "@llvm//:core",
    654     ],
    655 )
    656 
    657 cc_library(
    658     name = "cpu_layout_assignment",
    659     srcs = ["cpu_layout_assignment.cc"],
    660     hdrs = ["cpu_layout_assignment.h"],
    661     deps = [
    662         ":dot_op_emitter",
    663         ":ir_emission_utils",
    664         "//tensorflow/compiler/xla:util",
    665         "//tensorflow/compiler/xla/service:computation_layout",
    666         "//tensorflow/compiler/xla/service:layout_assignment",
    667         "//tensorflow/core:lib",
    668     ],
    669 )
    670 
    671 tf_cc_test(
    672     name = "cpu_layout_assignment_test",
    673     size = "small",
    674     srcs = ["cpu_layout_assignment_test.cc"],
    675     deps = [
    676         ":cpu_layout_assignment",
    677         "//tensorflow/compiler/xla:literal_util",
    678         "//tensorflow/compiler/xla:shape_layout",
    679         "//tensorflow/compiler/xla:shape_util",
    680         "//tensorflow/compiler/xla:test",
    681         "//tensorflow/compiler/xla:test_helpers",
    682         "//tensorflow/compiler/xla:util",
    683         "//tensorflow/compiler/xla:xla_data_proto",
    684         "//tensorflow/compiler/xla/service:algebraic_simplifier",
    685         "//tensorflow/compiler/xla/service:computation_layout",
    686         "//tensorflow/compiler/xla/service:hlo",
    687         "//tensorflow/compiler/xla/service:hlo_matchers",
    688         "//tensorflow/compiler/xla/tests:hlo_test_base",
    689         "//tensorflow/compiler/xla/tests:test_utils",
    690         "//tensorflow/core:lib",
    691     ],
    692 )
    693 
    694 cc_library(
    695     name = "conv_canonicalization",
    696     srcs = ["conv_canonicalization.cc"],
    697     hdrs = ["conv_canonicalization.h"],
    698     deps = [
    699         ":cpu_runtime",
    700         ":ir_emission_utils",
    701         "//tensorflow/compiler/xla:shape_util",
    702         "//tensorflow/compiler/xla:util",
    703         "//tensorflow/compiler/xla:xla_data_proto",
    704         "//tensorflow/compiler/xla/service:hlo",
    705         "//tensorflow/compiler/xla/service:hlo_pass",
    706         "//tensorflow/core:lib",
    707     ],
    708 )
    709 
    710 tf_cc_test(
    711     name = "conv_canonicalization_test",
    712     srcs = ["conv_canonicalization_test.cc"],
    713     deps = [
    714         ":conv_canonicalization",
    715         "//tensorflow/compiler/xla:test",
    716         "//tensorflow/compiler/xla:test_helpers",
    717         "//tensorflow/compiler/xla:util",
    718         "//tensorflow/compiler/xla/service:hlo",
    719         "//tensorflow/compiler/xla/tests:hlo_test_base",
    720         "//tensorflow/compiler/xla/tests:xla_internal_test_main",
    721     ],
    722 )
    723 
    724 cc_library(
    725     name = "shape_partition",
    726     srcs = ["shape_partition.cc"],
    727     hdrs = ["shape_partition.h"],
    728     deps = [
    729         "//tensorflow/compiler/xla:shape_util",
    730     ],
    731 )
    732 
    733 tf_cc_test(
    734     name = "shape_partition_test",
    735     srcs = ["shape_partition_test.cc"],
    736     deps = [
    737         ":shape_partition",
    738         "//tensorflow/compiler/xla:test_helpers",
    739         "//tensorflow/compiler/xla:util",
    740         "//tensorflow/compiler/xla/tests:hlo_test_base",
    741         "//tensorflow/compiler/xla/tests:xla_internal_test_main",
    742     ],
    743 )
    744 
    745 cc_library(
    746     name = "parallel_task_assignment",
    747     srcs = ["parallel_task_assignment.cc"],
    748     hdrs = ["parallel_task_assignment.h"],
    749     deps = [
    750         ":dot_op_emitter",
    751         ":ir_emission_utils",
    752         ":shape_partition",
    753         "//tensorflow/compiler/xla/service:hlo",
    754         "//tensorflow/compiler/xla/service:hlo_cost_analysis",
    755         "//tensorflow/compiler/xla/service:hlo_pass",
    756     ],
    757 )
    758 
    759 cc_library(
    760     name = "cpu_options",
    761     srcs = ["cpu_options.cc"],
    762     hdrs = ["cpu_options.h"],
    763     deps = [
    764         "//tensorflow/compiler/xla/service:hlo_module_config",
    765         "//tensorflow/core:lib",
    766     ],
    767 )
    768 
    769 cc_library(
    770     name = "custom_call_target_registry",
    771     srcs = [
    772         "custom_call_target_registry.cc",
    773     ],
    774     hdrs = [
    775         "custom_call_target_registry.h",
    776     ],
    777     visibility = ["//visibility:public"],
    778 )
    779 
    780 cc_library(
    781     name = "orc_jit_memory_mapper",
    782     srcs = ["orc_jit_memory_mapper.cc"],
    783     hdrs = ["orc_jit_memory_mapper.h"],
    784     deps = [
    785         "//tensorflow/core:lib",
    786         "@llvm//:execution_engine",
    787     ],
    788 )
    789 
    790 cc_library(
    791     name = "cpu_copy_insertion",
    792     srcs = ["cpu_copy_insertion.cc"],
    793     hdrs = ["cpu_copy_insertion.h"],
    794     deps = [
    795         "//tensorflow/compiler/xla/service:copy_insertion",
    796         "//tensorflow/compiler/xla/service:hlo",
    797         "//tensorflow/compiler/xla/service:hlo_pass",
    798         "//tensorflow/core:lib",
    799     ],
    800 )
    801 
    802 cc_library(
    803     name = "vector_support_library",
    804     srcs = ["vector_support_library.cc"],
    805     hdrs = ["vector_support_library.h"],
    806     deps = [
    807         ":target_machine_features",
    808         "//tensorflow/compiler/xla:shape_util",
    809         "//tensorflow/compiler/xla:types",
    810         "//tensorflow/compiler/xla:xla_data_proto",
    811         "//tensorflow/compiler/xla/service/llvm_ir:llvm_util",
    812         "@llvm//:core",
    813         "@llvm//:support",
    814     ],
    815 )
    816 
    817 tf_cc_test(
    818     name = "cpu_copy_insertion_test",
    819     srcs = ["cpu_copy_insertion_test.cc"],
    820     deps = [
    821         ":cpu_copy_insertion",
    822         "//tensorflow/compiler/xla:literal_util",
    823         "//tensorflow/compiler/xla:shape_util",
    824         "//tensorflow/compiler/xla:test",
    825         "//tensorflow/compiler/xla:test_helpers",
    826         "//tensorflow/compiler/xla:xla_data_proto",
    827         "//tensorflow/compiler/xla/legacy_flags:debug_options_flags",
    828         "//tensorflow/compiler/xla/service:hlo",
    829         "//tensorflow/compiler/xla/service:hlo_graph_dumper",
    830         "//tensorflow/compiler/xla/service:hlo_matchers",
    831         "//tensorflow/compiler/xla/tests:hlo_test_base",
    832         "//tensorflow/compiler/xla/tests:xla_internal_test_main",
    833         "//tensorflow/core:test",
    834     ],
    835 )
    836 
    837 cc_library(
    838     name = "cpu_hlo_support_checker",
    839     srcs = ["cpu_hlo_support_checker.cc"],
    840     hdrs = ["cpu_hlo_support_checker.h"],
    841     deps = [
    842         "//tensorflow/compiler/xla:shape_util",
    843         "//tensorflow/compiler/xla:xla_data_proto",
    844         "//tensorflow/compiler/xla/service:hlo_pass",
    845         "//tensorflow/core:lib",
    846     ],
    847 )
    848 
    849 tf_cc_test(
    850     name = "cpu_hlo_support_checker_test",
    851     srcs = ["cpu_hlo_support_checker_test.cc"],
    852     deps = [
    853         ":cpu_hlo_support_checker",
    854         "//tensorflow/compiler/xla:shape_util",
    855         "//tensorflow/compiler/xla:test",
    856         "//tensorflow/compiler/xla/tests:hlo_test_base",
    857         "//tensorflow/compiler/xla/tests:xla_internal_test_main",
    858         "//tensorflow/core:protos_all_cc",
    859         "//tensorflow/core:test",
    860     ],
    861 )
    862 
    863 # -----------------------------------------------------------------------------
    864 
    865 filegroup(
    866     name = "all_files",
    867     srcs = glob(
    868         ["**/*"],
    869         exclude = [
    870             "**/METADATA",
    871             "**/OWNERS",
    872         ],
    873     ),
    874     visibility = ["//tensorflow:__subpackages__"],
    875 )
    876