tensorflow/core/profiler/internal/gpu/device_tracer.cc
// Not in anonymous namespace for testing purposes.
Not in anonymous namespace for testing purposes.
Not in anonymous namespace for testing purposes .
std::unique_ptr<profiler::ProfilerInterface> CreateGpuTracer(
    const ProfileOptions& options) {
  if (options.device_tracer_level() == 0) return nullptr;
  if (options.device_type() != ProfileOptions::GPU &&
      options.device_type() != ProfileOptions::UNSPECIFIED)
    return nullptr;
  profiler::CuptiTracer* cupti_tracer =
      profiler::CuptiTracer::GetCuptiTracerSingleton();
  if (!cupti_tracer->IsAvailable()) {
    return nullptr;
  }
  profiler::CuptiInterface* cupti_interface = profiler::GetCuptiInterface();
  return absl::make_unique<profiler::GpuTracer>(cupti_tracer, cupti_interface);
}
std :: unique_ptr < profiler :: ProfilerInterface > CreateGpuTracer ( const ProfileOptions & options ) { if ( options . device_tracer_level ( ) == 0 ) return nullptr ; if ( options . device_type ( ) != ProfileOptions :: GPU && options . device_type ( ) != ProfileOptions :: UNSPECIFIED ) return nullptr ; profiler :: CuptiTracer * cupti_tracer = profiler :: CuptiTracer :: GetCuptiTracerSingleton ( ) ; if ( ! cupti_tracer -> IsAvailable ( ) ) { return nullptr ; } profiler :: CuptiInterface * cupti_interface = profiler :: GetCuptiInterface ( ) ; return absl :: make_unique < profiler :: GpuTracer > ( cupti_tracer , cupti_interface ) ; }
Not in anonymous namespace for testing purposes.
Not in anonymous namespace for testing purposes .