Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/common/dist_gemm_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ using AtomicBoolean = cuda::atomic<bool>;

__global__ void delay_kernel(const AtomicBoolean* atomic_flag_ptr) {
while (not atomic_flag_ptr->load()) {
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 700
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it okay if the while loop body is empty here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that should be fine; example 41 implements the spin wait without the sleep instruction. nanosleep is in the ISA for sm70 and later only.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This same pattern is in several files, and other files don't have guards when they probably should. Can you move this code into a helper function cutlass::nanosleep_if_supported() and replace all direct __nanosleep() calls with a call to that new function?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2567 adds guards for this header. But I guess the guards could be placed in this header to avoid the duplication at the includers

nanosleep_if_supported is a good idea in any case.

__nanosleep(40);
#endif
}
}

Expand Down