mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-06-08 15:30:41 +00:00
- remove `#include <cstdint>` from `poll.hpp`. To make it only contains device-side code - Fix compilation issue, which will cause pytest fail randomly. Reuse the compiled result for same kernel with different arguments
18 lines
569 B
Plaintext
18 lines
569 B
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
#include "common.hpp"
|
|
// other headers
|
|
#include <mscclpp/semaphore_device.hpp>
|
|
|
|
// be careful about using semaphore[my_rank] as it is an invalid semaphore and it is there just for simplicity of
|
|
// indexing
|
|
extern "C" __global__ void __launch_bounds__(1024, 1)
|
|
d2d_semaphore(mscclpp::SmDevice2DeviceSemaphoreDeviceHandle* semaphores, int my_rank, int nranks) {
|
|
int tid = threadIdx.x;
|
|
if (tid < nranks && tid != my_rank) {
|
|
semaphores[tid].signal();
|
|
semaphores[tid].wait();
|
|
}
|
|
}
|