Home | History | Annotate | Download | only in gpu
      1 # Description:
      2 #   GPU-platform specific StreamExecutor support code.
      3 
      4 licenses(["notice"])  # Apache 2.0
      5 
      6 load(
      7     "//tensorflow/stream_executor:build_defs.bzl",
      8     "if_gpu_is_configured",
      9 )
     10 load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda_is_configured")
     11 load("@local_config_rocm//rocm:build_defs.bzl", "if_rocm_is_configured")
     12 
     13 package(
     14     default_visibility = ["//tensorflow/stream_executor:__subpackages__"],
     15 )
     16 
     17 # Filegroup used to collect source files for the dependency check.
     18 filegroup(
     19     name = "c_srcs",
     20     data = glob([
     21         "**/*.cc",
     22         "**/*.h",
     23     ]),
     24 )
     25 
     26 cc_library(
     27     name = "gpu_activation_header",
     28     hdrs = ["gpu_activation.h"],
     29     deps = ["//tensorflow/stream_executor/platform"],
     30 )
     31 
     32 cc_library(
     33     name = "gpu_activation",
     34     srcs = if_gpu_is_configured(["gpu_activation.cc"]),
     35     hdrs = if_gpu_is_configured(["gpu_activation.h"]),
     36     deps = if_gpu_is_configured([
     37         ":gpu_activation_header",
     38         ":gpu_driver_header",
     39         "//tensorflow/stream_executor",
     40         "//tensorflow/stream_executor:stream_executor_internal",
     41         "//tensorflow/stream_executor/platform",
     42     ]),
     43 )
     44 
     45 cc_library(
     46     name = "gpu_diagnostics_header",
     47     hdrs = if_gpu_is_configured(["gpu_diagnostics.h"]),
     48     deps = [
     49         "//tensorflow/stream_executor/lib",
     50         "//tensorflow/stream_executor/platform",
     51     ],
     52 )
     53 
     54 cc_library(
     55     name = "gpu_driver_header",
     56     hdrs = if_gpu_is_configured(["gpu_driver.h"]),
     57     deps = [
     58         ":gpu_types_header",
     59         "//tensorflow/stream_executor:device_options",
     60         "//tensorflow/stream_executor/lib",
     61         "//tensorflow/stream_executor/platform",
     62         "@local_config_cuda//cuda:cuda_headers",
     63     ],
     64 )
     65 
     66 cc_library(
     67     name = "gpu_event_header",
     68     hdrs = if_gpu_is_configured(["gpu_event.h"]),
     69     deps = [
     70         ":gpu_driver_header",
     71         ":gpu_stream_header",
     72         "//tensorflow/stream_executor:event",
     73         "//tensorflow/stream_executor/lib",
     74     ],
     75 )
     76 
     77 cc_library(
     78     name = "gpu_event",
     79     srcs = if_gpu_is_configured(["gpu_event.cc"]),
     80     hdrs = if_gpu_is_configured(["gpu_event.h"]),
     81     deps = [
     82         ":gpu_driver_header",
     83         ":gpu_executor_header",
     84         ":gpu_stream",
     85         "//tensorflow/stream_executor:stream_executor_headers",
     86         "//tensorflow/stream_executor/lib",
     87     ],
     88 )
     89 
     90 cc_library(
     91     name = "gpu_executor_header",
     92     hdrs = if_gpu_is_configured(["gpu_executor.h"]),
     93     deps = [
     94         ":gpu_kernel_header",
     95         "//tensorflow/stream_executor:event",
     96         "//tensorflow/stream_executor:platform",
     97         "//tensorflow/stream_executor:stream_executor_internal",
     98         "//tensorflow/stream_executor/lib",
     99         "//tensorflow/stream_executor/platform",
    100         "@com_google_absl//absl/strings",
    101     ],
    102 )
    103 
    104 cc_library(
    105     name = "gpu_helpers_header",
    106     hdrs = if_gpu_is_configured(["gpu_helpers.h"]),
    107     deps = [":gpu_types_header"],
    108 )
    109 
    110 cc_library(
    111     name = "gpu_kernel_header",
    112     hdrs = if_gpu_is_configured(["gpu_kernel.h"]),
    113     deps = [
    114         ":gpu_driver_header",
    115         "//tensorflow/stream_executor:event",
    116         "//tensorflow/stream_executor:stream_executor_pimpl_header",
    117         "//tensorflow/stream_executor/platform",
    118     ],
    119 )
    120 
    121 cc_library(
    122     name = "gpu_rng_header",
    123     hdrs = if_gpu_is_configured(["gpu_rng.h"]),
    124     deps = [
    125         ":gpu_types_header",
    126         "//tensorflow/stream_executor:plugin_registry",
    127         "//tensorflow/stream_executor:rng",
    128         "//tensorflow/stream_executor/platform",
    129     ],
    130 )
    131 
    132 cc_library(
    133     name = "gpu_stream_header",
    134     hdrs = if_gpu_is_configured(["gpu_stream.h"]),
    135     deps = [
    136         ":gpu_driver_header",
    137         "//tensorflow/stream_executor:stream_executor_internal",
    138         "//tensorflow/stream_executor/platform",
    139     ],
    140 )
    141 
    142 cc_library(
    143     name = "gpu_stream",
    144     srcs = if_gpu_is_configured(["gpu_stream.cc"]),
    145     hdrs = if_gpu_is_configured(["gpu_stream.h"]),
    146     deps = [
    147         ":gpu_driver_header",
    148         ":gpu_executor_header",
    149         "//tensorflow/stream_executor:stream_executor_headers",
    150         "//tensorflow/stream_executor:stream_header",
    151         "//tensorflow/stream_executor/lib",
    152         "//tensorflow/stream_executor/platform",
    153     ],
    154 )
    155 
    156 cc_library(
    157     name = "gpu_timer_header",
    158     hdrs = if_gpu_is_configured(["gpu_timer.h"]),
    159     deps = [
    160         ":gpu_driver_header",
    161         ":gpu_executor_header",
    162         "//tensorflow/stream_executor:stream_executor_internal",
    163     ],
    164 )
    165 
    166 cc_library(
    167     name = "gpu_timer",
    168     srcs = if_gpu_is_configured(["gpu_timer.cc"]),
    169     hdrs = if_gpu_is_configured(["gpu_timer.h"]),
    170     deps = [
    171         ":gpu_driver_header",
    172         ":gpu_executor_header",
    173         ":gpu_stream",
    174         "//tensorflow/stream_executor:stream_executor_headers",
    175         "//tensorflow/stream_executor/lib",
    176     ],
    177 )
    178 
    179 cc_library(
    180     name = "gpu_types_header",
    181     hdrs = if_gpu_is_configured(["gpu_types.h"]),
    182     deps = [
    183         "//tensorflow/stream_executor/platform",
    184     ] + if_cuda_is_configured([
    185         "@local_config_cuda//cuda:cuda_headers",
    186     ]) + if_rocm_is_configured([
    187         "@local_config_rocm//rocm:rocm_headers",
    188     ]),
    189 )
    190