Files
mscclpp/python/test/d2d_semaphore_test.cu
Binyang2014 097aa8843a Fix pytest unstable issue. (#170)
- 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
2023-09-06 17:09:04 -07:00

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();
}
}