Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Mar 20, 2024
2 parents 17211cc + 927f6b6 commit 8292e30
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
#include "tensor_math.hpp"
#include "gsplat.hpp"

#ifdef USE_HIP
#include <c10/hip/HIPCachingAllocator.h>
#elif defined(USE_CUDA)
#include <c10/cuda/CUDACachingAllocator.h>
#endif

torch::Tensor randomQuatTensor(long long n){
torch::Tensor u = torch::rand(n);
torch::Tensor v = torch::rand(n);
Expand Down Expand Up @@ -442,6 +448,11 @@ void Model::afterTrain(int step){
xysGradNorm = torch::Tensor();
visCounts = torch::Tensor();
max2DSize = torch::Tensor();
#ifdef USE_HIP
c10::hip::HIPCachingAllocator::emptyCache();
#elif defined(USE_CUDA)
c10::cuda::CUDACachingAllocator::emptyCache();
#endif
}
}

Expand Down

0 comments on commit 8292e30

Please sign in to comment.