Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d52e573
initial commit, added an algorithm to fixedSizeSquareMatrixOps that c…
povolny1 Jan 24, 2023
6d4875e
implementation of polar decomposition complete, still need to test
povolny1 Jan 25, 2023
02e0e1c
Fixed cmake so that GEOSX TPLs work and also updated spack.
corbett5 Jan 26, 2023
63a85d1
Merge branch 'corbett/tpl-fix-spack-update' into feature/povolny1/pol…
povolny1 Jan 27, 2023
943b300
implemented unit test for polar decomposition
povolny1 Mar 9, 2023
ddcd7b4
made error message in polar decomposition GPU-compatible
povolny1 May 4, 2023
f591570
Merge branch 'develop' into feature/povolny1/polarDecomposition
povolny1 May 5, 2023
ab63869
merge from develop
povolny1 May 18, 2023
1339ea7
Added device math functions for ceil, floor, and power
Oct 30, 2024
82f1ce3
Merge branch 'develop' into feature/crook5/math
Nov 16, 2024
1e0127a
Corrected host only function inside of checkIndices preventing device…
Dec 5, 2024
343432d
Merge branch 'develop' into feature/crook5/math
rrsettgast Jan 9, 2025
bf73593
Added debugging flags to host configs
Jan 14, 2025
8e86706
wip: trying to fix build error on Lassen.
CusiniM Jan 17, 2025
c021cc5
use fold expression to do index checks
rrsettgast Jan 22, 2025
efc221d
revert changes to typeManipulation.
CusiniM Jan 22, 2025
9275fe7
use bool return value.
CusiniM Jan 22, 2025
882b587
use fold expression.
CusiniM Jan 23, 2025
e599472
fix function name
CusiniM Jan 23, 2025
00e117d
doxygen.
CusiniM Jan 23, 2025
1ccdce5
fix typo.
CusiniM Jan 23, 2025
956aa7c
add other integral types.
CusiniM Jan 23, 2025
8eb4727
add debug assert.
CusiniM Jan 23, 2025
2fa2667
add all integral types.
CusiniM Jan 23, 2025
2343b7d
add char types
CusiniM Jan 23, 2025
ddc611e
add decay type.
CusiniM Jan 23, 2025
52c1d5e
add a static cast option
CusiniM Jan 23, 2025
58fc69d
remove assert.
CusiniM Jan 23, 2025
d89ed76
clean up.
CusiniM Jan 23, 2025
ac6c0fd
remove chars.
CusiniM Jan 24, 2025
c2efd00
just always cast to long long.
CusiniM Jan 24, 2025
e60fa8f
forgotten one.
CusiniM Jan 24, 2025
4194bc9
Merged cusini/fix-lassen-error
Feb 3, 2025
65c00ec
aoa and aoav traits
wrtobin Apr 8, 2025
cff7f1b
just a typo fix
wrtobin Apr 8, 2025
1ada56a
Committing changes to pull from remote
Apr 10, 2025
2522acf
Merge branch 'feature/crook5/math' of github.com:GEOS-DEV/LvArray int…
Apr 10, 2025
557f07c
Merge branch 'develop' into feature/crook5/math
Apr 17, 2025
6a90517
Merged develop
Jun 2, 2025
c3fcf1f
Merge branch 'feature/povolny1/polarDecomposition' into feature/crook…
Jun 2, 2025
fead905
Updated branch with current versions from develop that were overriden…
Jun 3, 2025
00327f8
Fixed compilation error related to polarDecomposition
Jun 17, 2025
95aa41e
Removed wrong namespace
Jun 17, 2025
85136be
Fixed incorrect type
Jun 17, 2025
34a4ea5
Added round to math and cofactor to square tensor ops for 2x2 and 3x3…
Jul 6, 2025
fa06984
Updated formatting
Jul 6, 2025
ebf14c8
Merge branch 'feature/crook5/math' of github.com:GEOS-DEV/LvArray int…
Jul 6, 2025
7d4a46b
Fixed bug in unit tests for cofactors
Jul 6, 2025
a1f3c56
Fixed typo in unittests
Jul 6, 2025
bed5b66
Removed unused variable
Jul 6, 2025
8aebaa5
Added invert for 4x4 matrices
Aug 22, 2025
d452637
Added determinant and inverse operations for square 4x4 matrices
Sep 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/Config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set( PREPROCESSOR_DEFINES UMPIRE
CHAI
CUDA
HIP
HIP
TOTALVIEW_OUTPUT
CALIPER )

Expand Down
5 changes: 5 additions & 0 deletions host-configs/LLNL/dane-clang-14-mpm.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CONFIG_NAME "dane-clang-14-mpm" CACHE PATH "")

set(GEOS_TPL_DIR /usr/WS1/crook5/thirdPartyLibs/install-dane-clang-14-mpm-release CACHE PATH "")

include(${CMAKE_CURRENT_LIST_DIR}/llnl-cpu-clang-14.cmake)
17 changes: 17 additions & 0 deletions src/ArrayOfArrays.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,4 +484,21 @@ class ArrayOfArrays : protected ArrayOfArraysView< T, INDEX_TYPE, false, BUFFER_
}
};

/**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little unsure if this should go here or in GEOS itself.

* @brief True if the template type is an ArrayOfArrays.
*/
template< class >
constexpr bool isArrayOfArrays = false;

