Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
55 changes: 39 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
###################################################################################################
# Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
# All rights reserved.
# See the LICENSE file for details.
# SPDX-License-Identifier: (BSD-3-Clause)
###################################################################################################

cmake_minimum_required( VERSION 3.9 )

# Set version number
set( LVARRAY_VERSION_MAJOR 0 )
set( LVARRAY_VERSION_MINOR 1 )
set( LVARRAY_VERSION_MINOR 2 )
set( LVARRAY_VERSION_PATCHLEVEL 0 )

# check if LvArray is build as a submodule or a separate project
Expand Down Expand Up @@ -32,33 +39,49 @@ if( NOT is_submodule )
option( ENABLE_CHAI "Build with CHAI" OFF )
option( ENABLE_CALIPER "Build with Caliper" OFF )

include( cmake/blt/SetupBLT.cmake )
if( NOT BLT_LOADED )
if( DEFINED BLT_SOURCE_DIR )
if( NOT EXISTS ${BLT_SOURCE_DIR}/SetupBLT.cmake )
message( FATAL_ERROR "Given BLT_SOURCE_DIR does not contain SetupBLT.cmake" )
endif()
else ()
set( BLT_SOURCE_DIR ${PROJECT_SOURCE_DIR}/cmake/blt CACHE PATH "" )

if( NOT EXISTS ${BLT_SOURCE_DIR}/SetupBLT.cmake )
message( FATAL_ERROR "The BLT submodule is not present. If in git repository run the following two commands:\n \
git submodule init\n \
git submodule update" )
endif ()
endif ()

include( ${BLT_SOURCE_DIR}/SetupBLT.cmake )
endif()

include( cmake/CMakeBasics.cmake )
include( cmake/SetupTPL.cmake )
else()
if( NOT BLT_LOADED )
message( FATAL_ERROR "When using LvArray as a submodule you must have already loaded BLT." )
endif()

include( cmake/CMakeBasics.cmake )
endif()

include(cmake/Macros.cmake)
include(cmake/Config.cmake)
include( cmake/Macros.cmake )
include( cmake/Config.cmake )

set( lvarray_dependencies dl )

if( ENABLE_CHAI )
set( lvarray_dependencies ${lvarray_dependencies} chai umpire )
endif()
blt_list_append( TO lvarray_dependencies ELEMENTS camp RAJA )

if( ENABLE_CUDA )
set( lvarray_dependencies ${lvarray_dependencies} cuda )
endif()
blt_list_append( TO lvarray_dependencies ELEMENTS umpire IF ENABLE_UMPIRE )

if( ENABLE_RAJA )
set( lvarray_dependencies ${lvarray_dependencies} RAJA )
endif()
blt_list_append( TO lvarray_dependencies ELEMENTS chai IF ENABLE_CHAI )

blt_list_append( TO lvarray_dependencies ELEMENTS cuda IF ENABLE_CUDA )

blt_list_append( TO lvarray_dependencies ELEMENTS caliper IF ENABLE_CALIPER )

if( ENABLE_CALIPER )
set( lvarray_dependencies ${lvarray_dependencies} caliper )
endif()

add_subdirectory( src )

Expand Down
24 changes: 22 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,33 @@ Version vxx.yy.zz -- Release date 20yy-mm-dd
============================================

* New features:
* Added various tensorOps functions.
* Added a Python interface to most container classes.

* API Changes:

* Build changes/improvements:

* Bug fixes:

Version v0.2.0 -- Release date 2020-05-05
============================================

* New features:
* Various tensorOps functions.
* A Python library with interfaces to most container classes.
* Can create an `Array` that begins life on the device.
* Can create an `Array` with specific Umpire allocators.
* Math functions for CUDA's `__half` and `__half2`.
* Better CUDA error messages.
* Added in wrappers around Umpire's `memcpy` and `memset`.

* API Changes:
* You will now get a compilation error when performing certain undefined operations on rvalues, for example calling `toView` on an `Array` rvalue.
* Now use `camp::resources::Platform` for `MemorySpace`.

* Build changes/improvements:
* config-build.py works with Python3.
* Support for object libraries via the CMake variable `LVARRAY_BUILD_OBJ_LIBS`.
* Support for RAJA 0.13.

* Bug fixes:
* Fixed an indexing bug that produced a compilation error with GCC 10.
Expand Down
45 changes: 26 additions & 19 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
###################################################################################################
# Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
# All rights reserved.
# See the LICENSE file for details.
# SPDX-License-Identifier: (BSD-3-Clause)
###################################################################################################

