Skip to content

Commit b01b70f

Browse files
author
Matteo Cusini
committed
Merge remote-tracking branch 'origin/develop' into feature/corbett/dense
2 parents de26bca + 11e39d2 commit b01b70f

File tree

12 files changed

+85
-22
lines changed

12 files changed

+85
-22
lines changed

cmake/CMakeBasics.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ blt_append_custom_compiler_flag(FLAGS_VAR GEOSX_NINJA_FLAGS
3434
CLANG "-fcolor-diagnostics"
3535
)
3636

37+
#set(CMAKE_CUDA_STANDARD 14 CACHE STRING "")
38+
#set(CMAKE_CUDA_FLAGS_RELEASE "-O3 -DNDEBUG -Xcompiler -DNDEBUG -Xcompiler -O3" CACHE STRING "")
39+
#set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "-g -lineinfo ${CMAKE_CUDA_FLAGS_RELEASE}" CACHE STRING "")
40+
#set(CMAKE_CUDA_FLAGS_DEBUG "-g -G -O0 -Xcompiler -O0" CACHE STRING "")
41+
3742
if( ${CMAKE_MAKE_PROGRAM} STREQUAL "ninja" OR ${CMAKE_MAKE_PROGRAM} MATCHES ".*/ninja$" )
3843
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GEOSX_NINJA_FLAGS}")
3944
endif()

host-configs/LLNL/lassen-base.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Set up the tpls
22
set(GEOSX_TPL_ROOT_DIR /usr/gapps/GEOSX/thirdPartyLibs CACHE PATH "")
3-
set(GEOSX_TPL_DIR ${GEOSX_TPL_ROOT_DIR}/2022-05-15/install-${CONFIG_NAME}-release CACHE PATH "")
3+
set(GEOSX_TPL_DIR ${GEOSX_TPL_ROOT_DIR}/2022-08-04/install-${CONFIG_NAME}-release CACHE PATH "")
44

55
set(CAMP_DIR ${GEOSX_TPL_DIR}/raja CACHE PATH "")
66
set(RAJA_DIR ${GEOSX_TPL_DIR}/raja CACHE PATH "")

host-configs/LLNL/quartz-base.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set(ENABLE_FORTRAN OFF CACHE BOOL "")
22

33
set(GEOSX_TPL_ROOT_DIR /usr/gapps/GEOSX/thirdPartyLibs CACHE PATH "")
4-
set(GEOSX_TPL_DIR ${GEOSX_TPL_ROOT_DIR}/2022-05-15/install-${CONFIG_NAME}-release CACHE PATH "")
4+
set(GEOSX_TPL_DIR ${GEOSX_TPL_ROOT_DIR}/2022-08-04/install-${CONFIG_NAME}-release CACHE PATH "")
55

66
set(CAMP_DIR ${GEOSX_TPL_DIR}/raja CACHE PATH "")
77
set(RAJA_DIR ${GEOSX_TPL_DIR}/raja CACHE PATH "")
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
set(CONFIG_NAME "[email protected]" CACHE PATH "")
2+
3+
set(COMPILER_DIR /usr/tce/packages/clang/clang-13.0.0)
4+
5+
# C
6+
set(CMAKE_C_COMPILER ${COMPILER_DIR}/bin/clang CACHE PATH "")
7+
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG -march=native -mtune=native" CACHE STRING "")
8+
9+
# C++
10+
set(CMAKE_CXX_COMPILER ${COMPILER_DIR}/bin/clang++ CACHE PATH "")
11+
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -march=native -mtune=native" CACHE STRING "")
12+
#set(CMAKE_CXX_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRING "")
13+
14+
15+
16+
17+
include(${CMAKE_CURRENT_LIST_DIR}/quartz-base.cmake)

host-configs/ORNL/[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ set(CMAKE_CUDA_FLAGS "-std=c++14 -Xcompiler -mno-float128 -restrict -arch ${CUDA
2828
set(CMAKE_CUDA_FLAGS_RELEASE "-O3 -DNDEBUG -Xcompiler -DNDEBUG -Xcompiler -O3 -Xcompiler -mcpu=powerpc64le -Xcompiler -mtune=powerpc64le" CACHE STRING "")
2929
set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "-g -lineinfo ${CMAKE_CUDA_FLAGS_RELEASE}" CACHE STRING "")
3030
set(CMAKE_CUDA_FLAGS_DEBUG "-g -G -O0 -Xcompiler -O0" CACHE STRING "")
31-
31+
3232
# Uncomment this line to make nvcc output register usage for each kernel.
3333
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --resource-usage" CACHE STRING "" FORCE)
3434

src/Array.hpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,28 @@ class Array : public ArrayView< T,
184184
return *this;
185185
}
186186

