aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/stream_executor/stream_executor_pimpl.cc
diff options
context:
space:
mode:
authorGravatar Chris Leary <leary@google.com>2017-08-22 23:37:36 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-08-22 23:41:55 -0700
commit33e34ef79f66743e44ced81ed9cf182e00ad5d13 (patch)
tree2450fdfb1282bebfe4a4995757fbe4b71a2ba764 /tensorflow/stream_executor/stream_executor_pimpl.cc
parent1e849fed6032015eb25149b801de0f7be2d87026 (diff)
[SE] Change comments/identifiers/logs from when StreamExecutor was GPUExecutor.
PiperOrigin-RevId: 166163619
Diffstat (limited to 'tensorflow/stream_executor/stream_executor_pimpl.cc')
-rw-r--r--tensorflow/stream_executor/stream_executor_pimpl.cc98
1 files changed, 49 insertions, 49 deletions
diff --git a/tensorflow/stream_executor/stream_executor_pimpl.cc b/tensorflow/stream_executor/stream_executor_pimpl.cc
index 4cac6f6c96..e23d3ddace 100644
--- a/tensorflow/stream_executor/stream_executor_pimpl.cc
+++ b/tensorflow/stream_executor/stream_executor_pimpl.cc
@@ -36,7 +36,7 @@ limitations under the License.
#include "tensorflow/stream_executor/stream_executor_internal.h"
namespace {
-bool FLAGS_check_gpu_leaks = false;
+bool FLAGS_check_device_leaks = false;
} // namespace
namespace perftools {
@@ -81,7 +81,7 @@ internal::StreamExecutorInterface *StreamExecutorImplementationFromPlatformKind(
}
if (factory == nullptr) {
LOG(FATAL)
- << "cannot create GPU executor implementation for platform kind: "
+ << "cannot create StreamExecutor implementation for platform kind: "
<< PlatformKindString(platform_kind);
}
return factory(plugin_config);
@@ -192,7 +192,7 @@ StreamExecutor::~StreamExecutor() {
<< "especially if any stream is still active!";
}
- if (FLAGS_check_gpu_leaks) {
+ if (FLAGS_check_device_leaks) {
for (auto it : mem_allocs_) {
LOG(INFO) << "Memory alloced at executor exit: addr: "
<< port::Printf("%p", it.first)
@@ -499,17 +499,17 @@ bool StreamExecutor::SynchronousMemSet(DeviceMemoryBase *location, int value,
return implementation_->SynchronousMemSet(location, value, size);
}
-bool StreamExecutor::SynchronousMemcpy(DeviceMemoryBase *gpu_dst,
+bool StreamExecutor::SynchronousMemcpy(DeviceMemoryBase *device_dst,
const void *host_src, uint64 size) {
- VLOG(1) << "Called StreamExecutor::SynchronousMemcpy(gpu_dst="
- << gpu_dst->opaque() << ", host_src=" << host_src << ", size=" << size
- << ") H2D" << StackTraceIfVLOG10();
+ VLOG(1) << "Called StreamExecutor::SynchronousMemcpy(device_dst="
+ << device_dst->opaque() << ", host_src=" << host_src
+ << ", size=" << size << ") H2D" << StackTraceIfVLOG10();
// Tracing overloaded methods is very difficult due to issues with type
// inference on template args. Since use of these overloaded methods is
// discouraged anyway, this isn't a huge deal.
port::Status status =
- implementation_->SynchronousMemcpy(gpu_dst, host_src, size);
+ implementation_->SynchronousMemcpy(device_dst, host_src, size);
if (!status.ok()) {
LOG(ERROR) << "synchronous memcpy: " << status;
}
@@ -517,29 +517,29 @@ bool StreamExecutor::SynchronousMemcpy(DeviceMemoryBase *gpu_dst,
}
bool StreamExecutor::SynchronousMemcpy(void *host_dst,
- const DeviceMemoryBase &gpu_src,
+ const DeviceMemoryBase &device_src,
uint64 size) {
VLOG(1) << "Called StreamExecutor::SynchronousMemcpy(host_dst=" << host_dst
- << ", gpu_src=" << gpu_src.opaque() << ", size=" << size << ") D2H"
- << StackTraceIfVLOG10();
+ << ", device_src=" << device_src.opaque() << ", size=" << size
+ << ") D2H" << StackTraceIfVLOG10();
port::Status status =
- implementation_->SynchronousMemcpy(host_dst, gpu_src, size);
+ implementation_->SynchronousMemcpy(host_dst, device_src, size);
if (!status.ok()) {
LOG(ERROR) << "synchronous memcpy: " << status;
}
return status.ok();
}
-bool StreamExecutor::SynchronousMemcpy(DeviceMemoryBase *gpu_dst,
- const DeviceMemoryBase &gpu_src,
+bool StreamExecutor::SynchronousMemcpy(DeviceMemoryBase *device_dst,
+ const DeviceMemoryBase &device_src,
uint64 size) {
- VLOG(1) << "Called StreamExecutor::SynchronousMemcpy(gpu_dst="
- << gpu_dst->opaque() << ", gpu_src=" << gpu_src.opaque()
+ VLOG(1) << "Called StreamExecutor::SynchronousMemcpy(device_dst="
+ << device_dst->opaque() << ", device_src=" << device_src.opaque()
<< ", size=" << size << ") D2D" << StackTraceIfVLOG10();
- port::Status status =
- implementation_->SynchronousMemcpyDeviceToDevice(gpu_dst, gpu_src, size);
+ port::Status status = implementation_->SynchronousMemcpyDeviceToDevice(
+ device_dst, device_src, size);
if (!status.ok()) {
LOG(ERROR) << "synchronous memcpy: " << status;
}
@@ -547,48 +547,47 @@ bool StreamExecutor::SynchronousMemcpy(DeviceMemoryBase *gpu_dst,
}
port::Status StreamExecutor::SynchronousMemcpyD2H(
- const DeviceMemoryBase &gpu_src, int64 size, void *host_dst) {
- VLOG(1) << "Called StreamExecutor::SynchronousMemcpyD2H(gpu_src="
- << gpu_src.opaque() << ", size=" << size << ", host_dst=" << host_dst
- << ")" << StackTraceIfVLOG10();
+ const DeviceMemoryBase &device_src, int64 size, void *host_dst) {
+ VLOG(1) << "Called StreamExecutor::SynchronousMemcpyD2H(device_src="
+ << device_src.opaque() << ", size=" << size
+ << ", host_dst=" << host_dst << ")" << StackTraceIfVLOG10();
port::Status result{port::Status::OK()};
- SCOPED_TRACE(TraceListener::SynchronousMemcpyD2H,
- &result, gpu_src, size, host_dst);
+ SCOPED_TRACE(TraceListener::SynchronousMemcpyD2H, &result, device_src, size,
+ host_dst);
port::Status status =
- implementation_->SynchronousMemcpy(host_dst, gpu_src, size);
+ implementation_->SynchronousMemcpy(host_dst, device_src, size);
if (!status.ok()) {
- return port::Status{
- port::error::INTERNAL,
- port::Printf(
- "failed to synchronously memcpy device-to-host: GPU %p to host %p "
- "size %lld: %s",
- gpu_src.opaque(), host_dst, size, status.ToString().c_str())};
+ return port::Status{port::error::INTERNAL,
+ port::Printf("failed to synchronously memcpy "
+ "device-to-host: device %p to host %p "
+ "size %lld: %s",
+ device_src.opaque(), host_dst, size,
+ status.ToString().c_str())};
}
return result;
}
-port::Status StreamExecutor::SynchronousMemcpyH2D(const void *host_src,
- int64 size,
- DeviceMemoryBase *gpu_dst) {
+port::Status StreamExecutor::SynchronousMemcpyH2D(
+ const void *host_src, int64 size, DeviceMemoryBase *device_dst) {
VLOG(1) << "Called StreamExecutor::SynchronousMemcpyH2D(host_src=" << host_src
- << ", size=" << size << ", gpu_dst" << gpu_dst->opaque() << ")"
+ << ", size=" << size << ", device_dst" << device_dst->opaque() << ")"
<< StackTraceIfVLOG10();
port::Status result{port::Status::OK()};
- SCOPED_TRACE(TraceListener::SynchronousMemcpyH2D,
- &result, host_src, size, gpu_dst);
+ SCOPED_TRACE(TraceListener::SynchronousMemcpyH2D, &result, host_src, size,
+ device_dst);
port::Status status =
- implementation_->SynchronousMemcpy(gpu_dst, host_src, size);
+ implementation_->SynchronousMemcpy(device_dst, host_src, size);
if (!status.ok()) {
result = port::Status{
port::error::INTERNAL,
port::Printf("failed to synchronously memcpy host-to-device: host "
- "%p to GPU %p size %lld: %s",
- host_src, gpu_dst->opaque(), size,
+ "%p to device %p size %lld: %s",
+ host_src, device_dst->opaque(), size,
status.ToString().c_str())};
}
@@ -596,20 +595,21 @@ port::Status StreamExecutor::SynchronousMemcpyH2D(const void *host_src,
}
bool StreamExecutor::Memcpy(Stream *stream, void *host_dst,
- const DeviceMemoryBase &gpu_src, uint64 size) {
- return implementation_->Memcpy(stream, host_dst, gpu_src, size);
+ const DeviceMemoryBase &device_src, uint64 size) {
+ return implementation_->Memcpy(stream, host_dst, device_src, size);
}
-bool StreamExecutor::Memcpy(Stream *stream, DeviceMemoryBase *gpu_dst,
+bool StreamExecutor::Memcpy(Stream *stream, DeviceMemoryBase *device_dst,
const void *host_src, uint64 size) {
- return implementation_->Memcpy(stream, gpu_dst, host_src, size);
+ return implementation_->Memcpy(stream, device_dst, host_src, size);
}
bool StreamExecutor::MemcpyDeviceToDevice(Stream *stream,
- DeviceMemoryBase *gpu_dst,
- const DeviceMemoryBase &gpu_src,
+ DeviceMemoryBase *device_dst,
+ const DeviceMemoryBase &device_src,
uint64 size) {
- return implementation_->MemcpyDeviceToDevice(stream, gpu_dst, gpu_src, size);
+ return implementation_->MemcpyDeviceToDevice(stream, device_dst, device_src,
+ size);
}
bool StreamExecutor::MemZero(Stream *stream, DeviceMemoryBase *location,
@@ -700,7 +700,7 @@ void StreamExecutor::EnqueueOnBackgroundThread(std::function<void()> task) {
}
void StreamExecutor::CreateAllocRecord(void *opaque, uint64 bytes) {
- if (FLAGS_check_gpu_leaks && opaque != nullptr && bytes != 0) {
+ if (FLAGS_check_device_leaks && opaque != nullptr && bytes != 0) {
mutex_lock lock{mu_};
mem_allocs_[opaque] = AllocRecord{
bytes, ""};
@@ -708,7 +708,7 @@ void StreamExecutor::CreateAllocRecord(void *opaque, uint64 bytes) {
}
void StreamExecutor::EraseAllocRecord(void *opaque) {
- if (FLAGS_check_gpu_leaks && opaque != nullptr) {
+ if (FLAGS_check_device_leaks && opaque != nullptr) {
mutex_lock lock{mu_};
if (mem_allocs_.find(opaque) == mem_allocs_.end()) {
LOG(ERROR) << "Deallocating unknown pointer: "