/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "absl/memory/memory.h"
#include "tensorflow/core/profiler/internal/gpu/cupti_interface.h"
#include "tensorflow/core/profiler/internal/gpu/cupti_wrapper.h"

#if defined(PLATFORM_GOOGLE)
#include "tensorflow/core/profiler/internal/gpu/cupti_error_manager.h"
#endif

namespace tensorflow {
namespace profiler {

CuptiInterface* GetCuptiInterface() {
  static CuptiInterface* cupti_interface =
#if defined(PLATFORM_GOOGLE)
      new CuptiErrorManager(absl::make_unique<CuptiWrapper>());
#else
      new CuptiWrapper();
#endif
  return cupti_interface;
}

}  // namespace profiler
}  // namespace tensorflow

/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "absl/memory/memory.h"
#include "tensorflow/core/profiler/internal/gpu/cupti_interface.h"
#include "tensorflow/core/profiler/internal/gpu/cupti_wrapper.h"
#include "tensorflow/core/profiler/internal/gpu/cupti_error_manager.h"

namespace tensorflow {
namespace profiler {

CuptiInterface* GetCuptiInterface() {
  static CuptiInterface* cupti_interface =
      new CuptiErrorManager(absl::make_unique<CuptiWrapper>());
  return cupti_interface;
}

}  // namespace profiler
}  // namespace tensorflow

Enable usage of CuptiErrorManager on all the platforms.
Enable usage of CuptiErrorManager on all the platforms.

PiperOrigin-RevId: 397131526
Change-Id: I6f180d63188f5c67a7666bc490e131408b1851ee