187+
/**
188+
* @brief Copy assignment operator, performs a deep copy of rhs.
189+
* @param rhs Source for the assignment.
190+
* @return *this.
191+
*/
192+
LVARRAY_HOST_DEVICE
193+
Array & operator=( typename ParentClass::ViewTypeConst const & rhs )
194+
{
195+
bufferManipulation::copyInto( this->m_dataBuffer, this->size(), rhs.dataBuffer(), rhs.size() );
196+
197+
INDEX_TYPE const * const dims = rhs.dims();
198+
INDEX_TYPE const * const strides = rhs.strides();
199+
for( int i = 0; i < NDIM; ++i )
200+
{
201+
this->m_dims[ i ] = dims[ i ];
202+
this->m_strides[ i ] = strides[ i ];
203+
}
204+
205+
setSingleParameterResizeIndex( rhs.getSingleParameterResizeIndex() );
206+
return *this;
207+
}
208+
187209
/**
188210
* @brief Move assignment operator, performs a shallow copy of rhs.
189211
* @param rhs Source for the assignment.

src/ArrayOfArraysView.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,12 @@ class ArrayOfArraysView
729729
auto const fillOffsets = [&]()
730730
{
731731
m_offsets[ 0 ] = 0;
732-
#if ( RAJA_VERSION_MAJOR == 1 && RAJA_VERSION_MINOR >= 13 ) || ( RAJA_VERSION_MAJOR > 1 )
733-
RAJA::inclusive_scan< POLICY >( RAJA::make_span( capacities, numSubArrays ), RAJA::make_span( m_offsets.data() + 1, numSubArrays ) );
734-
#else
735-
RAJA::inclusive_scan< POLICY >( capacities, capacities + numSubArrays, m_offsets.data() + 1 );
736-
#endif
732+
// RAJA::inclusive_scan< POLICY >( capacities,
733+
// capacities + numSubArrays,
734+
// m_offsets.data() + 1 );
735+
736+
RAJA::inclusive_scan< POLICY >( RAJA::make_span< INDEX_TYPE const * >( capacities, numSubArrays ),
737+
RAJA::make_span< INDEX_TYPE * >( m_offsets.data()+1, numSubArrays ) );
737738
};
738739
resizeFromOffsetsImpl( numSubArrays, fillOffsets, buffers ... );
739740
}

src/ArrayView.hpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ class ArrayView
8585
/// The integer type used for indexing.
8686
using IndexType = INDEX_TYPE;
8787

88+
/// The type when the data type is const.
89+
using ViewTypeConst = ArrayView< std::remove_const_t< T > const, NDIM, USD, INDEX_TYPE, BUFFER_TYPE >;
90+
91+
8892
/// The type when all inner array classes are converted to const views.
8993
using NestedViewType = ArrayView< std::remove_reference_t< typeManipulation::NestedViewType< T > >,
9094
NDIM, USD, INDEX_TYPE, BUFFER_TYPE >;
@@ -274,12 +278,12 @@ class ArrayView
274278
* @return Return a new ArrayView where @c T is @c const.
275279
*/
276280
inline LVARRAY_HOST_DEVICE constexpr
277-
ArrayView< T const, NDIM, USD, INDEX_TYPE, BUFFER_TYPE > toViewConst() const &
281+
ViewTypeConst toViewConst() const &
278282
{
279-
return ArrayView< T const, NDIM, USD, INDEX_TYPE, BUFFER_TYPE >( m_dims,
280-
m_strides,
281-
m_singleParameterResizeIndex,
282-
m_dataBuffer );
283+
return ViewTypeConst( m_dims,
284+
m_strides,
285+
m_singleParameterResizeIndex,
286+
m_dataBuffer );
283287
}
284288

285289
/**

src/python/PyArray.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,10 @@ class PyArrayWrapper final : public PyArrayWrapperBase
208208

209209
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
210210
virtual PyObject * toNumPy() const final override
211-
{ return toNumPyImpl(); };
211+
{
212+
m_array.move( MemorySpace::host, m_accessLevel != static_cast< int >(PyModify::READ_ONLY) );
213+
return toNumPyImpl();
214+
};
212215

213216
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
214217
virtual std::type_index valueType() const final override

unitTests/testArray_ChaiBuffer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "testUtils.hpp"
1414
#include "ChaiBuffer.hpp"
1515
#include "Array.hpp"
16+
#include "umpire/strategy/QuickPool.hpp"
1617

1718
// TPL includes
1819
#include <gtest/gtest.h>

0 commit comments

Comments
 (0)