Skip to content

Commit

Permalink
Merge pull request #1263 from LLNL/feature/gunney/parallel-marching-c…
Browse files Browse the repository at this point in the history
…ubes

Improve marching cubes performance on GPUs
  • Loading branch information
gunney1 authored Mar 17, 2024
2 parents 4864dfc + d101063 commit 2c02493
Show file tree
Hide file tree
Showing 18 changed files with 2,814 additions and 2,779 deletions.
5 changes: 5 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/
user code to read in a subset of a Pro/E ASCII tetrahedron mesh file.

### Changed
- `MarchingCubes` has optimizations to improve GPU performance, particularly for
repeated computations. The constructor has changed and a new `setMesh` method
is added to set (or change) the mesh. New accessors present output data
without moving them from device to host. These accessors are an interim
solution and likely to be updated in the future.
- `DistributedClosestPoint` outputs are now controlled by the `setOutput` method.
- `MarchingCubes` allows user to select the underlying data-parallel implementation
- `fullParallel` works best on GPUs.
Expand Down
10 changes: 8 additions & 2 deletions src/axom/core/Array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,10 @@ class Array : public ArrayBase<T, DIM, Array<T, DIM, SPACE>>
*
* \note Reallocation is done if the new size will exceed the capacity.
*/
template <typename... Args, typename Enable = std::enable_if_t<sizeof...(Args) == DIM>>
template <
typename... Args,
typename Enable = typename std::enable_if<
sizeof...(Args) == DIM && detail::all_types_are_integral<Args...>::value>::type>
void resize(Args... args)
{
static_assert(std::is_default_constructible<T>::value,
Expand All @@ -746,7 +749,10 @@ class Array : public ArrayBase<T, DIM, Array<T, DIM, SPACE>>
}

/// \overload
template <typename... Args, typename Enable = std::enable_if_t<sizeof...(Args) == DIM>>
template <
typename... Args,
typename Enable = typename std::enable_if<
sizeof...(Args) == DIM && detail::all_types_are_integral<Args...>::value>::type>
void resize(ArrayOptions::Uninitialized, Args... args)
{
const StackArray<IndexType, DIM> dims {{static_cast<IndexType>(args)...}};
Expand Down
4 changes: 2 additions & 2 deletions src/axom/mint/mesh/internal/ConnectivityArrayHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ inline CellType initializeFromGroup(
"sidre::Group " << group->getPathName()
<< " does not conform to mesh blueprint.");

sidre::View* type_view = elems_group->getView("types");
m_types = std::make_unique<sidre::Array<CellType>>(type_view);
sidre::View* elem_type_view = elems_group->getView("types");
m_types = std::make_unique<sidre::Array<CellType>>(elem_type_view);
}

return cell_type;
Expand Down
2 changes: 1 addition & 1 deletion src/axom/primal/geometry/Vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ AXOM_HOST_DEVICE Vector<T, NDIMS> operator*(const T scalar,
/*!
* \brief Scalar division of vector; Scalar on rhs.
* \param [in] vec vector instance
* \param [in]n scalar user-supplied scalar.
* \param [in] scalar user-supplied scalar.
* \return C resulting vector, \f$ \ni: C_i = vec_i / scalar, \forall i\f$
* \pre scalar != 0.0
*/
Expand Down
Loading

0 comments on commit 2c02493

Please sign in to comment.