diff --git a/tensorflow/core/framework/types.cc b/tensorflow/core/framework/types.cc index 2280114de51..ef10ba16d5f 100644 --- a/tensorflow/core/framework/types.cc +++ b/tensorflow/core/framework/types.cc @@ -40,9 +40,9 @@ const char* const DEVICE_GPU = "GPU"; const char* const DEVICE_SYCL = "SYCL"; const std::string DeviceName::value = DEVICE_CPU; -#if GOOGLE_CUDA +#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM const std::string DeviceName::value = DEVICE_GPU; -#endif // GOOGLE_CUDA +#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM #ifdef TENSORFLOW_USE_SYCL const std::string DeviceName::value = DEVICE_SYCL; #endif // TENSORFLOW_USE_SYCL diff --git a/tensorflow/core/framework/types.h b/tensorflow/core/framework/types.h index c0df1933421..5b6eb872658 100644 --- a/tensorflow/core/framework/types.h +++ b/tensorflow/core/framework/types.h @@ -83,12 +83,12 @@ struct DeviceName { static const std::string value; }; -#if GOOGLE_CUDA +#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM template <> struct DeviceName { static const std::string value; }; -#endif // GOOGLE_CUDA +#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM #ifdef TENSORFLOW_USE_SYCL template <>