respect device_trace_level option.

PiperOrigin-RevId: 338188839
Change-Id: If1997f5431184f29bbefc62fdb5e76f21a26eadd
This commit is contained in:
A. Unique TensorFlower 2020-10-20 20:25:55 -07:00 committed by TensorFlower Gardener
parent a1a8c27579
commit 133bcaa139

View File

@ -196,6 +196,7 @@ Status GpuTracer::CollectData(RunMetadata* run_metadata) {
}
Status GpuTracer::CollectData(XSpace* space) {
VLOG(2) << "Collecting data to XSpace from GpuTracer.";
switch (profiling_state_) {
case State::kNotStarted:
VLOG(1) << "No trace data collected, session wasn't started";
@ -230,7 +231,7 @@ Status GpuTracer::CollectData(XSpace* space) {
// Not in anonymous namespace for testing purposes.
std::unique_ptr<profiler::ProfilerInterface> CreateGpuTracer(
const ProfileOptions& options) {
VLOG(2) << "Collecting data to XSpace from GpuTracer.";
if (options.device_tracer_level() == 0) return nullptr;
if (options.device_type() != ProfileOptions::GPU &&
options.device_type() != ProfileOptions::UNSPECIFIED)
return nullptr;