ae28d55f81
Source: RGB-D -> Dyn-HaMR -> L20 retargeting -> FoundationPose -> reference repair -> SPIDER, documented in docs/PIPELINE_LATEST.md and docs/SETUP_AND_WEIGHTS.md. Adds FoundationPose and nvdiffrast upstream snapshots, requirements/pipeline_venv.txt and the FoundationPose weight manifest/downloader. Assets (Git LFS): weights/ (WiLoR detector, HandFlow denoiser, UniDepth-L), FoundationPose checkpoints, HaMeR checkpoint, Dyn-HaMR HMP model and BMC constraints, L20 URDF/meshes, the 20260915_171525 D405 recording and the two box CADs. MANO models are not redistributed (third_party/hamer/_DATA/data/mano/README.txt). Environments, caches and run outputs excluded. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
95 lines
2.0 KiB
C++
95 lines
2.0 KiB
C++
// Copyright (c) 2009-2022, NVIDIA CORPORATION. All rights reserved.
|
|
//
|
|
// NVIDIA CORPORATION and its licensors retain all intellectual property
|
|
// and proprietary rights in and to this software, related documentation
|
|
// and any modifications thereto. Any use, reproduction, disclosure or
|
|
// distribution of this software and related documentation without an express
|
|
// license agreement from NVIDIA CORPORATION is strictly prohibited.
|
|
|
|
#include "../../framework.h"
|
|
#include "Buffer.hpp"
|
|
|
|
using namespace CR;
|
|
|
|
//------------------------------------------------------------------------
|
|
// GPU buffer.
|
|
//------------------------------------------------------------------------
|
|
|
|
Buffer::Buffer(void)
|
|
: m_gpuPtr(NULL),
|
|
m_bytes (0)
|
|
{
|
|
// empty
|
|
}
|
|
|
|
Buffer::~Buffer(void)
|
|
{
|
|
if (m_gpuPtr)
|
|
cudaFree(m_gpuPtr); // Don't throw an exception.
|
|
}
|
|
|
|
void Buffer::reset(size_t bytes)
|
|
{
|
|
if (bytes == m_bytes)
|
|
return;
|
|
|
|
if (m_gpuPtr)
|
|
{
|
|
NVDR_CHECK_CUDA_ERROR(cudaFree(m_gpuPtr));
|
|
m_gpuPtr = NULL;
|
|
}
|
|
|
|
if (bytes > 0)
|
|
NVDR_CHECK_CUDA_ERROR(cudaMalloc(&m_gpuPtr, bytes));
|
|
|
|
m_bytes = bytes;
|
|
}
|
|
|
|
void Buffer::grow(size_t bytes)
|
|
{
|
|
if (bytes > m_bytes)
|
|
reset(bytes);
|
|
}
|
|
|
|
//------------------------------------------------------------------------
|
|
// Host buffer with page-locked memory.
|
|
//------------------------------------------------------------------------
|
|
|
|
HostBuffer::HostBuffer(void)
|
|
: m_hostPtr(NULL),
|
|
m_bytes (0)
|
|
{
|
|
// empty
|
|
}
|
|
|
|
HostBuffer::~HostBuffer(void)
|
|
{
|
|
if (m_hostPtr)
|
|
cudaFreeHost(m_hostPtr); // Don't throw an exception.
|
|
}
|
|
|
|
void HostBuffer::reset(size_t bytes)
|
|
{
|
|
if (bytes == m_bytes)
|
|
return;
|
|
|
|
if (m_hostPtr)
|
|
{
|
|
NVDR_CHECK_CUDA_ERROR(cudaFreeHost(m_hostPtr));
|
|
m_hostPtr = NULL;
|
|
}
|
|
|
|
if (bytes > 0)
|
|
NVDR_CHECK_CUDA_ERROR(cudaMallocHost(&m_hostPtr, bytes));
|
|
|
|
m_bytes = bytes;
|
|
}
|
|
|
|
void HostBuffer::grow(size_t bytes)
|
|
{
|
|
if (bytes > m_bytes)
|
|
reset(bytes);
|
|
}
|
|
|
|
//------------------------------------------------------------------------
|