Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedr committed Jan 2, 2025
1 parent c4b6dcc commit 804bb66
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/MRCuda/MRCudaFastWindingNumber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Expected<void> FastWindingNumber::calcSelfIntersections( FaceBitSet& res, float
Expected<void> FastWindingNumber::calcFromGrid( std::vector<float>& res, const Vector3i& dims, const AffineXf3f& gridToMeshXf, float beta, const ProgressCallback& cb )
{
MR_TIMER
if ( auto maybe = prepareData_( subprogress( cb, 0.0, 0.5f ) ) )
if ( auto maybe = prepareData_( subprogress( cb, 0.0, 0.5f ) ); !maybe )
return unexpected( std::move( maybe.error() ) );

const auto getCudaMatrix = [] ( const AffineXf3f& xf )
Expand Down Expand Up @@ -166,7 +166,7 @@ Expected<void> FastWindingNumber::calcFromGrid( std::vector<float>& res, const V
Expected<void> FastWindingNumber::calcFromGridWithDistances( std::vector<float>& res, const Vector3i& dims, const AffineXf3f& gridToMeshXf, const DistanceToMeshOptions& options, const ProgressCallback& cb )
{
MR_TIMER
if ( auto maybe = prepareData_( {} ) )
if ( auto maybe = prepareData_( subprogress( cb, 0.0, 0.5f ) ); !maybe )
return unexpected( std::move( maybe.error() ) );

const auto getCudaMatrix = [] ( const AffineXf3f& xf )
Expand All @@ -184,19 +184,19 @@ Expected<void> FastWindingNumber::calcFromGridWithDistances( std::vector<float>&
const size_t size = size_t( dims.x ) * dims.y * dims.z;
DynamicArrayF cudaResult;
CUDA_LOGE_RETURN_UNEXPECTED( cudaResult.resize( size ) );
if ( !reportProgress( cb, 0.0f ) )
if ( !reportProgress( cb, 0.6f ) )
return unexpectedOperationCanceled();

signedDistance(
int3{ dims.x, dims.y, dims.z },
cudaGridToMeshXf,
data_->dipoles.data(), data_->cudaNodes.data(), data_->cudaMeshPoints.data(), data_->cudaFaces.data(),
cudaResult.data(), options );

CUDA_LOGE_RETURN_UNEXPECTED( cudaGetLastError() );
if ( !reportProgress( cb, 0.7f ) )
return unexpectedOperationCanceled();

CUDA_LOGE_RETURN_UNEXPECTED( cudaResult.toVector( res ) );

if ( !reportProgress( cb, 1.0f ) )
return unexpectedOperationCanceled();
return {};
Expand Down

0 comments on commit 804bb66

Please sign in to comment.