Skip to content

Commit 26993ed

Browse files
committed
Fix metal sync error
1 parent e5b1443 commit 26993ed

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

model.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
#include "gsplat.hpp"
99
#include "utils.hpp"
1010

11+
#ifdef USE_MPS
12+
#include <torch/mps.h>
13+
#endif
14+
1115
#ifdef USE_HIP
1216
#include <c10/hip/HIPCachingAllocator.h>
1317
#elif defined(USE_CUDA)
@@ -178,6 +182,9 @@ torch::Tensor Model::forward(Camera& cam, int step){
178182
rgbs = SphericalHarmonicsCPU::apply(degreesToUse, viewDirs, colors);
179183
}else{
180184
#if defined(USE_HIP) || defined(USE_CUDA) || defined(USE_MPS)
185+
#ifdef USE_MPS
186+
torch::mps::synchronize();
187+
#endif
181188
rgbs = SphericalHarmonics::apply(degreesToUse, viewDirs, colors);
182189
#endif
183190
}

0 commit comments

Comments
 (0)