Home | History | Annotate | Download | only in xla
      1 licenses(["notice"])  # Apache 2.0
      2 
      3 package(default_visibility = ["//tensorflow:internal"])
      4 
      5 package_group(
      6     name = "friends",
      7     packages = [
      8         "//tensorflow/compiler/...",
      9         "//tensorflow/contrib/tpu/...",
     10     ],
     11 )
     12 
     13 package_group(
     14     name = "internal",
     15     packages = [
     16         "//tensorflow/compiler/xla/...",
     17     ],
     18 )
     19 
     20 load("//tensorflow:tensorflow.bzl", "cc_header_only_library")
     21 load("//tensorflow:tensorflow.bzl", "tf_cc_test")
     22 load("//tensorflow/compiler/xla:xla.bzl", "xla_proto_library")
     23 load(
     24     "//tensorflow/core:platform/default/build_config.bzl",
     25     "tf_proto_library_py",
     26 )
     27 
     28 # Filegroup used to collect source files for dependency checking.
     29 filegroup(
     30     name = "c_srcs",
     31     data = glob([
     32         "**/*.cc",
     33         "**/*.h",
     34     ]),
     35 )
     36 
     37 xla_proto_library(
     38     name = "xla_data_proto",
     39     srcs = ["xla_data.proto"],
     40     visibility = ["//visibility:public"],
     41 )
     42 
     43 tf_proto_library_py(
     44     name = "xla_data_proto",  # bzl adds a _py suffix
     45     srcs = ["xla_data.proto"],
     46     visibility = ["//visibility:public"],
     47 )
     48 
     49 xla_proto_library(
     50     name = "xla_proto",
     51     srcs = ["xla.proto"],
     52     visibility = ["//visibility:public"],
     53     deps = [
     54         ":xla_data_proto",
     55         "//tensorflow/compiler/xla/service:session_proto",
     56     ],
     57 )
     58 
     59 cc_library(
     60     name = "execution_options_util",
     61     srcs = [
     62         "execution_options_util.cc",
     63     ],
     64     hdrs = [
     65         "execution_options_util.h",
     66     ],
     67     visibility = [":friends"],
     68     deps = [
     69         ":xla_proto",
     70         "//tensorflow/compiler/xla/legacy_flags:debug_options_flags",
     71     ],
     72 )
     73 
     74 cc_library(
     75     name = "test",
     76     testonly = 1,
     77     hdrs = ["test.h"],
     78     visibility = [":friends"],
     79     deps = [
     80         "//tensorflow/core:lib_internal",
     81         "//tensorflow/core:test",
     82     ],
     83 )
     84 
     85 cc_library(
     86     name = "types",
     87     hdrs = ["types.h"],
     88     visibility = [":friends"],
     89     deps = [
     90         "//tensorflow/core:framework_lite",
     91         "//third_party/eigen3",
     92     ],
     93 )
     94 
     95 cc_library(
     96     name = "service_interface",
     97     srcs = [],
     98     hdrs = ["service_interface.h"],
     99     visibility = [":friends"],
    100     deps = [
    101         ":xla_proto",
    102         "//tensorflow/core:lib",
    103     ],
    104 )
    105 
    106 cc_library(
    107     name = "status_macros",
    108     srcs = ["status_macros.cc"],
    109     hdrs = ["status_macros.h"],
    110     visibility = [":friends"],
    111     deps = [
    112         ":statusor",
    113         ":types",
    114         "//tensorflow/core:lib",
    115     ],
    116 )
    117 
    118 tf_cc_test(
    119     name = "status_macros_test",
    120     size = "small",
    121     srcs = ["status_macros_test.cc"],
    122     deps = [
    123         ":status_macros",
    124         ":statusor",
    125         ":test",
    126         ":test_helpers",
    127         "//tensorflow/core:lib",
    128         "//tensorflow/core:test_main",
    129     ],
    130 )
    131 
    132 cc_library(
    133     name = "status",
    134     hdrs = ["status.h"],
    135     visibility = ["//visibility:public"],
    136     deps = [
    137         "//tensorflow/core:lib",
    138         "//tensorflow/core:lib_internal",
    139     ],
    140 )
    141 
    142 cc_library(
    143     name = "statusor",
    144     srcs = ["statusor.cc"],
    145     hdrs = [
    146         "statusor.h",
    147         "statusor_internals.h",
    148     ],
    149     visibility = ["//visibility:public"],
    150     deps = [
    151         ":status",
    152         "//tensorflow/core:lib",
    153         "//tensorflow/core:lib_internal",
    154     ],
    155 )
    156 
    157 tf_cc_test(
    158     name = "statusor_test",
    159     size = "small",
    160     srcs = ["statusor_test.cc"],
    161     deps = [
    162         ":statusor",
    163         ":test",
    164         ":types",
    165         "//tensorflow/core:lib",
    166         "//tensorflow/core:test",
    167         "//tensorflow/core:test_main",
    168     ],
    169 )
    170 
    171 cc_library(
    172     name = "util",
    173     srcs = ["util.cc"],
    174     hdrs = [
    175         "iterator_util.h",
    176         "map_util.h",
    177         "ptr_util.h",
    178         "util.h",
    179     ],
    180     visibility = ["//visibility:public"],
    181     deps = [
    182         ":status",
    183         ":status_macros",
    184         ":statusor",
    185         ":types",
    186         ":xla_data_proto",
    187         "//tensorflow/core:lib",
    188         "//tensorflow/core:ptr_util",
    189     ],
    190 )
    191 
    192 cc_library(
    193     name = "protobuf_util",
    194     srcs = ["protobuf_util.cc"],
    195     hdrs = [
    196         "protobuf_util.h",
    197     ],
    198     visibility = ["//visibility:public"],
    199     deps = [
    200         ":status_macros",
    201         ":statusor",
    202         ":types",
    203         ":util",
    204         "//tensorflow/core:lib",
    205     ],
    206 )
    207 
    208 tf_cc_test(
    209     name = "util_test",
    210     srcs = ["util_test.cc"],
    211     deps = [
    212         ":test",
    213         ":types",
    214         ":util",
    215         "//tensorflow/core:test_main",
    216     ],
    217 )
    218 
    219 tf_cc_test(
    220     name = "iterator_util_test",
    221     srcs = ["iterator_util_test.cc"],
    222     deps = [
    223         ":test",
    224         ":util",
    225         "//tensorflow/core:test_main",
    226     ],
    227 )
    228 
    229 cc_library(
    230     name = "shape_util",
    231     srcs = [
    232         "index_util.cc",
    233         "layout_util.cc",
    234         "primitive_util.cc",
    235         "shape_util.cc",
    236     ],
    237     hdrs = [
    238         "index_util.h",
    239         "layout_util.h",
    240         "primitive_util.h",
    241         "shape_util.h",
    242     ],
    243     visibility = ["//visibility:public"],
    244     deps = [
    245         ":protobuf_util",
    246         ":status_macros",
    247         ":statusor",
    248         ":types",
    249         ":util",
    250         ":xla_data_proto",
    251         "//tensorflow/core:framework_internal",
    252         "//tensorflow/core:lib",
    253         "//tensorflow/core:lib_internal",
    254         "//tensorflow/core:regexp_internal",
    255     ],
    256 )
    257 
    258 tf_cc_test(
    259     name = "shape_util_test",
    260     srcs = ["shape_util_test.cc"],
    261     deps = [
    262         ":shape_util",
    263         ":status_macros",
    264         ":test",
    265         ":test_helpers",
    266         ":types",
    267         ":util",
    268         ":xla_data_proto",
    269         "//tensorflow/core:test_main",
    270     ],
    271 )
    272 
    273 tf_cc_test(
    274     name = "layout_util_test",
    275     srcs = ["layout_util_test.cc"],
    276     deps = [
    277         ":shape_util",
    278         ":test",
    279         ":test_helpers",
    280         "//tensorflow/core:test_main",
    281     ],
    282 )
    283 
    284 tf_cc_test(
    285     name = "index_util_test",
    286     srcs = ["index_util_test.cc"],
    287     deps = [
    288         ":shape_util",
    289         ":test",
    290         ":xla_data_proto",
    291         "//tensorflow/core:test_main",
    292     ],
    293 )
    294 
    295 cc_library(
    296     name = "literal_util",
    297     srcs = ["literal_util.cc"],
    298     hdrs = ["literal_util.h"],
    299     visibility = ["//visibility:public"],
    300     deps = [
    301         ":array2d",
    302         ":array3d",
    303         ":array4d",
    304         ":shape_tree",
    305         ":shape_util",
    306         ":sparse_index_array",
    307         ":status_macros",
    308         ":types",
    309         ":util",
    310         ":xla_data_proto",
    311         "//tensorflow/core:lib",
    312     ],
    313 )
    314 
    315 tf_cc_test(
    316     name = "literal_util_test",
    317     srcs = ["literal_util_test.cc"],
    318     deps = [
    319         ":array3d",
    320         ":array4d",
    321         ":literal_util",
    322         ":shape_util",
    323         ":test",
    324         ":types",
    325         "//tensorflow/core:lib",
    326         "//tensorflow/core:test",
    327         "//tensorflow/core:test_main",
    328     ],
    329 )
    330 
    331 cc_library(
    332     name = "metric_table_report",
    333     srcs = ["metric_table_report.cc"],
    334     hdrs = ["metric_table_report.h"],
    335     visibility = ["//visibility:public"],
    336     deps = [
    337         ":util",
    338         "//tensorflow/core:lib",
    339     ],
    340 )
    341 
    342 cc_library(
    343     name = "device_util",
    344     hdrs = ["device_util.h"],
    345     visibility = ["//visibility:public"],
    346     deps = [
    347         ":types",
    348         "//tensorflow/core:lib",
    349         "//tensorflow/core:stream_executor_no_cuda",
    350     ],
    351 )
    352 
    353 cc_library(
    354     name = "array",
    355     hdrs = ["array.h"],
    356     deps = [
    357         ":status",
    358         ":types",
    359         "//tensorflow/core:lib",
    360     ],
    361 )
    362 
    363 tf_cc_test(
    364     name = "array_test",
    365     srcs = ["array_test.cc"],
    366     deps = [
    367         ":array",
    368         ":test",
    369         "//tensorflow/core:test_main",
    370     ],
    371 )
    372 
    373 cc_library(
    374     name = "array2d",
    375     srcs = ["array2d.cc"],
    376     hdrs = ["array2d.h"],
    377     visibility = ["//visibility:public"],
    378     deps = [
    379         ":array",
    380         ":types",
    381         ":util",
    382         "//tensorflow/core:lib",
    383     ],
    384 )
    385 
    386 tf_cc_test(
    387     name = "array2d_test",
    388     srcs = ["array2d_test.cc"],
    389     deps = [
    390         ":array2d",
    391         ":test",
    392         "//tensorflow/core:test_main",
    393     ],
    394 )
    395 
    396 cc_library(
    397     name = "array3d",
    398     hdrs = ["array3d.h"],
    399     visibility = [":friends"],
    400     deps = [
    401         ":array",
    402         ":types",
    403         "//tensorflow/core:lib",
    404     ],
    405 )
    406 
    407 tf_cc_test(
    408     name = "array3d_test",
    409     srcs = ["array3d_test.cc"],
    410     deps = [
    411         ":array3d",
    412         ":test",
    413         ":types",
    414         "//tensorflow/core:test_main",
    415     ],
    416 )
    417 
    418 cc_library(
    419     name = "array4d",
    420     hdrs = ["array4d.h"],
    421     visibility = [":friends"],
    422     deps = [
    423         ":array",
    424         ":array2d",
    425         ":types",
    426         "//tensorflow/core:lib",
    427     ],
    428 )
    429 
    430 tf_cc_test(
    431     name = "array4d_test",
    432     srcs = ["array4d_test.cc"],
    433     deps = [
    434         ":array4d",
    435         ":test",
    436         "//tensorflow/core:lib",
    437         "//tensorflow/core:test_main",
    438     ],
    439 )
    440 
    441 cc_library(
    442     name = "executable_run_options",
    443     srcs = ["executable_run_options.cc"],
    444     hdrs = ["executable_run_options.h"],
    445     visibility = ["//visibility:public"],
    446 )
    447 
    448 cc_library(
    449     name = "packed_literal_reader",
    450     srcs = ["packed_literal_reader.cc"],
    451     hdrs = ["packed_literal_reader.h"],
    452     visibility = [":internal"],
    453     deps = [
    454         ":literal_util",
    455         ":shape_util",
    456         ":status_macros",
    457         ":statusor",
    458         ":types",
    459         ":util",
    460         ":xla_data_proto",
    461         "//tensorflow/core:lib",
    462     ],
    463 )
    464 
    465 cc_library(
    466     name = "test_helpers",
    467     testonly = 1,
    468     hdrs = ["test_helpers.h"],
    469     visibility = [":internal"],
    470     deps = [
    471         ":statusor",
    472         ":types",
    473         "//tensorflow/core:lib",
    474         "//tensorflow/core:regexp_internal",
    475         "//tensorflow/core:test",
    476     ],
    477 )
    478 
    479 cc_library(
    480     name = "text_literal_reader",
    481     srcs = ["text_literal_reader.cc"],
    482     hdrs = ["text_literal_reader.h"],
    483     visibility = [":internal"],
    484     deps = [
    485         ":literal_util",
    486         ":shape_util",
    487         ":status_macros",
    488         ":statusor",
    489         ":types",
    490         ":util",
    491         ":xla_data_proto",
    492         "//tensorflow/core:lib",
    493         "//tensorflow/core:lib_internal",
    494     ],
    495 )
    496 
    497 tf_cc_test(
    498     name = "text_literal_reader_test",
    499     srcs = ["text_literal_reader_test.cc"],
    500     deps = [
    501         ":literal_util",
    502         ":shape_util",
    503         ":test",
    504         ":text_literal_reader",
    505         ":types",
    506         ":xla_data_proto",
    507         "//tensorflow/core:lib",
    508         "//tensorflow/core:test_main",
    509     ],
    510 )
    511 
    512 cc_library(
    513     name = "text_literal_writer",
    514     srcs = ["text_literal_writer.cc"],
    515     hdrs = ["text_literal_writer.h"],
    516     visibility = [":internal"],
    517     deps = [
    518         ":literal_util",
    519         ":shape_util",
    520         ":status_macros",
    521         ":types",
    522         ":xla_data_proto",
    523         "//tensorflow/core:lib",
    524     ],
    525 )
    526 
    527 tf_cc_test(
    528     name = "text_literal_writer_test",
    529     srcs = ["text_literal_writer_test.cc"],
    530     deps = [
    531         ":literal_util",
    532         ":test",
    533         ":test_helpers",
    534         ":text_literal_writer",
    535         ":types",
    536         "//tensorflow/core:lib",
    537         "//tensorflow/core:test_main",
    538     ],
    539 )
    540 
    541 cc_library(
    542     name = "shape_tree",
    543     hdrs = ["shape_tree.h"],
    544     visibility = ["//visibility:public"],
    545     deps = [
    546         ":shape_util",
    547         ":status_macros",
    548         ":util",
    549         ":xla_data_proto",
    550         "//tensorflow/core:lib",
    551         "//tensorflow/core:lib_internal",
    552     ],
    553 )
    554 
    555 tf_cc_test(
    556     name = "shape_tree_test",
    557     srcs = ["shape_tree_test.cc"],
    558     deps = [
    559         ":shape_tree",
    560         ":shape_util",
    561         ":test",
    562         ":xla_data_proto",
    563         "//tensorflow/core:test_main",
    564     ],
    565 )
    566 
    567 cc_library(
    568     name = "shape_layout",
    569     srcs = ["shape_layout.cc"],
    570     hdrs = ["shape_layout.h"],
    571     visibility = ["//visibility:public"],
    572     deps = [
    573         ":shape_util",
    574         ":types",
    575         ":util",
    576         ":xla_data_proto",
    577         "//tensorflow/core:lib",
    578     ],
    579 )
    580 
    581 cc_library(
    582     name = "window_util",
    583     srcs = ["window_util.cc"],
    584     hdrs = ["window_util.h"],
    585     visibility = ["//visibility:public"],
    586     deps = [
    587         ":types",
    588         ":xla_data_proto",
    589         "//tensorflow/core:lib",
    590     ],
    591 )
    592 
    593 cc_library(
    594     name = "reference_util",
    595     srcs = ["reference_util.cc"],
    596     hdrs = ["reference_util.h"],
    597     visibility = ["//visibility:public"],
    598     deps = [
    599         ":array2d",
    600         ":array3d",
    601         ":array4d",
    602         ":util",
    603         ":window_util",
    604         ":xla_data_proto",
    605         "//tensorflow/compiler/xla/client:computation_builder",
    606         "//tensorflow/compiler/xla/client:padding",
    607         "//tensorflow/compiler/xla/service:hlo",
    608         "//tensorflow/compiler/xla/service:hlo_evaluator",
    609         "//tensorflow/compiler/xla/service:shape_inference",
    610         "//tensorflow/compiler/xla/service/cpu:runtime_single_threaded_matmul",
    611         "//tensorflow/core:lib",
    612     ],
    613 )
    614 
    615 tf_cc_test(
    616     name = "reference_util_test",
    617     srcs = ["reference_util_test.cc"],
    618     deps = [
    619         ":array2d",
    620         ":array3d",
    621         ":array4d",
    622         ":literal_util",
    623         ":reference_util",
    624         ":test",
    625         ":util",
    626         ":xla_data_proto",
    627         "//tensorflow/compiler/xla/client:padding",
    628         "//tensorflow/compiler/xla/tests:literal_test_util",
    629         "//tensorflow/core:test_main",
    630     ],
    631 )
    632 
    633 cc_library(
    634     name = "sparse_index_array",
    635     srcs = ["sparse_index_array.cc"],
    636     hdrs = ["sparse_index_array.h"],
    637     deps = [
    638         ":array2d",
    639         ":shape_util",
    640         ":xla_data_proto",
    641         "//tensorflow/core:lib",
    642     ],
    643 )
    644 
    645 tf_cc_test(
    646     name = "sparse_index_array_test",
    647     srcs = ["sparse_index_array_test.cc"],
    648     deps = [
    649         ":sparse_index_array",
    650         ":test",
    651         "//tensorflow/core:test_main",
    652     ],
    653 )
    654 
    655 # -----------------------------------------------------------------------------
    656 
    657 filegroup(
    658     name = "all_files",
    659     srcs = glob(
    660         ["**/*"],
    661         exclude = [
    662             "**/METADATA",
    663             "**/OWNERS",
    664         ],
    665     ),
    666     visibility = ["//tensorflow:__subpackages__"],
    667 )
    668 
    669 # This is a headers target that extra XLA devices can use to prevent circular dependencies.  Devices that are compiled as separate shared objects can also use it to prevent linking of library code.
    670 cc_header_only_library(
    671     name = "xla_headers_lib",
    672     visibility = ["//visibility:public"],
    673     deps = [
    674         ":xla_data_proto",
    675         ":xla_proto",
    676         "//tensorflow/compiler/xla/client:client_library",
    677         "//tensorflow/compiler/xla/service:hlo",
    678         "//tensorflow/core:framework_headers_lib",
    679         "//tensorflow/core:stream_executor_headers_lib",
    680     ],
    681 )
    682