mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-01 03:12:49 +08:00
Summary: This diff enables compilation warning flags for the directory in question. Further details are in [this workplace post](https://fb.workplace.com/permalink.php?story_fbid=pfbid02XaWNiCVk69r1ghfvDVpujB8Hr9Y61uDvNakxiZFa2jwiPHscVdEQwCBHrmWZSyMRl&id=100051201402394). This is a low-risk diff. There are **no run-time effects** and the diff has already been observed to compile locally. **If the code compiles, it work; test errors are spurious.** Differential Revision: D70282347 fbshipit-source-id: e2fa55c002d7124b13450c812165d244b8a53f4e
37 lines
806 B
C++
37 lines
806 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#ifdef WITH_CUDA
|
|
#include <c10/cuda/CUDAException.h>
|
|
#include <cuda_runtime_api.h>
|
|
|
|
namespace pulsar {
|
|
namespace pytorch {
|
|
|
|
void cudaDevToDev(
|
|
void* trg,
|
|
const void* src,
|
|
const int& size,
|
|
const cudaStream_t& stream) {
|
|
C10_CUDA_CHECK(
|
|
cudaMemcpyAsync(trg, src, size, cudaMemcpyDeviceToDevice, stream));
|
|
}
|
|
|
|
void cudaDevToHost(
|
|
void* trg,
|
|
const void* src,
|
|
const int& size,
|
|
const cudaStream_t& stream) {
|
|
C10_CUDA_CHECK(
|
|
cudaMemcpyAsync(trg, src, size, cudaMemcpyDeviceToHost, stream));
|
|
}
|
|
|
|
} // namespace pytorch
|
|
} // namespace pulsar
|
|
#endif
|