mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-05-12 09:17:06 +00:00
20 lines
637 B
C++
20 lines
637 B
C++
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
#include <mscclpp/cuda_utils.hpp>
|
|
|
|
namespace mscclpp {
|
|
|
|
AvoidCudaGraphCaptureGuard::AvoidCudaGraphCaptureGuard() : mode_(cudaStreamCaptureModeRelaxed) {
|
|
MSCCLPP_CUDATHROW(cudaThreadExchangeStreamCaptureMode(&mode_));
|
|
}
|
|
|
|
AvoidCudaGraphCaptureGuard::~AvoidCudaGraphCaptureGuard() { cudaThreadExchangeStreamCaptureMode(&mode_); }
|
|
|
|
CudaStreamWithFlags::CudaStreamWithFlags(unsigned int flags) {
|
|
MSCCLPP_CUDATHROW(cudaStreamCreateWithFlags(&stream_, flags));
|
|
}
|
|
CudaStreamWithFlags::~CudaStreamWithFlags() { cudaStreamDestroy(stream_); }
|
|
|
|
} // namespace mscclpp
|