diff --git a/tensorflow/compiler/tf2tensorrt/convert/convert_graph.cc b/tensorflow/compiler/tf2tensorrt/convert/convert_graph.cc index 807d2effac0..e5126985ffd 100644 --- a/tensorflow/compiler/tf2tensorrt/convert/convert_graph.cc +++ b/tensorflow/compiler/tf2tensorrt/convert/convert_graph.cc @@ -57,7 +57,7 @@ limitations under the License. #if GOOGLE_CUDA #if GOOGLE_TENSORRT -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" #include "tensorrt/include/NvInfer.h" namespace tensorflow { namespace tensorrt { diff --git a/tensorflow/compiler/tf2tensorrt/convert/convert_nodes_test.cc b/tensorflow/compiler/tf2tensorrt/convert/convert_nodes_test.cc index ae2e91bcac2..2418d296034 100644 --- a/tensorflow/compiler/tf2tensorrt/convert/convert_nodes_test.cc +++ b/tensorflow/compiler/tf2tensorrt/convert/convert_nodes_test.cc @@ -50,8 +50,8 @@ limitations under the License. #if GOOGLE_CUDA #if GOOGLE_TENSORRT -#include "cuda/include/cuda.h" -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" #include "tensorrt/include/NvInfer.h" namespace tensorflow { diff --git a/tensorflow/compiler/tf2tensorrt/kernels/trt_engine_op.cc b/tensorflow/compiler/tf2tensorrt/kernels/trt_engine_op.cc index 3b7c58665b5..e84eacdd629 100644 --- a/tensorflow/compiler/tf2tensorrt/kernels/trt_engine_op.cc +++ b/tensorflow/compiler/tf2tensorrt/kernels/trt_engine_op.cc @@ -41,7 +41,7 @@ limitations under the License. #if GOOGLE_CUDA #if GOOGLE_TENSORRT -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" #include "tensorrt/include/NvInfer.h" namespace tensorflow { diff --git a/tensorflow/compiler/tf2tensorrt/kernels/trt_engine_op_test.cc b/tensorflow/compiler/tf2tensorrt/kernels/trt_engine_op_test.cc index 8d2c26ea23a..b62fdc5dc4b 100644 --- a/tensorflow/compiler/tf2tensorrt/kernels/trt_engine_op_test.cc +++ b/tensorflow/compiler/tf2tensorrt/kernels/trt_engine_op_test.cc @@ -32,7 +32,7 @@ limitations under the License. #if GOOGLE_CUDA #if GOOGLE_TENSORRT -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" namespace tensorflow { namespace tensorrt { diff --git a/tensorflow/compiler/tf2tensorrt/tensorrt_test.cc b/tensorflow/compiler/tf2tensorrt/tensorrt_test.cc index 769982c6456..7486c6db650 100644 --- a/tensorflow/compiler/tf2tensorrt/tensorrt_test.cc +++ b/tensorflow/compiler/tf2tensorrt/tensorrt_test.cc @@ -20,8 +20,8 @@ limitations under the License. #if GOOGLE_CUDA #if GOOGLE_TENSORRT -#include "cuda/include/cuda.h" -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" #include "tensorrt/include/NvInfer.h" namespace tensorflow { diff --git a/tensorflow/compiler/tf2tensorrt/utils/trt_allocator.cc b/tensorflow/compiler/tf2tensorrt/utils/trt_allocator.cc index a18f758a551..8d2ae49a0d0 100644 --- a/tensorflow/compiler/tf2tensorrt/utils/trt_allocator.cc +++ b/tensorflow/compiler/tf2tensorrt/utils/trt_allocator.cc @@ -19,7 +19,7 @@ limitations under the License. #if GOOGLE_CUDA #if GOOGLE_TENSORRT -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" #endif // GOOGLE_TENSORRT #endif // GOOGLE_CUDA diff --git a/tensorflow/compiler/tf2tensorrt/utils/trt_int8_calibrator.cc b/tensorflow/compiler/tf2tensorrt/utils/trt_int8_calibrator.cc index 33a5c719ba9..51aa7be07db 100644 --- a/tensorflow/compiler/tf2tensorrt/utils/trt_int8_calibrator.cc +++ b/tensorflow/compiler/tf2tensorrt/utils/trt_int8_calibrator.cc @@ -22,7 +22,7 @@ limitations under the License. #if GOOGLE_CUDA #if GOOGLE_TENSORRT -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" namespace tensorflow { namespace tensorrt { diff --git a/tensorflow/compiler/tf2tensorrt/utils/trt_int8_calibrator.h b/tensorflow/compiler/tf2tensorrt/utils/trt_int8_calibrator.h index d34e244f6c7..70bd3f609a9 100644 --- a/tensorflow/compiler/tf2tensorrt/utils/trt_int8_calibrator.h +++ b/tensorflow/compiler/tf2tensorrt/utils/trt_int8_calibrator.h @@ -25,7 +25,7 @@ limitations under the License. #if GOOGLE_CUDA #if GOOGLE_TENSORRT -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" #include "tensorrt/include/NvInfer.h" namespace tensorflow { diff --git a/tensorflow/compiler/xla/service/gpu/cusolver_context.h b/tensorflow/compiler/xla/service/gpu/cusolver_context.h index fdd89c3a8d5..68b5fb14c6b 100644 --- a/tensorflow/compiler/xla/service/gpu/cusolver_context.h +++ b/tensorflow/compiler/xla/service/gpu/cusolver_context.h @@ -18,8 +18,8 @@ limitations under the License. #include -#include "cuda/include/cublas_v2.h" -#include "cuda/include/cusolverDn.h" +#include "third_party/gpus/cuda/include/cublas_v2.h" +#include "third_party/gpus/cuda/include/cusolverDn.h" #include "tensorflow/compiler/xla/statusor.h" #include "tensorflow/compiler/xla/types.h" #include "tensorflow/compiler/xla/util.h" diff --git a/tensorflow/contrib/fused_conv/kernels/fused_conv2d_bias_activation_op.cc b/tensorflow/contrib/fused_conv/kernels/fused_conv2d_bias_activation_op.cc index e217f2e1a44..8b4d845157a 100644 --- a/tensorflow/contrib/fused_conv/kernels/fused_conv2d_bias_activation_op.cc +++ b/tensorflow/contrib/fused_conv/kernels/fused_conv2d_bias_activation_op.cc @@ -42,7 +42,7 @@ limitations under the License. #if GOOGLE_CUDA #include "google/protobuf/duration.pb.h" #include "absl/time/time.h" -#include "cuda/include/cudnn.h" +#include "third_party/gpus/cudnn/cudnn.h" #include "tensorflow/core/kernels/conv_ops_gpu.h" #include "tensorflow/core/platform/logger.h" #include "tensorflow/core/platform/stream_executor.h" diff --git a/tensorflow/contrib/tensorrt/custom_plugin_examples/inc_op_kernel.cu.cc b/tensorflow/contrib/tensorrt/custom_plugin_examples/inc_op_kernel.cu.cc index 65f99a2eea7..db7dd6b9587 100644 --- a/tensorflow/contrib/tensorrt/custom_plugin_examples/inc_op_kernel.cu.cc +++ b/tensorflow/contrib/tensorrt/custom_plugin_examples/inc_op_kernel.cu.cc @@ -21,7 +21,7 @@ limitations under the License. #include #define EIGEN_USE_GPU -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/platform/stream_executor.h" #include "tensorflow/core/util/gpu_launch_config.h" diff --git a/tensorflow/contrib/tensorrt/custom_plugin_examples/inc_op_kernel.h b/tensorflow/contrib/tensorrt/custom_plugin_examples/inc_op_kernel.h index c35955e1057..0d4893cd5d6 100644 --- a/tensorflow/contrib/tensorrt/custom_plugin_examples/inc_op_kernel.h +++ b/tensorflow/contrib/tensorrt/custom_plugin_examples/inc_op_kernel.h @@ -18,7 +18,7 @@ limitations under the License. #if GOOGLE_CUDA #if GOOGLE_TENSORRT -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" namespace tensorflow { namespace tensorrt { diff --git a/tensorflow/core/common_runtime/direct_session_test.cc b/tensorflow/core/common_runtime/direct_session_test.cc index 68e035f3cde..14e1486545d 100644 --- a/tensorflow/core/common_runtime/direct_session_test.cc +++ b/tensorflow/core/common_runtime/direct_session_test.cc @@ -50,8 +50,8 @@ limitations under the License. #include "tensorflow/core/util/device_name_utils.h" #ifdef GOOGLE_CUDA -#include "cuda/include/cuda.h" -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" #endif // GOOGLE_CUDA namespace tensorflow { diff --git a/tensorflow/core/common_runtime/gpu/gpu_cudamalloc_allocator.cc b/tensorflow/core/common_runtime/gpu/gpu_cudamalloc_allocator.cc index 623582698ad..ea12a663b2f 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_cudamalloc_allocator.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_cudamalloc_allocator.cc @@ -14,7 +14,7 @@ limitations under the License. ==============================================================================*/ #ifdef GOOGLE_CUDA -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda.h" #include "tensorflow/stream_executor/cuda/cuda_activation.h" #endif // GOOGLE_CUDA diff --git a/tensorflow/core/common_runtime/gpu/gpu_device.cc b/tensorflow/core/common_runtime/gpu/gpu_device.cc index 6e455765b19..d0cd3694853 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_device.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_device.cc @@ -78,7 +78,7 @@ limitations under the License. #if !defined(PLATFORM_GOOGLE) #if GOOGLE_CUDA -#include "cuda/cuda_config.h" +#include "third_party/gpus/cuda/cuda_config.h" #endif #endif diff --git a/tensorflow/core/common_runtime/gpu/gpu_managed_allocator.cc b/tensorflow/core/common_runtime/gpu/gpu_managed_allocator.cc index aad42df5f1f..d0f68987a5c 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_managed_allocator.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_managed_allocator.cc @@ -14,7 +14,7 @@ limitations under the License. ==============================================================================*/ #ifdef GOOGLE_CUDA -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda.h" #define EIGEN_USE_GPU #endif diff --git a/tensorflow/core/common_runtime/process_function_library_runtime_test.cc b/tensorflow/core/common_runtime/process_function_library_runtime_test.cc index a73cb5a9f53..df10ca0d587 100644 --- a/tensorflow/core/common_runtime/process_function_library_runtime_test.cc +++ b/tensorflow/core/common_runtime/process_function_library_runtime_test.cc @@ -34,8 +34,8 @@ limitations under the License. #include "tensorflow/core/public/version.h" #ifdef GOOGLE_CUDA -#include "cuda/include/cuda.h" -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" #endif // GOOGLE_CUDA namespace tensorflow { diff --git a/tensorflow/core/grappler/clusters/utils.cc b/tensorflow/core/grappler/clusters/utils.cc index f1d3a77e3f0..f7af7cc374f 100644 --- a/tensorflow/core/grappler/clusters/utils.cc +++ b/tensorflow/core/grappler/clusters/utils.cc @@ -18,9 +18,9 @@ limitations under the License. #include "third_party/eigen3/Eigen/Core" #if GOOGLE_CUDA -#include "cuda/include/cuda.h" -#include "cuda/include/cuda_runtime_api.h" -#include "cuda/include/cudnn.h" +#include "third_party/gpus/cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cudnn/cudnn.h" #endif #if TENSORFLOW_USE_ROCM diff --git a/tensorflow/core/grappler/optimizers/auto_mixed_precision_lists.h b/tensorflow/core/grappler/optimizers/auto_mixed_precision_lists.h index dce8914026b..862401ba6ac 100644 --- a/tensorflow/core/grappler/optimizers/auto_mixed_precision_lists.h +++ b/tensorflow/core/grappler/optimizers/auto_mixed_precision_lists.h @@ -22,7 +22,7 @@ limitations under the License. #if GOOGLE_CUDA // Needed for CUDA_VERSION macro. -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda.h" #endif // GOOGLE_CUDA namespace tensorflow { diff --git a/tensorflow/core/kernels/batch_matmul_op_real.cc b/tensorflow/core/kernels/batch_matmul_op_real.cc index 7bc43be66b3..2806e692d87 100644 --- a/tensorflow/core/kernels/batch_matmul_op_real.cc +++ b/tensorflow/core/kernels/batch_matmul_op_real.cc @@ -16,7 +16,7 @@ limitations under the License. #include "tensorflow/core/kernels/batch_matmul_op_impl.h" #if GOOGLE_CUDA -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda.h" #endif // GOOGLE_CUDA namespace tensorflow { diff --git a/tensorflow/core/kernels/conv_2d_gpu.h b/tensorflow/core/kernels/conv_2d_gpu.h index 820a92b0f09..4e1aff9a186 100644 --- a/tensorflow/core/kernels/conv_2d_gpu.h +++ b/tensorflow/core/kernels/conv_2d_gpu.h @@ -25,7 +25,7 @@ limitations under the License. #include #include -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/kernels/conv_2d.h" #include "tensorflow/core/lib/math/math_util.h" diff --git a/tensorflow/core/kernels/conv_ops_fused_impl.h b/tensorflow/core/kernels/conv_ops_fused_impl.h index 89e4e61c26f..ad8f9a4ad88 100644 --- a/tensorflow/core/kernels/conv_ops_fused_impl.h +++ b/tensorflow/core/kernels/conv_ops_fused_impl.h @@ -57,7 +57,7 @@ limitations under the License. #include "tensorflow/core/util/use_cudnn.h" #if GOOGLE_CUDA -#include "cuda/include/cudnn.h" +#include "third_party/gpus/cudnn/cudnn.h" #include "tensorflow/core/kernels/conv_ops_gpu.h" #include "tensorflow/core/platform/stream_executor.h" #include "tensorflow/core/util/proto/proto_utils.h" diff --git a/tensorflow/core/kernels/cuda_solvers.cc b/tensorflow/core/kernels/cuda_solvers.cc index 82d92388d40..6e26cc1d541 100644 --- a/tensorflow/core/kernels/cuda_solvers.cc +++ b/tensorflow/core/kernels/cuda_solvers.cc @@ -21,8 +21,8 @@ #include #include -#include "cuda/include/cublas_v2.h" -#include "cuda/include/cusolverDn.h" +#include "third_party/gpus/cuda/include/cublas_v2.h" +#include "third_party/gpus/cuda/include/cusolverDn.h" #include "tensorflow/core/common_runtime/gpu/gpu_event_mgr.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/types.h" diff --git a/tensorflow/core/kernels/cuda_solvers.h b/tensorflow/core/kernels/cuda_solvers.h index fa8b4e24155..5b6d6891e29 100644 --- a/tensorflow/core/kernels/cuda_solvers.h +++ b/tensorflow/core/kernels/cuda_solvers.h @@ -26,8 +26,8 @@ limitations under the License. #include #include -#include "cuda/include/cublas_v2.h" -#include "cuda/include/cusolverDn.h" +#include "third_party/gpus/cuda/include/cublas_v2.h" +#include "third_party/gpus/cuda/include/cusolverDn.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/lib/core/status.h" diff --git a/tensorflow/core/kernels/cuda_sparse.cc b/tensorflow/core/kernels/cuda_sparse.cc index 51a4d9cfc9b..3cdf50f896b 100644 --- a/tensorflow/core/kernels/cuda_sparse.cc +++ b/tensorflow/core/kernels/cuda_sparse.cc @@ -22,7 +22,7 @@ #include #include -#include "cuda/include/cusparse.h" +#include "third_party/gpus/cuda/include/cusparse.h" #include "tensorflow/core/common_runtime/gpu/gpu_event_mgr.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/types.h" diff --git a/tensorflow/core/kernels/cuda_sparse.h b/tensorflow/core/kernels/cuda_sparse.h index e7c97082177..51ebd6832aa 100644 --- a/tensorflow/core/kernels/cuda_sparse.h +++ b/tensorflow/core/kernels/cuda_sparse.h @@ -25,7 +25,7 @@ limitations under the License. #include #include -#include "cuda/include/cusparse.h" +#include "third_party/gpus/cuda/include/cusparse.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/framework/tensor_types.h" diff --git a/tensorflow/core/kernels/depthwise_conv_grad_op.cc b/tensorflow/core/kernels/depthwise_conv_grad_op.cc index ab98cacd1a1..b29e8323332 100644 --- a/tensorflow/core/kernels/depthwise_conv_grad_op.cc +++ b/tensorflow/core/kernels/depthwise_conv_grad_op.cc @@ -38,7 +38,7 @@ limitations under the License. #include "tensorflow/core/util/work_sharder.h" #if GOOGLE_CUDA -#include "cuda/include/cudnn.h" +#include "third_party/gpus/cudnn/cudnn.h" #include "tensorflow/core/platform/stream_executor.h" #endif // GOOGLE_CUDA diff --git a/tensorflow/core/kernels/depthwise_conv_op.cc b/tensorflow/core/kernels/depthwise_conv_op.cc index 11c2b31633d..ceaeaac21de 100644 --- a/tensorflow/core/kernels/depthwise_conv_op.cc +++ b/tensorflow/core/kernels/depthwise_conv_op.cc @@ -39,7 +39,7 @@ limitations under the License. #include "tensorflow/core/util/work_sharder.h" #if GOOGLE_CUDA -#include "cuda/include/cudnn.h" +#include "third_party/gpus/cudnn/cudnn.h" #include "tensorflow/core/platform/stream_executor.h" #endif // GOOGLE_CUDA diff --git a/tensorflow/core/kernels/fused_batch_norm_op.cu.cc b/tensorflow/core/kernels/fused_batch_norm_op.cu.cc index 5a6587ef4ea..7b630e7995b 100644 --- a/tensorflow/core/kernels/fused_batch_norm_op.cu.cc +++ b/tensorflow/core/kernels/fused_batch_norm_op.cu.cc @@ -15,7 +15,7 @@ limitations under the License. #if GOOGLE_CUDA #define EIGEN_USE_GPU -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda.h" #include "tensorflow/core/kernels/fused_batch_norm_op.h" #include "tensorflow/core/util/gpu_kernel_helper.h" diff --git a/tensorflow/core/kernels/lrn_op.cc b/tensorflow/core/kernels/lrn_op.cc index ba30432e21a..a5757e433d0 100644 --- a/tensorflow/core/kernels/lrn_op.cc +++ b/tensorflow/core/kernels/lrn_op.cc @@ -35,7 +35,7 @@ limitations under the License. #endif #if GOOGLE_CUDA -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda.h" #include "tensorflow/core/platform/stream_executor.h" #include "tensorflow/core/util/stream_executor_util.h" #endif // GOOGLE_CUDA diff --git a/tensorflow/core/kernels/matmul_op.cc b/tensorflow/core/kernels/matmul_op.cc index 941cafe0bcb..a6b8be95b90 100644 --- a/tensorflow/core/kernels/matmul_op.cc +++ b/tensorflow/core/kernels/matmul_op.cc @@ -25,7 +25,7 @@ limitations under the License. #include "tensorflow/core/kernels/fill_functor.h" #include "tensorflow/core/util/matmul_autotune.h" #if GOOGLE_CUDA -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda.h" #include "tensorflow/core/kernels/gpu_utils.h" #include "tensorflow/core/platform/stream_executor.h" #endif // GOOGLE_CUDA diff --git a/tensorflow/core/kernels/maxpooling_op.cc b/tensorflow/core/kernels/maxpooling_op.cc index fcca2f718d8..a3592d8ec3c 100644 --- a/tensorflow/core/kernels/maxpooling_op.cc +++ b/tensorflow/core/kernels/maxpooling_op.cc @@ -41,7 +41,7 @@ limitations under the License. #include "tensorflow/core/util/use_cudnn.h" #if GOOGLE_CUDA -#include "cuda/include/cudnn.h" +#include "third_party/gpus/cudnn/cudnn.h" #include "tensorflow/core/kernels/maxpooling_op_gpu.h" #include "tensorflow/core/kernels/pooling_ops_common_gpu.h" #include "tensorflow/core/platform/stream_executor.h" diff --git a/tensorflow/core/kernels/pooling_ops_common.cc b/tensorflow/core/kernels/pooling_ops_common.cc index 903cf9313a2..01a353cb175 100644 --- a/tensorflow/core/kernels/pooling_ops_common.cc +++ b/tensorflow/core/kernels/pooling_ops_common.cc @@ -21,7 +21,7 @@ limitations under the License. #include "tensorflow/core/framework/tensor.h" #if GOOGLE_CUDA -#include "cuda/include/cudnn.h" +#include "third_party/gpus/cudnn/cudnn.h" #include "tensorflow/core/kernels/conv_2d.h" #include "tensorflow/core/kernels/pooling_ops_common_gpu.h" #include "tensorflow/core/platform/stream_executor.h" diff --git a/tensorflow/core/kernels/reduction_gpu_kernels.cu.h b/tensorflow/core/kernels/reduction_gpu_kernels.cu.h index b7d87b2445d..a2614bfc63c 100644 --- a/tensorflow/core/kernels/reduction_gpu_kernels.cu.h +++ b/tensorflow/core/kernels/reduction_gpu_kernels.cu.h @@ -28,7 +28,7 @@ limitations under the License. #include "third_party/cub/iterator/counting_input_iterator.cuh" #include "third_party/cub/iterator/transform_input_iterator.cuh" #include "third_party/cub/warp/warp_reduce.cuh" -#include "cuda/include/cuComplex.h" +#include "third_party/gpus/cuda/include/cuComplex.h" #include "tensorflow/core/kernels/reduction_ops.h" #include "tensorflow/core/lib/core/bits.h" #include "tensorflow/core/util/gpu_device_functions.h" diff --git a/tensorflow/core/kernels/scan_ops_gpu.h b/tensorflow/core/kernels/scan_ops_gpu.h index c23d31e2b30..331aeca6a77 100644 --- a/tensorflow/core/kernels/scan_ops_gpu.h +++ b/tensorflow/core/kernels/scan_ops_gpu.h @@ -29,7 +29,7 @@ limitations under the License. #include "third_party/cub/block/block_store.cuh" #include "third_party/cub/iterator/counting_input_iterator.cuh" #include "third_party/cub/iterator/transform_input_iterator.cuh" -#include "cuda/include/cuComplex.h" +#include "third_party/gpus/cuda/include/cuComplex.h" #include "tensorflow/core/framework/numeric_types.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/kernels/scan_ops.h" diff --git a/tensorflow/core/platform/default/cuda_libdevice_path.cc b/tensorflow/core/platform/default/cuda_libdevice_path.cc index a8b2e7202ac..25eb6ab463b 100644 --- a/tensorflow/core/platform/default/cuda_libdevice_path.cc +++ b/tensorflow/core/platform/default/cuda_libdevice_path.cc @@ -19,7 +19,7 @@ limitations under the License. #include #if !defined(PLATFORM_GOOGLE) -#include "cuda/cuda_config.h" +#include "third_party/gpus/cuda/cuda_config.h" #endif #include "tensorflow/core/platform/logging.h" diff --git a/tensorflow/core/platform/default/device_tracer.cc b/tensorflow/core/platform/default/device_tracer.cc index 2f13f127116..38cdb65c566 100644 --- a/tensorflow/core/platform/default/device_tracer.cc +++ b/tensorflow/core/platform/default/device_tracer.cc @@ -25,7 +25,7 @@ limitations under the License. #include "absl/strings/ascii.h" #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" -#include "cuda/extras/CUPTI/include/cupti.h" +#include "third_party/gpus/cuda/extras/CUPTI/include/cupti.h" #include "tensorflow/core/common_runtime/step_stats_collector.h" #include "tensorflow/core/framework/step_stats.pb.h" #include "tensorflow/core/lib/core/errors.h" diff --git a/tensorflow/core/util/gpu_device_functions.h b/tensorflow/core/util/gpu_device_functions.h index 7e8742b6a15..049d6e00b86 100644 --- a/tensorflow/core/util/gpu_device_functions.h +++ b/tensorflow/core/util/gpu_device_functions.h @@ -31,8 +31,8 @@ limitations under the License. #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #if GOOGLE_CUDA -#include "cuda/include/cuComplex.h" -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuComplex.h" +#include "third_party/gpus/cuda/include/cuda.h" #endif #include "tensorflow/core/platform/types.h" diff --git a/tensorflow/core/util/gpu_kernel_helper.h b/tensorflow/core/util/gpu_kernel_helper.h index b3c2f21b392..9701b266cf7 100644 --- a/tensorflow/core/util/gpu_kernel_helper.h +++ b/tensorflow/core/util/gpu_kernel_helper.h @@ -19,7 +19,7 @@ limitations under the License. #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if GOOGLE_CUDA -#include "cuda/include/cuda_fp16.h" +#include "third_party/gpus/cuda/include/cuda_fp16.h" #endif #include "tensorflow/core/util/gpu_device_functions.h" #include "tensorflow/core/util/gpu_launch_config.h" diff --git a/tensorflow/stream_executor/cuda/cublas_stub.cc b/tensorflow/stream_executor/cuda/cublas_stub.cc index beca8c1a46f..b8e203fe235 100644 --- a/tensorflow/stream_executor/cuda/cublas_stub.cc +++ b/tensorflow/stream_executor/cuda/cublas_stub.cc @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "cuda/include/cublas.h" -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cublas.h" +#include "third_party/gpus/cuda/include/cuda.h" #include "tensorflow/stream_executor/lib/env.h" #include "tensorflow/stream_executor/platform/dso_loader.h" diff --git a/tensorflow/stream_executor/cuda/cuda_blas.cc b/tensorflow/stream_executor/cuda/cuda_blas.cc index 661d84512a2..421b9b4ce42 100644 --- a/tensorflow/stream_executor/cuda/cuda_blas.cc +++ b/tensorflow/stream_executor/cuda/cuda_blas.cc @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "cuda/include/cublas_v2.h" -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cublas_v2.h" +#include "third_party/gpus/cuda/include/cuda.h" #define SE_CUDA_DATA_HALF CUDA_R_16F @@ -40,7 +40,7 @@ limitations under the License. // TODO(b/73793421): Remove the following code block to switch to the second // approach when the issue is fixed. #if CUDA_VERSION < 9000 -#include "cuda/include/cuda_fp16.h" +#include "third_party/gpus/cuda/include/cuda_fp16.h" #define EIGEN_HAS_CUDA_FP16 #endif diff --git a/tensorflow/stream_executor/cuda/cuda_dnn.cc b/tensorflow/stream_executor/cuda/cuda_dnn.cc index 12da285bb6a..8fc0549b01b 100644 --- a/tensorflow/stream_executor/cuda/cuda_dnn.cc +++ b/tensorflow/stream_executor/cuda/cuda_dnn.cc @@ -43,7 +43,7 @@ limitations under the License. #include "tensorflow/stream_executor/stream.h" #include "tensorflow/stream_executor/stream_executor_pimpl.h" // clang-format off -#include "cuda/include/cudnn.h" +#include "third_party/gpus/cudnn/cudnn.h" #include "absl/strings/string_view.h" // clang-format on diff --git a/tensorflow/stream_executor/cuda/cuda_driver.cc b/tensorflow/stream_executor/cuda/cuda_driver.cc index f41f64f6aaa..91b5014339c 100644 --- a/tensorflow/stream_executor/cuda/cuda_driver.cc +++ b/tensorflow/stream_executor/cuda/cuda_driver.cc @@ -31,7 +31,7 @@ limitations under the License. #include "absl/strings/str_format.h" #include "absl/synchronization/mutex.h" #include "absl/synchronization/notification.h" -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" #include "tensorflow/stream_executor/cuda/cuda_diagnostics.h" #include "tensorflow/stream_executor/lib/env.h" #include "tensorflow/stream_executor/lib/error.h" diff --git a/tensorflow/stream_executor/cuda/cuda_fft.h b/tensorflow/stream_executor/cuda/cuda_fft.h index 0f3baeab6fa..e7b0d66cb13 100644 --- a/tensorflow/stream_executor/cuda/cuda_fft.h +++ b/tensorflow/stream_executor/cuda/cuda_fft.h @@ -20,7 +20,7 @@ limitations under the License. #ifndef TENSORFLOW_STREAM_EXECUTOR_CUDA_CUDA_FFT_H_ #define TENSORFLOW_STREAM_EXECUTOR_CUDA_CUDA_FFT_H_ -#include "cuda/include/cufft.h" +#include "third_party/gpus/cuda/include/cufft.h" #include "tensorflow/stream_executor/fft.h" #include "tensorflow/stream_executor/platform/port.h" #include "tensorflow/stream_executor/plugin_registry.h" diff --git a/tensorflow/stream_executor/cuda/cuda_rng.cc b/tensorflow/stream_executor/cuda/cuda_rng.cc index b86c3122fb1..23f22bae9a1 100644 --- a/tensorflow/stream_executor/cuda/cuda_rng.cc +++ b/tensorflow/stream_executor/cuda/cuda_rng.cc @@ -27,7 +27,7 @@ limitations under the License. #include "tensorflow/stream_executor/platform/logging.h" #include "tensorflow/stream_executor/rng.h" // clang-format off -#include "cuda/include/curand.h" +#include "third_party/gpus/cuda/include/curand.h" // clang-format on // Formats curandStatus_t to output prettified values into a log stream. diff --git a/tensorflow/stream_executor/cuda/cuda_stub.cc b/tensorflow/stream_executor/cuda/cuda_stub.cc index 1219e7d98bc..3248c9ddefd 100644 --- a/tensorflow/stream_executor/cuda/cuda_stub.cc +++ b/tensorflow/stream_executor/cuda/cuda_stub.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda.h" #include "tensorflow/stream_executor/lib/env.h" #include "tensorflow/stream_executor/platform/dso_loader.h" diff --git a/tensorflow/stream_executor/cuda/cudart_stub.cc b/tensorflow/stream_executor/cuda/cudart_stub.cc index 660cf8cd27b..acdf34e373f 100644 --- a/tensorflow/stream_executor/cuda/cudart_stub.cc +++ b/tensorflow/stream_executor/cuda/cudart_stub.cc @@ -16,7 +16,7 @@ limitations under the License. // This file wraps cuda runtime calls with dso loader so that we don't need to // have explicit linking to libcuda. -#include "cuda/include/cuda_runtime_api.h" +#include "third_party/gpus/cuda/include/cuda_runtime_api.h" #include "tensorflow/stream_executor/lib/env.h" #include "tensorflow/stream_executor/platform/dso_loader.h" diff --git a/tensorflow/stream_executor/cuda/cudnn_stub.cc b/tensorflow/stream_executor/cuda/cudnn_stub.cc index 2727c215e8c..3b567c15c6c 100644 --- a/tensorflow/stream_executor/cuda/cudnn_stub.cc +++ b/tensorflow/stream_executor/cuda/cudnn_stub.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "cuda/include/cudnn.h" +#include "third_party/gpus/cudnn/cudnn.h" #include "tensorflow/stream_executor/lib/env.h" #include "tensorflow/stream_executor/platform/dso_loader.h" diff --git a/tensorflow/stream_executor/cuda/cufft_stub.cc b/tensorflow/stream_executor/cuda/cufft_stub.cc index c15d98730eb..68d7ec7634d 100644 --- a/tensorflow/stream_executor/cuda/cufft_stub.cc +++ b/tensorflow/stream_executor/cuda/cufft_stub.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "cuda/include/cufft.h" +#include "third_party/gpus/cuda/include/cufft.h" #include "tensorflow/stream_executor/lib/env.h" #include "tensorflow/stream_executor/platform/dso_loader.h" diff --git a/tensorflow/stream_executor/cuda/cupti_stub.cc b/tensorflow/stream_executor/cuda/cupti_stub.cc index ef883f9bf98..0c7dd2e75f0 100644 --- a/tensorflow/stream_executor/cuda/cupti_stub.cc +++ b/tensorflow/stream_executor/cuda/cupti_stub.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "cuda/extras/CUPTI/include/cupti.h" +#include "third_party/gpus/cuda/extras/CUPTI/include/cupti.h" // IWYU pragma: no_include "perftools/gputools/executor/stream_executor.h" #include "tensorflow/stream_executor/lib/env.h" #include "tensorflow/stream_executor/platform/dso_loader.h" diff --git a/tensorflow/stream_executor/cuda/curand_stub.cc b/tensorflow/stream_executor/cuda/curand_stub.cc index dd70384d643..96eeee0fc9d 100644 --- a/tensorflow/stream_executor/cuda/curand_stub.cc +++ b/tensorflow/stream_executor/cuda/curand_stub.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "cuda/include/curand.h" +#include "third_party/gpus/cuda/include/curand.h" #include "tensorflow/stream_executor/lib/env.h" #include "tensorflow/stream_executor/platform/dso_loader.h" diff --git a/tensorflow/stream_executor/cuda/cusolver_stub.cc b/tensorflow/stream_executor/cuda/cusolver_stub.cc index 664d10dcc64..f8d3df98e7e 100644 --- a/tensorflow/stream_executor/cuda/cusolver_stub.cc +++ b/tensorflow/stream_executor/cuda/cusolver_stub.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "cuda/include/cusolverDn.h" +#include "third_party/gpus/cuda/include/cusolverDn.h" #include "tensorflow/stream_executor/lib/env.h" #include "tensorflow/stream_executor/platform/dso_loader.h" diff --git a/tensorflow/stream_executor/cuda/cusparse_stub.cc b/tensorflow/stream_executor/cuda/cusparse_stub.cc index 20ea7a7a85c..439de5eb83a 100644 --- a/tensorflow/stream_executor/cuda/cusparse_stub.cc +++ b/tensorflow/stream_executor/cuda/cusparse_stub.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "cuda/include/cusparse.h" +#include "third_party/gpus/cuda/include/cusparse.h" #include "tensorflow/stream_executor/lib/env.h" #include "tensorflow/stream_executor/platform/dso_loader.h" diff --git a/tensorflow/stream_executor/gpu/gpu_driver.h b/tensorflow/stream_executor/gpu/gpu_driver.h index 73cc24f86fc..07b35192f03 100644 --- a/tensorflow/stream_executor/gpu/gpu_driver.h +++ b/tensorflow/stream_executor/gpu/gpu_driver.h @@ -21,7 +21,7 @@ limitations under the License. #include #include "tensorflow/stream_executor/platform/port.h" -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuda.h" #include "tensorflow/stream_executor/device_options.h" #include "tensorflow/stream_executor/lib/status.h" #include "tensorflow/stream_executor/lib/statusor.h" diff --git a/tensorflow/stream_executor/gpu/gpu_types.h b/tensorflow/stream_executor/gpu/gpu_types.h index 64a6e5e5efc..c48a4228b7a 100644 --- a/tensorflow/stream_executor/gpu/gpu_types.h +++ b/tensorflow/stream_executor/gpu/gpu_types.h @@ -28,8 +28,8 @@ limitations under the License. #else // CUDA -#include "cuda/include/cuComplex.h" -#include "cuda/include/cuda.h" +#include "third_party/gpus/cuda/include/cuComplex.h" +#include "third_party/gpus/cuda/include/cuda.h" // cannot include curand.h here // because it triggers the #error in cuda/cuda_gpu_executor.cc diff --git a/tensorflow/stream_executor/platform/default/dso_loader.cc b/tensorflow/stream_executor/platform/default/dso_loader.cc index 80d71e25d48..9ceaa296dcb 100644 --- a/tensorflow/stream_executor/platform/default/dso_loader.cc +++ b/tensorflow/stream_executor/platform/default/dso_loader.cc @@ -18,7 +18,7 @@ limitations under the License. #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "cuda/cuda_config.h" +#include "third_party/gpus/cuda/cuda_config.h" #include "tensorflow/stream_executor/lib/env.h" #include "tensorflow/stream_executor/lib/error.h" #include "tensorflow/stream_executor/lib/path.h" diff --git a/third_party/gpus/cuda/BUILD.tpl b/third_party/gpus/cuda/BUILD.tpl index 3e404d5dff7..95e4cb82b8f 100644 --- a/third_party/gpus/cuda/BUILD.tpl +++ b/third_party/gpus/cuda/BUILD.tpl @@ -28,36 +28,37 @@ config_setting( config_setting( name = "darwin", values = {"cpu": "darwin"}, - visibility = ["//visibility:public"], ) config_setting( name = "freebsd", values = {"cpu": "freebsd"}, - visibility = ["//visibility:public"], ) +# Provides CUDA headers for '#include "third_party/gpus/cuda/include/cuda.h"' +# All clients including TensorFlow should use these directives. cc_library( - name = "cuda_headers", + name = "cuda_virtual_headers", hdrs = [ "cuda/cuda_config.h", - %{cuda_headers} + ":cuda-include" ], - includes = [ - ".", - "cuda/include", - "cuda/include/crt", - ], - visibility = ["//visibility:public"], + include_prefix = "third_party/gpus", + visibility = ["//visibility:private"], +) + +# Provides CUDA headers for '#include '. +# CUDA itself as well as Eigen use these directives. +cc_library( + name = "cuda_headers", + textual_hdrs = [":cuda-include"], + includes = ["cuda/include"], + deps = [":cuda_virtual_headers"], ) cc_library( name = "cudart_static", srcs = ["cuda/lib/%{cudart_static_lib}"], - includes = [ - ".", - "cuda/include", - ], linkopts = select({ ":freebsd": [], "//conditions:default": ["-ldl"], @@ -65,104 +66,82 @@ cc_library( "-lpthread", %{cudart_static_linkopt} ], - visibility = ["//visibility:public"], ) cc_library( name = "cuda_driver", srcs = ["cuda/lib/%{cuda_driver_lib}"], - includes = [ - ".", - "cuda/include", - ], - visibility = ["//visibility:public"], ) cc_library( name = "cudart", srcs = ["cuda/lib/%{cudart_lib}"], data = ["cuda/lib/%{cudart_lib}"], - includes = [ - ".", - "cuda/include", - ], linkstatic = 1, - visibility = ["//visibility:public"], +) + +cc_library( + name = "cublas_virtual_headers", + hdrs = [":cublas-include"], + include_prefix = "third_party/gpus/cuda/include", + strip_include_prefix = "cublas/include", + visibility = ["//visibility:private"], + deps = [":cuda_headers"], +) + +cc_library( + name = "cublas_headers", + textual_hdrs = [":cublas-include"], + includes = ["cublas/include"], + deps = [":cublas_virtual_headers"], ) cc_library( name = "cublas", srcs = ["cuda/lib/%{cublas_lib}"], data = ["cuda/lib/%{cublas_lib}"], - includes = [ - ".", - "cuda/include", - ], linkstatic = 1, - visibility = ["//visibility:public"], ) cc_library( name = "cusolver", srcs = ["cuda/lib/%{cusolver_lib}"], data = ["cuda/lib/%{cusolver_lib}"], - includes = [ - ".", - "cuda/include", - ], linkopts = ["-lgomp"], linkstatic = 1, - visibility = ["//visibility:public"], ) cc_library( name = "cudnn", srcs = ["cuda/lib/%{cudnn_lib}"], data = ["cuda/lib/%{cudnn_lib}"], - includes = [ - ".", - "cuda/include", - ], linkstatic = 1, - visibility = ["//visibility:public"], ) cc_library( name = "cudnn_header", - includes = [ - ".", - "cuda/include", - ], - visibility = ["//visibility:public"], + hdrs = [":cudnn-include"], + include_prefix = "third_party/gpus/cudnn", + strip_include_prefix = "cudnn/include", + deps = [":cuda_headers"], ) cc_library( name = "cufft", srcs = ["cuda/lib/%{cufft_lib}"], data = ["cuda/lib/%{cufft_lib}"], - includes = [ - ".", - "cuda/include", - ], linkstatic = 1, - visibility = ["//visibility:public"], ) cc_library( name = "curand", srcs = ["cuda/lib/%{curand_lib}"], data = ["cuda/lib/%{curand_lib}"], - includes = [ - ".", - "cuda/include", - ], linkstatic = 1, - visibility = ["//visibility:public"], ) cc_library( name = "cuda", - visibility = ["//visibility:public"], deps = [ ":cublas", ":cuda_headers", @@ -173,46 +152,37 @@ cc_library( ], ) +cc_library( + name = "cupti_virtual_headers", + hdrs = [":cuda-extras"], + include_prefix="third_party/gpus", + visibility = ["//visibility:private"], + deps = [":cuda_headers"], +) + cc_library( name = "cupti_headers", - hdrs = [ - "cuda/cuda_config.h", - ":cuda-extras", - ], - includes = [ - ".", - "cuda/extras/CUPTI/include/", - ], - visibility = ["//visibility:public"], + textual_hdrs = [":cuda-extras"], + includes = ["cuda/extras/CUPTI/include/"], + deps = [":cupti_virtual_headers"], ) cc_library( name = "cupti_dsos", data = ["cuda/lib/%{cupti_lib}"], - includes = [ - ".", - "cuda/include", - ], - visibility = ["//visibility:public"], ) cc_library( name = "cusparse", srcs = ["cuda/lib/%{cusparse_lib}"], data = ["cuda/lib/%{cusparse_lib}"], - includes = [ - ".", - "cuda/include", - ], linkopts = ["-lgomp"], linkstatic = 1, - visibility = ["//visibility:public"], ) cc_library( name = "libdevice_root", data = [":cuda-nvvm"], - visibility = ["//visibility:public"], ) %{copy_rules} diff --git a/third_party/gpus/cuda_configure.bzl b/third_party/gpus/cuda_configure.bzl index b2e3f669d76..f08cca6ebb6 100644 --- a/third_party/gpus/cuda_configure.bzl +++ b/third_party/gpus/cuda_configure.bzl @@ -784,8 +784,11 @@ def _create_dummy_repository(repository_ctx): "%{curand_lib}": lib_name("curand", cpu_value), "%{cupti_lib}": lib_name("cupti", cpu_value), "%{cusparse_lib}": lib_name("cusparse", cpu_value), - "%{copy_rules}": "", - "%{cuda_headers}": "", + "%{copy_rules}": """ +filegroup(name="cuda-include") +filegroup(name="cublas-include") +filegroup(name="cudnn-include") +""", }, ) @@ -983,25 +986,21 @@ def _create_local_cuda_repository(repository_ctx): out_dir = "cuda/extras/CUPTI/include", ), ] - included_files = _read_dir(repository_ctx, cuda_include_path) - if not any([file.endswith("cublas.h") for file in included_files]): - copy_rules.append(make_copy_files_rule( - repository_ctx, - name = "cublas-include", - srcs = [ - cublas_include_path + "/cublas.h", - cublas_include_path + "/cublas_v2.h", - cublas_include_path + "/cublas_api.h", - ], - outs = [ - "cuda/include/cublas.h", - "cuda/include/cublas_v2.h", - "cuda/include/cublas_api.h", - ], - )) - else: - copy_rules.append("filegroup(name = 'cublas-include')\n") + copy_rules.append(make_copy_files_rule( + repository_ctx, + name = "cublas-include", + srcs = [ + cublas_include_path + "/cublas.h", + cublas_include_path + "/cublas_v2.h", + cublas_include_path + "/cublas_api.h", + ], + outs = [ + "cublas/include/cublas.h", + "cublas/include/cublas_v2.h", + "cublas/include/cublas_api.h", + ], + )) cuda_libs = _find_libs(repository_ctx, cuda_config) cuda_lib_srcs = [] @@ -1023,16 +1022,12 @@ def _create_local_cuda_repository(repository_ctx): out_dir = "cuda/bin", )) - # Copy cudnn.h if cuDNN was not installed to CUDA_TOOLKIT_PATH. - if not any([file.endswith("cudnn.h") for file in included_files]): - copy_rules.append(make_copy_files_rule( - repository_ctx, - name = "cudnn-include", - srcs = [cudnn_header_dir + "/cudnn.h"], - outs = ["cuda/include/cudnn.h"], - )) - else: - copy_rules.append("filegroup(name = 'cudnn-include')\n") + copy_rules.append(make_copy_files_rule( + repository_ctx, + name = "cudnn-include", + srcs = [cudnn_header_dir + "/cudnn.h"], + outs = ["cudnn/include/cudnn.h"], + )) # Set up BUILD file for cuda/ _tpl( @@ -1062,11 +1057,6 @@ def _create_local_cuda_repository(repository_ctx): "%{cupti_lib}": cuda_libs["cupti"].basename, "%{cusparse_lib}": cuda_libs["cusparse"].basename, "%{copy_rules}": "\n".join(copy_rules), - "%{cuda_headers}": ( - '":cuda-include",\n' + - ' ":cublas-include",' + - ' ":cudnn-include",' - ), }, "cuda/BUILD", ) diff --git a/third_party/toolchains/preconfig/ubuntu14.04/cuda10.0-cudnn7/cuda/BUILD b/third_party/toolchains/preconfig/ubuntu14.04/cuda10.0-cudnn7/cuda/BUILD index 960a38fc055..d6bbb5ab0a2 100755 --- a/third_party/toolchains/preconfig/ubuntu14.04/cuda10.0-cudnn7/cuda/BUILD +++ b/third_party/toolchains/preconfig/ubuntu14.04/cuda10.0-cudnn7/cuda/BUILD @@ -28,37 +28,37 @@ config_setting( config_setting( name = "darwin", values = {"cpu": "darwin"}, - visibility = ["//visibility:public"], ) config_setting( name = "freebsd", values = {"cpu": "freebsd"}, - visibility = ["//visibility:public"], ) +# Provides CUDA headers for '#include "third_party/gpus/cuda/include/cuda.h"' +# All clients including TensorFlow should use these directives. cc_library( - name = "cuda_headers", + name = "cuda_virtual_headers", hdrs = [ "cuda/cuda_config.h", ":cuda-include", - ":cudnn-include", ], - includes = [ - ".", - "cuda/include", - "cuda/include/crt", - ], - visibility = ["//visibility:public"], + include_prefix = "third_party/gpus", + visibility = ["//visibility:private"], +) + +# Provides CUDA headers for '#include '. +# CUDA itself as well as Eigen use these directives. +cc_library( + name = "cuda_headers", + includes = ["cuda/include"], + textual_hdrs = [":cuda-include"], + deps = [":cuda_virtual_headers"], ) cc_library( name = "cudart_static", srcs = ["cuda/lib/libcudart_static.a"], - includes = [ - ".", - "cuda/include", - ], linkopts = select({ ":freebsd": [], "//conditions:default": ["-ldl"], @@ -66,104 +66,82 @@ cc_library( "-lpthread", "-lrt", ], - visibility = ["//visibility:public"], ) cc_library( name = "cuda_driver", srcs = ["cuda/lib/libcuda.so"], - includes = [ - ".", - "cuda/include", - ], - visibility = ["//visibility:public"], ) cc_library( name = "cudart", srcs = ["cuda/lib/libcudart.so.10.0"], data = ["cuda/lib/libcudart.so.10.0"], - includes = [ - ".", - "cuda/include", - ], linkstatic = 1, - visibility = ["//visibility:public"], +) + +cc_library( + name = "cublas_virtual_headers", + hdrs = [":cublas-include"], + include_prefix = "third_party/gpus/cuda/include", + strip_include_prefix = "cublas/include", + visibility = ["//visibility:private"], + deps = [":cuda_headers"], +) + +cc_library( + name = "cublas_headers", + includes = ["cublas/include"], + textual_hdrs = [":cublas-include"], + deps = [":cublas_virtual_headers"], ) cc_library( name = "cublas", srcs = ["cuda/lib/libcublas.so.10.0"], data = ["cuda/lib/libcublas.so.10.0"], - includes = [ - ".", - "cuda/include", - ], linkstatic = 1, - visibility = ["//visibility:public"], ) cc_library( name = "cusolver", srcs = ["cuda/lib/libcusolver.so.10.0"], data = ["cuda/lib/libcusolver.so.10.0"], - includes = [ - ".", - "cuda/include", - ], linkopts = ["-lgomp"], linkstatic = 1, - visibility = ["//visibility:public"], ) cc_library( name = "cudnn", srcs = ["cuda/lib/libcudnn.so.7"], data = ["cuda/lib/libcudnn.so.7"], - includes = [ - ".", - "cuda/include", - ], linkstatic = 1, - visibility = ["//visibility:public"], ) cc_library( name = "cudnn_header", - includes = [ - ".", - "cuda/include", - ], - visibility = ["//visibility:public"], + hdrs = [":cudnn-include"], + include_prefix = "third_party/gpus/cudnn", + strip_include_prefix = "cudnn/include", + deps = [":cuda_headers"], ) cc_library( name = "cufft", srcs = ["cuda/lib/libcufft.so.10.0"], data = ["cuda/lib/libcufft.so.10.0"], - includes = [ - ".", - "cuda/include", - ], linkstatic = 1, - visibility = ["//visibility:public"], ) cc_library( name = "curand", srcs = ["cuda/lib/libcurand.so.10.0"], data = ["cuda/lib/libcurand.so.10.0"], - includes = [ - ".", - "cuda/include", - ], linkstatic = 1, - visibility = ["//visibility:public"], ) cc_library( name = "cuda", - visibility = ["//visibility:public"], deps = [ ":cublas", ":cuda_headers", @@ -174,46 +152,37 @@ cc_library( ], ) +cc_library( + name = "cupti_virtual_headers", + hdrs = [":cuda-extras"], + include_prefix = "third_party/gpus", + visibility = ["//visibility:private"], + deps = [":cuda_headers"], +) + cc_library( name = "cupti_headers", - hdrs = [ - "cuda/cuda_config.h", - ":cuda-extras", - ], - includes = [ - ".", - "cuda/extras/CUPTI/include/", - ], - visibility = ["//visibility:public"], + includes = ["cuda/extras/CUPTI/include/"], + textual_hdrs = [":cuda-extras"], + deps = [":cupti_virtual_headers"], ) cc_library( name = "cupti_dsos", data = ["cuda/lib/libcupti.so.10.0"], - includes = [ - ".", - "cuda/include", - ], - visibility = ["//visibility:public"], ) cc_library( name = "cusparse", srcs = ["cuda/lib/libcusparse.so.10.0"], data = ["cuda/lib/libcusparse.so.10.0"], - includes = [ - ".", - "cuda/include", - ], linkopts = ["-lgomp"], linkstatic = 1, - visibility = ["//visibility:public"], ) cc_library( name = "libdevice_root", data = [":cuda-nvvm"], - visibility = ["//visibility:public"], ) genrule( @@ -1253,6 +1222,16 @@ genrule( cmd = """cp -rLf "/usr/local/cuda-10.0/extras/CUPTI/include/." "$(@D)/cuda/extras/CUPTI/include/" """, ) +genrule( + name = "cublas-include", + outs = [ + "cublas/include/cublas.h", + "cublas/include/cublas_v2.h", + "cublas/include/cublas_api.h", + ], + cmd = """cp -f "/usr/local/cuda-10.0/include/cublas.h" $(location cublas/include/cublas.h) && cp -f "/usr/local/cuda-10.0/include/cublas_v2.h" $(location cublas/include/cublas_v2.h) && cp -f "/usr/local/cuda-10.0/include/cublas_api.h" $(location cublas/include/cublas_api.h) """, +) + genrule( name = "cuda-lib", outs = [ @@ -1267,7 +1246,7 @@ genrule( "cuda/lib/libcupti.so.10.0", "cuda/lib/libcusparse.so.10.0", ], - cmd = """cp -f "/usr/local/cuda-10.0/lib64/stubs/libcuda.so" $(location cuda/lib/libcuda.so) && cp -f "/usr/local/cuda-10.0/lib64/libcudart.so.10.0" $(location cuda/lib/libcudart.so.10.0) && cp -f "/usr/local/cuda-10.0/lib64/libcudart_static.a" $(location cuda/lib/libcudart_static.a) && cp -f "/usr/local/cuda-10.0/lib64/libcublas.so.10.0" $(location cuda/lib/libcublas.so.10.0) && cp -f "/usr/local/cuda-10.0/lib64/libcusolver.so.10.0" $(location cuda/lib/libcusolver.so.10.0) && cp -f "/usr/local/cuda-10.0/lib64/libcusparse.so.10.0" $(location cuda/lib/libcusparse.so.10.0) && cp -f "/usr/local/cuda-10.0/lib64/libcurand.so.10.0" $(location cuda/lib/libcurand.so.10.0) && cp -f "/usr/local/cuda-10.0/lib64/libcufft.so.10.0" $(location cuda/lib/libcufft.so.10.0) && cp -f "/usr/lib/x86_64-linux-gnu/libcudnn.so.7" $(location cuda/lib/libcudnn.so.7) && cp -f "/usr/local/cuda-10.0/extras/CUPTI/lib64/libcupti.so.10.0" $(location cuda/lib/libcupti.so.10.0) """, + cmd = """cp -f "/usr/local/cuda-10.0/lib64/stubs/libcuda.so" $(location cuda/lib/libcuda.so) && cp -f "/usr/local/cuda-10.0/lib64/libcudart.so.10.0" $(location cuda/lib/libcudart.so.10.0) && cp -f "/usr/local/cuda-10.0/lib64/libcudart_static.a" $(location cuda/lib/libcudart_static.a) && cp -f "/usr/local/cuda-10.0/lib64/libcublas.so.10.0" $(location cuda/lib/libcublas.so.10.0) && cp -f "/usr/local/cuda-10.0/lib64/libcusolver.so.10.0" $(location cuda/lib/libcusolver.so.10.0) && cp -f "/usr/local/cuda-10.0/lib64/libcurand.so.10.0" $(location cuda/lib/libcurand.so.10.0) && cp -f "/usr/local/cuda-10.0/lib64/libcufft.so.10.0" $(location cuda/lib/libcufft.so.10.0) && cp -f "/usr/lib/x86_64-linux-gnu/libcudnn.so.7" $(location cuda/lib/libcudnn.so.7) && cp -f "/usr/local/cuda-10.0/extras/CUPTI/lib64/libcupti.so.10.0" $(location cuda/lib/libcupti.so.10.0) && cp -f "/usr/local/cuda-10.0/lib64/libcusparse.so.10.0" $(location cuda/lib/libcusparse.so.10.0) """, ) genrule( @@ -1297,7 +1276,7 @@ genrule( genrule( name = "cudnn-include", outs = [ - "cuda/include/cudnn.h", + "cudnn/include/cudnn.h", ], - cmd = """cp -f "/usr/include/cudnn.h" $(location cuda/include/cudnn.h) """, + cmd = """cp -f "/usr/include/cudnn.h" $(location cudnn/include/cudnn.h) """, ) diff --git a/third_party/toolchains/preconfig/ubuntu14.04/tensorrt5/BUILD b/third_party/toolchains/preconfig/ubuntu14.04/tensorrt5/BUILD index 518a3b017b9..a8a0e57eaa4 100755 --- a/third_party/toolchains/preconfig/ubuntu14.04/tensorrt5/BUILD +++ b/third_party/toolchains/preconfig/ubuntu14.04/tensorrt5/BUILD @@ -3,12 +3,12 @@ licenses(["notice"]) -exports_files(["LICENSE"]) - load("@local_config_cuda//cuda:build_defs.bzl", "cuda_default_copts") package(default_visibility = ["//visibility:public"]) +exports_files(["LICENSE"]) + cc_library( name = "tensorrt_headers", hdrs = [":tensorrt_include"], @@ -18,15 +18,9 @@ cc_library( cc_library( name = "tensorrt", - srcs = [ - "tensorrt/lib/libnvinfer.so.5", - "tensorrt/lib/libnvinfer_plugin.so.5", - ], + srcs = [":tensorrt_lib"], copts = cuda_default_copts(), - data = [ - "tensorrt/lib/libnvinfer.so.5", - "tensorrt/lib/libnvinfer_plugin.so.5", - ], + data = [":tensorrt_lib"], include_prefix = "", linkstatic = 1, visibility = ["//visibility:public"],