#
# Specify list of tests
# Specify list of benchmarks
#
set(benchmarkSources
benchmarkReduce.cpp
benchmarkInnerProduct.cpp
benchmarkOuterProduct.cpp
benchmarkMatrixVector.cpp
benchmarkMatrixMatrix.cpp
benchmarkArray1DR2TensorMultiplication.cpp
benchmarkSparsityGeneration.cpp
benchmarkArrayOfArraysReduce.cpp
benchmarkArrayOfArraysNodeToElementMapConstruction.cpp
benchmarkEigendecomposition.cpp
set( benchmarkSources
benchmarkReduce.cpp
benchmarkInnerProduct.cpp
benchmarkOuterProduct.cpp
benchmarkMatrixVector.cpp
benchmarkMatrixMatrix.cpp
benchmarkArray1DR2TensorMultiplication.cpp
benchmarkSparsityGeneration.cpp
benchmarkArrayOfArraysReduce.cpp
benchmarkArrayOfArraysNodeToElementMapConstruction.cpp
benchmarkEigendecomposition.cpp
)

if (NOT ${ENABLE_BENCHMARKS})
if( NOT ${ENABLE_BENCHMARKS} )
message(FATAL_ERROR "Benchmarks not enabled!")
endif()

#
# Add gtest C++ based tests
# Add benchmarks
#
foreach(benchmark ${benchmarkSources})
foreach( benchmark ${benchmarkSources} )
get_filename_component( benchmark_name ${benchmark} NAME_WE )
blt_add_executable( NAME ${benchmark_name}
SOURCES ${benchmark} ${benchmark_name}Kernels.cpp
Expand All @@ -33,10 +40,10 @@ foreach(benchmark ${benchmarkSources})
# blt_add_target_compile_flags( TO ${benchmark_name}
# FLAGS -fsave-optimization-record )

blt_add_benchmark(NAME ${benchmark_name}
COMMAND ${benchmark_name})
blt_add_benchmark( NAME ${benchmark_name}
COMMAND ${benchmark_name} )

install(TARGETS ${benchmark_name}
DESTINATION bin)
install( TARGETS ${benchmark_name}
DESTINATION bin )

endforeach()
2 changes: 1 addition & 1 deletion benchmarks/benchmarkArray1DR2TensorMultiplication.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/benchmarkArray1DR2TensorMultiplicationKernels.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down Expand Up @@ -156,7 +156,7 @@ void ArrayOfR2TensorsNative< PERMUTATION >::
RAJAViewKernel( RajaView< VALUE_TYPE const, PERMUTATION > const & a,
RajaView< VALUE_TYPE const, PERMUTATION > const & b,
RajaView< VALUE_TYPE, PERMUTATION > const & c )
{ KERNEL( a.layout.sizes[ 0 ], a( i, j, l ), b( i, l, k ), c( i, j, k ) ); }
{ KERNEL( getRAJAViewLayout( a ).sizes[ 0 ], a( i, j, l ), b( i, l, k ), c( i, j, k ) ); }

template<>
void ArrayOfR2TensorsNative< RAJA::PERM_IJK >::
Expand Down Expand Up @@ -245,7 +245,7 @@ void ArrayOfR2TensorsRAJA< PERMUTATION, POLICY >::
RAJAViewKernel( RajaView< VALUE_TYPE const, PERMUTATION > const & a,
RajaView< VALUE_TYPE const, PERMUTATION > const & b,
RajaView< VALUE_TYPE, PERMUTATION > const & c )
{ RAJA_KERNEL( a.layout.sizes[ 0 ], a( i, j, l ), b( i, l, k ), c( i, j, k ) ); }
{ RAJA_KERNEL( getRAJAViewLayout( a ).sizes[ 0 ], a( i, j, l ), b( i, l, k ), c( i, j, k ) ); }

template< typename POLICY >
void pointerRajaHelper( RAJA::PERM_IJK,
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/benchmarkArray1DR2TensorMultiplicationKernels.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down Expand Up @@ -240,7 +240,7 @@ class ArrayOfR2TensorsRAJA : private ArrayOfR2TensorsNative< PERMUTATION >
}

~ArrayOfR2TensorsRAJA()
{ this->m_c.move( MemorySpace::CPU ); }
{ this->m_c.move( MemorySpace::host ); }

void fortranView() const
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarkArrayOfArraysReduce.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarkArrayOfArraysReduceKernels.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarkArrayOfArraysReduceKernels.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarkEigendecomposition.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarkEigendecompositionKernels.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarkEigendecompositionKernels.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarkHelpers.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarkInnerProduct.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/benchmarkInnerProductKernels.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down Expand Up @@ -62,7 +62,7 @@ VALUE_TYPE InnerProductNative::
VALUE_TYPE InnerProductNative::
RAJAViewKernel( RajaView< VALUE_TYPE const, RAJA::PERM_I > const & a,
RajaView< VALUE_TYPE const, RAJA::PERM_I > const & b )
{ INNER_PRODUCT_KERNEL( a.layout.sizes[ 0 ], a( i ), b( i ) ); }
{ INNER_PRODUCT_KERNEL( getRAJAViewLayout( a ).sizes[ 0 ], a( i ), b( i ) ); }

VALUE_TYPE InnerProductNative::
pointerKernel( INDEX_TYPE const N,
Expand Down Expand Up @@ -98,7 +98,7 @@ template< typename POLICY >
VALUE_TYPE InnerProductRAJA< POLICY >::
RAJAViewKernel( RajaView< VALUE_TYPE const, RAJA::PERM_I > const & a,
RajaView< VALUE_TYPE const, RAJA::PERM_I > const & b )
{ INNER_PRODUCT_KERNEL_RAJA( a.layout.sizes[ 0 ], a( i ), b( i ) ); }
{ INNER_PRODUCT_KERNEL_RAJA( getRAJAViewLayout( a ).sizes[ 0 ], a( i ), b( i ) ); }

template< typename POLICY >
VALUE_TYPE InnerProductRAJA< POLICY >::
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarkInnerProductKernels.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarkMatrixMatrix.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/benchmarkMatrixMatrixKernels.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down Expand Up @@ -90,7 +90,7 @@ void MatrixMatrixNative< PERMUTATION >::
RAJAViewKernel( RajaView< VALUE_TYPE const, PERMUTATION > const & a,
RajaView< VALUE_TYPE const, PERMUTATION > const & b,
RajaView< VALUE_TYPE, PERMUTATION > const & c )
{ MATRIX_MATRIX_KERNEL( a.layout.sizes[ 0 ], a.layout.sizes[ 1 ], b.layout.sizes[ 1 ], a( i, k ), b( k, j ), c( i, j ) ); }
{ MATRIX_MATRIX_KERNEL( getRAJAViewLayout( a ).sizes[ 0 ], getRAJAViewLayout( a ).sizes[ 1 ], getRAJAViewLayout( b ).sizes[ 1 ], a( i, k ), b( k, j ), c( i, j ) ); }

template<>
void MatrixMatrixNative< RAJA::PERM_IJ >::
Expand Down Expand Up @@ -155,7 +155,7 @@ void MatrixMatrixRAJA< PERMUTATION, POLICY >::
RAJAViewKernel( RajaView< VALUE_TYPE const, PERMUTATION > const & a,
RajaView< VALUE_TYPE const, PERMUTATION > const & b,
RajaView< VALUE_TYPE, PERMUTATION > const & c )
{ MATRIX_MATRIX_KERNEL_RAJA( a.layout.sizes[ 0 ], a.layout.sizes[ 1 ], b.layout.sizes[ 1 ], a( i, k ), b( k, j ), c( i, j ) ); }
{ MATRIX_MATRIX_KERNEL_RAJA( getRAJAViewLayout( a ).sizes[ 0 ], getRAJAViewLayout( a ).sizes[ 1 ], getRAJAViewLayout( b ).sizes[ 1 ], a( i, k ), b( k, j ), c( i, j ) ); }

template< typename POLICY >
void RAJAPointerKernelHelper( RAJA::PERM_IJ,
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/benchmarkMatrixMatrixKernels.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down Expand Up @@ -170,7 +170,7 @@ class MatrixMatrixRAJA : public MatrixMatrixNative< PERMUTATION >
}

~MatrixMatrixRAJA()
{ this->m_c.move( MemorySpace::CPU, false ); }
{ this->m_c.move( MemorySpace::host, false ); }

void fortranView() const
{
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarkMatrixVector.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Lawrence Livermore National Security, LLC and LvArray contributors.
* Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
* All rights reserved.
* See the LICENSE file for details.
* SPDX-License-Identifier: (BSD-3-Clause)
Expand Down
Loading