Skip to content

Commit 210d156

Browse files
Restore GOOGLE_CUDA guard in scoped_annotation.h
PiperOrigin-RevId: 620260337
1 parent 370c98d commit 210d156

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

third_party/xla/third_party/tsl/tsl/profiler/lib/scoped_annotation.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ namespace tsl::profiler {
3535
// TraceCollector until PopAnnotation() is called.
3636
template <typename T>
3737
void PushAnnotation(const T& generator) {
38+
#if GOOGLE_CUDA
3839
if (auto domain = DefaultProfilerDomain();
3940
TF_PREDICT_FALSE(domain != nullptr)) {
4041
RangePush(domain, generator());
4142
return;
4243
}
44+
#endif
4345

4446
#if !defined(IS_MOBILE_PLATFORM)
4547
if (TF_PREDICT_FALSE(AnnotationStack::IsEnabled())) {
@@ -60,11 +62,13 @@ inline void PopAnnotation() {
6062
// fail probably due to compiler in that presubmit config.
6163
std::atomic_thread_fence(std::memory_order_acquire);
6264

65+
#if GOOGLE_CUDA
6366
if (auto domain = DefaultProfilerDomain();
6467
TF_PREDICT_FALSE(domain != nullptr)) {
6568
RangePop(domain);
6669
return;
6770
}
71+
#endif
6872

6973
#if !defined(IS_MOBILE_PLATFORM)
7074
if (TF_PREDICT_FALSE(AnnotationStack::IsEnabled())) {

0 commit comments

Comments
 (0)