[SE] Remove some uses of TF string utils in StreamExecutor.

These are a layering violation, and the ABSL versions are nicer anyway.

PiperOrigin-RevId: 245534177
This commit is contained in:
Justin Lebar 2019-04-26 21:36:52 -07:00 committed by TensorFlower Gardener
parent e647f5406e
commit 29a8e8e484
3 changed files with 10 additions and 16 deletions
tensorflow/stream_executor

View File

@ -476,7 +476,7 @@ cc_library(
srcs = ["cudnn_version.cc"],
hdrs = ["cudnn_version.h"],
deps = [
"//tensorflow/core:lib",
"@com_google_absl//absl/strings",
],
)

View File

@ -18,7 +18,7 @@ limitations under the License.
#include <string>
#include "tensorflow/core/lib/strings/strcat.h"
#include "absl/strings/str_cat.h"
namespace stream_executor {
namespace gpu {
@ -29,9 +29,8 @@ struct CudnnVersion {
CudnnVersion(int major, int minor, int patch)
: major_version(major), minor_version(minor), patch_level(patch) {}
tensorflow::string ToString() const {
return tensorflow::strings::StrCat(major_version, ".", minor_version, ".",
patch_level);
std::string ToString() const {
return absl::StrCat(major_version, ".", minor_version, ".", patch_level);
}
int major_version;

View File

@ -19,13 +19,12 @@ limitations under the License.
#include "tensorflow/stream_executor/kernel.h"
#include "tensorflow/stream_executor/platform/port.h"
#include "absl/strings/string_view.h"
#include "tensorflow/core/lib/strings/str_util.h"
#include "absl/strings/strip.h"
#include "tensorflow/stream_executor/lib/demangle.h"
#include "tensorflow/stream_executor/platform.h"
#include "tensorflow/stream_executor/platform/logging.h"
#include "tensorflow/stream_executor/platform/port.h"
#include "tensorflow/stream_executor/stream_executor.h"
namespace stream_executor {
@ -91,16 +90,12 @@ KernelCacheConfig KernelBase::GetPreferredCacheConfig() const {
return implementation_->GetPreferredCacheConfig();
}
// Prefix stub functions emitted by the CUDA splitter.
static const char *kStubPrefix = "__device_stub_";
void KernelBase::set_name(absl::string_view name) {
name_ = string(name);
absl::string_view stubless_name = name;
if (tensorflow::str_util::StartsWith(name, kStubPrefix)) {
stubless_name.remove_prefix(strlen(kStubPrefix));
}
demangled_name_ = port::Demangle(stubless_name.data());
// CUDA splitter prefixes stub functions with __device_stub_.
demangled_name_ =
port::Demangle(absl::StripPrefix(name, "__device_stub_").data());
}
} // namespace stream_executor