/**
* @tparam T The type contained in the ArrayOfArrays.
* @tparam INDEX_TYPE The integral type used as an index.
* @tparam BUFFER_TYPE The type used to manage the underlying allocation.
* @brief Specialization of isArrayOfArrays for the ArrayOfArrays class.
*/
template< typename T,
typename INDEX_TYPE,
template< typename > class BUFFER_TYPE >
constexpr bool isArrayOfArrays< ArrayOfArrays< T, INDEX_TYPE, BUFFER_TYPE > > = true;

} /* namespace LvArray */
21 changes: 20 additions & 1 deletion src/ArrayOfArraysView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class ArrayOfArraysView

/**
* @brief Move assignment operator..
* @param src the SparsityPatternView to be moved from.
* @param src the ArrayOfArraysView to be moved from.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

* @return *this.
*/
LVARRAY_HOST_DEVICE
Expand Down Expand Up @@ -1087,4 +1087,23 @@ class ArrayOfArraysView
}
};

/**
* @brief True if the template type is an ArrayOfArraysView.
*/
template< class >
constexpr bool isArrayOfArraysView = false;

/**
* @tparam T The type contained in the ArrayOfArraysView.
* @tparam INDEX_TYPE The integral type used as an index.
* @tparam CONST_SIZES True iff the size of each array is constant.
* @tparam BUFFER_TYPE The type used to manager the underlying allocation.
* @brief Specialization of isArrayOfArraysView for the ArrayOfArraysView class.
*/
template< typename T,
typename INDEX_TYPE,
bool CONST_SIZES,
template< typename > class BUFFER_TYPE >
constexpr bool isArrayOfArraysView< ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE > > = true;

} /* namespace LvArray */
2 changes: 1 addition & 1 deletion src/ChaiBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ class ChaiBuffer

if( size > 0 )
{
LVARRAY_ERROR_IF_NE_MSG( space, MemorySpace::host, "Calling reallocate with a non-zero current size is not yet supporeted for the GPU." );
LVARRAY_ERROR_IF_NE_MSG( space, MemorySpace::host, "Calling reallocate with a non-zero current size is not yet supported for the GPU." );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

std::ptrdiff_t const overlapAmount = std::min( newCapacity, size );
arrayManipulation::uninitializedMove( newPointer, overlapAmount, m_pointer );
arrayManipulation::destroy( m_pointer, size );
Expand Down
54 changes: 54 additions & 0 deletions src/fixedSizeSquareMatrixOps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,42 @@ LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK inline
auto determinant( MATRIX const & matrix )
{ return internal::SquareMatrixOps< M >::determinant( matrix ); }

/**
* @brief Compute the cofactor of the source matrix @p srcMatrix and store the result in @p dstMatrix.
* @tparam M The size of the matrices @p dstMatrix and @p srcMatrix.
* @tparam DST_MATRIX The type of @p dstMatrix.
* @tparam SRC_MATRIX The type of @p srcMatrix.
* @param dstMatrix The M x M matrix to write the cofactor to.
* @param srcMatrix The M x M matrix to take the cofactor of.
* @note @p srcMatrix can contain integers but @p dstMatrix must contain floating point values.
*/
template< std::ptrdiff_t M, typename DST_MATRIX, typename SRC_MATRIX >
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK inline
auto cofactor( DST_MATRIX && LVARRAY_RESTRICT_REF dstMatrix,
SRC_MATRIX const & LVARRAY_RESTRICT_REF srcMatrix )
{
static_assert( std::is_floating_point< std::decay_t< decltype( dstMatrix[ 0 ][ 0 ] ) > >::value,
"The destination matrix must be contain floating point values." );
internal::SquareMatrixOps< M >::cofactor( std::forward< DST_MATRIX >( dstMatrix ), srcMatrix );
}

/**
* @brief Compute the cofactor of the matrix @p matrix overwritting it.
* @tparam M The size of the matrix @p matrix.
* @tparam MATRIX The type of @p matrix.
* @param matrix The M x M matrix to take the cofactor of and overwrite.
* @return The determinant.
* @note @p matrix must contain floating point values.
*/
template< std::ptrdiff_t M, typename MATRIX >
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK inline
auto cofactor( MATRIX && matrix )
{
static_assert( std::is_floating_point< std::decay_t< decltype( matrix[ 0 ][ 0 ] ) > >::value,
"The matrix must be contain floating point values." );
internal::SquareMatrixOps< M >::cofactor( std::forward< MATRIX >( matrix ) );
}

/**
* @brief Invert the source matrix @p srcMatrix and store the result in @p dstMatrix.
* @tparam M The size of the matrices @p dstMatrix and @p srcMatrix.
Expand Down Expand Up @@ -354,6 +390,24 @@ void symmetricToDense( DST_MATRIX && dstMatrix, SRC_SYM_MATRIX const & srcSymMat
srcSymMatrix );
}

/**
* @brief Determine the polar decomposition of the matrix @p srcMatrix
* @tparam M The size of @p R and @p srcMatrix.
* @tparam DST_MATRIX The type of @p R.
* @tparam MATRIX The type of @p srcMatrix.
* @param R The resultant rotation matrix.
* @param matrix The matrix to be decomposed.
* @details The polar decomposition returns a rotation matrix such that @p R . U = V . @p R = @p srcMatrix.
* This is done using Higham's iterative algorithm.
*/
template< std::ptrdiff_t M, typename DST_MATRIX, typename MATRIX >
LVARRAY_HOST_DEVICE constexpr inline
void polarDecomposition( DST_MATRIX && R, MATRIX const & srcMatrix )
{
return internal::SquareMatrixOps< M >::polarDecomposition( std::forward< DST_MATRIX >( R ),
srcMatrix );
}

///@}

} // namespace tensorOps
Expand Down
Loading