diff --git a/benchmarks/benchmarkArray1DR2TensorMultiplication.cpp b/benchmarks/benchmarkArray1DR2TensorMultiplication.cpp index 50fb6a09..c58c9865 100644 --- a/benchmarks/benchmarkArray1DR2TensorMultiplication.cpp +++ b/benchmarks/benchmarkArray1DR2TensorMultiplication.cpp @@ -218,12 +218,12 @@ void pointerRAJA( benchmark::State & state ) INDEX_TYPE const SERIAL_SIZE = (2 << 18) - 87; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) INDEX_TYPE const OMP_SIZE = (2 << 22) - 87; #endif // The non Array benchmarks could be run without chai, but then what's the point. -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) constexpr INDEX_TYPE CUDA_SIZE = (2 << 24) - 87; #endif @@ -271,11 +271,11 @@ void registerBenchmarks() }, std::make_tuple( SERIAL_SIZE, RAJA::PERM_IJK {}, serialPolicy {} ) , std::make_tuple( SERIAL_SIZE, RAJA::PERM_KJI {}, serialPolicy {} ) - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) , std::make_tuple( OMP_SIZE, RAJA::PERM_IJK {}, parallelHostPolicy {} ) , std::make_tuple( OMP_SIZE, RAJA::PERM_KJI {}, parallelHostPolicy {} ) #endif - #if defined(USE_CUDA) && defined(USE_CHAI) + #if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::make_tuple( CUDA_SIZE, RAJA::PERM_IJK {}, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) , std::make_tuple( CUDA_SIZE, RAJA::PERM_KJI {}, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) #endif @@ -295,11 +295,11 @@ int main( int argc, char * * argv ) LVARRAY_LOG( "VALUE_TYPE = " << LvArray::system::demangleType< LvArray::benchmarking::VALUE_TYPE >() ); LVARRAY_LOG( "Serial problems of size ( " << LvArray::benchmarking::SERIAL_SIZE << ", 3, 3 )." ); -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) LVARRAY_LOG( "OMP problems of size ( " << LvArray::benchmarking::OMP_SIZE << ", 3, 3 )." ); #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) LVARRAY_LOG( "CUDA problems of size ( " << LvArray::benchmarking::CUDA_SIZE << ", 3, 3 )." ); #endif diff --git a/benchmarks/benchmarkArray1DR2TensorMultiplicationKernels.cpp b/benchmarks/benchmarkArray1DR2TensorMultiplicationKernels.cpp index ba59046f..70c0ef50 100644 --- a/benchmarks/benchmarkArray1DR2TensorMultiplicationKernels.cpp +++ b/benchmarks/benchmarkArray1DR2TensorMultiplicationKernels.cpp @@ -290,12 +290,12 @@ template class ArrayOfR2TensorsNative< RAJA::PERM_KJI >; template class ArrayOfR2TensorsRAJA< RAJA::PERM_IJK, serialPolicy >; template class ArrayOfR2TensorsRAJA< RAJA::PERM_KJI, serialPolicy >; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) template class ArrayOfR2TensorsRAJA< RAJA::PERM_IJK, parallelHostPolicy >; template class ArrayOfR2TensorsRAJA< RAJA::PERM_KJI, parallelHostPolicy >; #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) template class ArrayOfR2TensorsRAJA< RAJA::PERM_IJK, RAJA::cuda_exec< THREADS_PER_BLOCK > >; template class ArrayOfR2TensorsRAJA< RAJA::PERM_KJI, RAJA::cuda_exec< THREADS_PER_BLOCK > >; #endif diff --git a/benchmarks/benchmarkArrayOfArraysNodeToElementMapConstruction.cpp b/benchmarks/benchmarkArrayOfArraysNodeToElementMapConstruction.cpp index 9d4bc1bc..fdefc878 100644 --- a/benchmarks/benchmarkArrayOfArraysNodeToElementMapConstruction.cpp +++ b/benchmarks/benchmarkArrayOfArraysNodeToElementMapConstruction.cpp @@ -67,7 +67,7 @@ void registerBenchmarks() REGISTER_BENCHMARK_TEMPLATE( WRAP( { nx, ny, nz } ), overAllocation, POLICY ); REGISTER_BENCHMARK_TEMPLATE( WRAP( { nx, ny, nz } ), resizeFromCapacities, POLICY ); }, std::make_tuple( NX, NY, NZ, serialPolicy {} ) - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) , std::make_tuple( NX, NY, NZ, parallelHostPolicy {} ) #endif ); diff --git a/benchmarks/benchmarkArrayOfArraysNodeToElementMapConstructionKernels.cpp b/benchmarks/benchmarkArrayOfArraysNodeToElementMapConstructionKernels.cpp index 6df04a73..8ec060a8 100644 --- a/benchmarks/benchmarkArrayOfArraysNodeToElementMapConstructionKernels.cpp +++ b/benchmarks/benchmarkArrayOfArraysNodeToElementMapConstructionKernels.cpp @@ -127,7 +127,7 @@ resizeFromCapacities( ArrayView< INDEX_TYPE const, 2, 1, INDEX_TYPE, DEFAULT_BUF // Explicit instantiation of NodeToElemMapConstruction. template class NodeToElemMapConstruction< serialPolicy >; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) template class NodeToElemMapConstruction< parallelHostPolicy >; #endif diff --git a/benchmarks/benchmarkArrayOfArraysNodeToElementMapConstructionKernels.hpp b/benchmarks/benchmarkArrayOfArraysNodeToElementMapConstructionKernels.hpp index 999ab47f..f8fba38a 100644 --- a/benchmarks/benchmarkArrayOfArraysNodeToElementMapConstructionKernels.hpp +++ b/benchmarks/benchmarkArrayOfArraysNodeToElementMapConstructionKernels.hpp @@ -49,7 +49,7 @@ class NaiveNodeToElemMapConstruction { CALI_CXX_MARK_SCOPE( "~NaiveNodeToElemMapConstruction" ); - // #if defined(USE_OPENMP) + // #if defined(LVARRAY_USE_OPENMP) // using EXEC_POLICY = parallelHostPolicy; // #else using EXEC_POLICY = serialPolicy; diff --git a/benchmarks/benchmarkEigendecomposition.cpp b/benchmarks/benchmarkEigendecomposition.cpp index 99581856..0683de66 100644 --- a/benchmarks/benchmarkEigendecomposition.cpp +++ b/benchmarks/benchmarkEigendecomposition.cpp @@ -38,13 +38,13 @@ void eigenvectors( benchmark::State & state ) INDEX_TYPE const SERIAL_SIZE_2x2 = (2 << 22) - 87; INDEX_TYPE const SERIAL_SIZE_3x3 = (2 << 19) - 87; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) INDEX_TYPE const OMP_SIZE_2x2 = (2 << 24) - 87; INDEX_TYPE const OMP_SIZE_3x3 = (2 << 23) - 87; #endif // The non Array benchmarks could be run without chai, but then what's the point. -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) constexpr INDEX_TYPE CUDA_SIZE_2x2 = (2 << 24) - 87; constexpr INDEX_TYPE CUDA_SIZE_3x3 = (2 << 24) - 87; #endif @@ -67,13 +67,13 @@ void registerBenchmarks() , std::make_tuple( SERIAL_SIZE_2x2, std::integral_constant< int, 2 > {}, RAJA::PERM_JI {}, RAJA::PERM_KJI {}, serialPolicy {} ) , std::make_tuple( SERIAL_SIZE_3x3, std::integral_constant< int, 3 > {}, RAJA::PERM_IJ {}, RAJA::PERM_IJK {}, serialPolicy {} ) , std::make_tuple( SERIAL_SIZE_3x3, std::integral_constant< int, 3 > {}, RAJA::PERM_JI {}, RAJA::PERM_KJI {}, serialPolicy {} ) - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) , std::make_tuple( OMP_SIZE_2x2, std::integral_constant< int, 2 > {}, RAJA::PERM_IJ {}, RAJA::PERM_IJK {}, parallelHostPolicy {} ) , std::make_tuple( OMP_SIZE_2x2, std::integral_constant< int, 2 > {}, RAJA::PERM_JI {}, RAJA::PERM_KJI {}, parallelHostPolicy {} ) , std::make_tuple( OMP_SIZE_3x3, std::integral_constant< int, 3 > {}, RAJA::PERM_IJ {}, RAJA::PERM_IJK {}, parallelHostPolicy {} ) , std::make_tuple( OMP_SIZE_3x3, std::integral_constant< int, 3 > {}, RAJA::PERM_JI {}, RAJA::PERM_KJI {}, parallelHostPolicy {} ) #endif - #if defined(USE_CUDA) && defined(USE_CHAI) + #if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::make_tuple( CUDA_SIZE_2x2, std::integral_constant< int, 2 > {}, RAJA::PERM_IJ {}, RAJA::PERM_IJK {}, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) , std::make_tuple( CUDA_SIZE_2x2, std::integral_constant< int, 2 > {}, RAJA::PERM_JI {}, RAJA::PERM_KJI {}, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) , std::make_tuple( CUDA_SIZE_3x3, std::integral_constant< int, 3 > {}, RAJA::PERM_IJ {}, RAJA::PERM_IJK {}, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) @@ -97,12 +97,12 @@ int main( int argc, char * * argv ) LVARRAY_LOG( "Serial number of 2x2 matrices = " << LvArray::benchmarking::SERIAL_SIZE_2x2 ); LVARRAY_LOG( "Serial number of 3x3 matrices = " << LvArray::benchmarking::SERIAL_SIZE_3x3 ); -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) LVARRAY_LOG( "OMP number of 2x2 matrices = " << LvArray::benchmarking::OMP_SIZE_2x2 ); LVARRAY_LOG( "OMP number of 3x3 matrices = " << LvArray::benchmarking::OMP_SIZE_3x3 ); #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) LVARRAY_LOG( "CUDA number of 2x2 matrices = " << LvArray::benchmarking::CUDA_SIZE_2x2 ); LVARRAY_LOG( "CUDA number of 3x3 matrices = " << LvArray::benchmarking::CUDA_SIZE_3x3 ); #endif diff --git a/benchmarks/benchmarkEigendecompositionKernels.cpp b/benchmarks/benchmarkEigendecompositionKernels.cpp index 83c4ea90..22136c96 100644 --- a/benchmarks/benchmarkEigendecompositionKernels.cpp +++ b/benchmarks/benchmarkEigendecompositionKernels.cpp @@ -41,14 +41,14 @@ template class Eigendecomposition< 2, RAJA::PERM_JI, RAJA::PERM_KJI, serialPolic template class Eigendecomposition< 3, RAJA::PERM_IJ, RAJA::PERM_IJK, serialPolicy >; template class Eigendecomposition< 3, RAJA::PERM_JI, RAJA::PERM_KJI, serialPolicy >; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) template class Eigendecomposition< 2, RAJA::PERM_IJ, RAJA::PERM_IJK, parallelHostPolicy >; template class Eigendecomposition< 2, RAJA::PERM_JI, RAJA::PERM_KJI, parallelHostPolicy >; template class Eigendecomposition< 3, RAJA::PERM_IJ, RAJA::PERM_IJK, parallelHostPolicy >; template class Eigendecomposition< 3, RAJA::PERM_JI, RAJA::PERM_KJI, parallelHostPolicy >; #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) template class Eigendecomposition< 2, RAJA::PERM_IJ, RAJA::PERM_IJK, parallelDevicePolicy< THREADS_PER_BLOCK > >; template class Eigendecomposition< 2, RAJA::PERM_JI, RAJA::PERM_KJI, parallelDevicePolicy< THREADS_PER_BLOCK > >; template class Eigendecomposition< 3, RAJA::PERM_IJ, RAJA::PERM_IJK, parallelDevicePolicy< THREADS_PER_BLOCK > >; diff --git a/benchmarks/benchmarkHelpers.hpp b/benchmarks/benchmarkHelpers.hpp index aac5ee67..564b4592 100644 --- a/benchmarks/benchmarkHelpers.hpp +++ b/benchmarks/benchmarkHelpers.hpp @@ -18,7 +18,7 @@ #include #include -#if defined(USE_CALIPER) +#if defined(LVARRAY_USE_CALIPER) #include #define CALI_CXX_MARK_PRETTY_FUNCTION cali::Function __cali_ann ## __func__( __PRETTY_FUNCTION__ ) #else @@ -32,7 +32,7 @@ namespace LvArray using namespace testing; -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) static_assert( std::is_same< DEFAULT_BUFFER< int >, ChaiBuffer< int > >::value, "The default buffer should be ChaiBuffer when chai is enabled." ); #endif diff --git a/benchmarks/benchmarkInnerProduct.cpp b/benchmarks/benchmarkInnerProduct.cpp index d8106301..0defe83e 100644 --- a/benchmarks/benchmarkInnerProduct.cpp +++ b/benchmarks/benchmarkInnerProduct.cpp @@ -119,12 +119,12 @@ void pointerRAJA( benchmark::State & state ) INDEX_TYPE const SERIAL_SIZE = (2 << 20) + 573; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) INDEX_TYPE const OMP_SIZE = SERIAL_SIZE; #endif // The non Array benchmarks could be run without chai, but then what's the point. -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) INDEX_TYPE const CUDA_SIZE = SERIAL_SIZE; #endif @@ -153,10 +153,10 @@ void registerBenchmarks() REGISTER_BENCHMARK_TEMPLATE( { size }, pointerRAJA, POLICY ); }, std::make_tuple( SERIAL_SIZE, serialPolicy {} ) - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) , std::make_tuple( OMP_SIZE, parallelHostPolicy {} ) #endif - #if defined(USE_CUDA) && defined(USE_CHAI) + #if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::make_tuple( CUDA_SIZE, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) #endif ); @@ -178,11 +178,11 @@ int main( int argc, char * * argv ) LVARRAY_LOG( "Serial problems of size ( " << LvArray::benchmarking::SERIAL_SIZE << " )." ); -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) LVARRAY_LOG( "OMP problems of size ( " << LvArray::benchmarking::OMP_SIZE << " )." ); #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) LVARRAY_LOG( "CUDA problems of size ( " << LvArray::benchmarking::CUDA_SIZE << " )." ); #endif diff --git a/benchmarks/benchmarkInnerProductKernels.cpp b/benchmarks/benchmarkInnerProductKernels.cpp index 00e228ee..0874d8e4 100644 --- a/benchmarks/benchmarkInnerProductKernels.cpp +++ b/benchmarks/benchmarkInnerProductKernels.cpp @@ -109,11 +109,11 @@ pointerKernel( INDEX_TYPE const N, template class InnerProductRAJA< serialPolicy >; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) template class InnerProductRAJA< parallelHostPolicy >; #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) template class InnerProductRAJA< RAJA::cuda_exec< THREADS_PER_BLOCK > >; #endif diff --git a/benchmarks/benchmarkMatrixMatrix.cpp b/benchmarks/benchmarkMatrixMatrix.cpp index f65696f4..19a3df9f 100644 --- a/benchmarks/benchmarkMatrixMatrix.cpp +++ b/benchmarks/benchmarkMatrixMatrix.cpp @@ -121,13 +121,13 @@ INDEX_TYPE const SERIAL_N = (2 << 7) + 73; INDEX_TYPE const SERIAL_L = (2 << 7) - 71; INDEX_TYPE const SERIAL_M = (2 << 7) - 3; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) INDEX_TYPE const OMP_N = SERIAL_N; INDEX_TYPE const OMP_L = SERIAL_L; INDEX_TYPE const OMP_M = SERIAL_M; #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) INDEX_TYPE const CUDA_N = SERIAL_N; INDEX_TYPE const CUDA_L = SERIAL_L; INDEX_TYPE const CUDA_M = SERIAL_M; @@ -169,11 +169,11 @@ void registerBenchmarks() }, std::make_tuple( SERIAL_N, SERIAL_L, SERIAL_M, RAJA::PERM_IJ {}, serialPolicy {} ) , std::make_tuple( SERIAL_N, SERIAL_L, SERIAL_M, RAJA::PERM_JI {}, serialPolicy {} ) - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) , std::make_tuple( OMP_N, SERIAL_L, OMP_M, RAJA::PERM_IJ {}, parallelHostPolicy {} ) , std::make_tuple( OMP_N, SERIAL_L, OMP_M, RAJA::PERM_JI {}, parallelHostPolicy {} ) #endif - #if defined(USE_CUDA) && defined(USE_CHAI) + #if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::make_tuple( CUDA_N, SERIAL_L, CUDA_M, RAJA::PERM_IJ {}, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) , std::make_tuple( CUDA_N, SERIAL_L, CUDA_M, RAJA::PERM_JI {}, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) #endif @@ -196,12 +196,12 @@ int main( int argc, char * * argv ) LVARRAY_LOG( "Serial problems of size ( " << LvArray::benchmarking::SERIAL_N << ", " << LvArray::benchmarking::SERIAL_L << ", " << LvArray::benchmarking::SERIAL_M << " )." ); -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) LVARRAY_LOG( "OMP problems of size ( " << LvArray::benchmarking::OMP_N << ", " << LvArray::benchmarking::OMP_L << ", " << LvArray::benchmarking::OMP_M << " )." ); #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) LVARRAY_LOG( "CUDA problems of size ( " << LvArray::benchmarking::CUDA_N << ", " << LvArray::benchmarking::CUDA_L << ", " << LvArray::benchmarking::CUDA_M << " )." ); #endif diff --git a/benchmarks/benchmarkMatrixMatrixKernels.cpp b/benchmarks/benchmarkMatrixMatrixKernels.cpp index 1e7230c5..5aa546f9 100644 --- a/benchmarks/benchmarkMatrixMatrixKernels.cpp +++ b/benchmarks/benchmarkMatrixMatrixKernels.cpp @@ -204,14 +204,14 @@ template class MatrixMatrixNative< RAJA::PERM_JI >; template class MatrixMatrixRAJA< RAJA::PERM_IJ, serialPolicy >; template class MatrixMatrixRAJA< RAJA::PERM_JI, serialPolicy >; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) template class MatrixMatrixRAJA< RAJA::PERM_IJ, parallelHostPolicy >; template class MatrixMatrixRAJA< RAJA::PERM_JI, parallelHostPolicy >; #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) template class MatrixMatrixRAJA< RAJA::PERM_IJ, RAJA::cuda_exec< THREADS_PER_BLOCK > >; template class MatrixMatrixRAJA< RAJA::PERM_JI, RAJA::cuda_exec< THREADS_PER_BLOCK > >; diff --git a/benchmarks/benchmarkMatrixVector.cpp b/benchmarks/benchmarkMatrixVector.cpp index 4740882a..535a4f34 100644 --- a/benchmarks/benchmarkMatrixVector.cpp +++ b/benchmarks/benchmarkMatrixVector.cpp @@ -161,11 +161,11 @@ void registerBenchmarks() }, std::make_tuple( SERIAL_N, SERIAL_M, RAJA::PERM_IJ {}, serialPolicy {} ) , std::make_tuple( SERIAL_N, SERIAL_M, RAJA::PERM_JI {}, serialPolicy {} ) - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) , std::make_tuple( OMP_N, OMP_M, RAJA::PERM_IJ {}, parallelHostPolicy {} ) , std::make_tuple( OMP_N, OMP_M, RAJA::PERM_JI {}, parallelHostPolicy {} ) #endif - #if defined(USE_CUDA) && defined(USE_CHAI) + #if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::make_tuple( CUDA_N, CUDA_M, RAJA::PERM_IJ {}, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) , std::make_tuple( CUDA_N, CUDA_M, RAJA::PERM_JI {}, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) #endif @@ -188,12 +188,12 @@ int main( int argc, char * * argv ) LVARRAY_LOG( "Serial problems of size ( " << LvArray::benchmarking::SERIAL_N << ", " << LvArray::benchmarking::SERIAL_M << " )." ); -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) LVARRAY_LOG( "OMP problems of size ( " << LvArray::benchmarking::OMP_N << ", " << LvArray::benchmarking::OMP_M << " )." ); #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) LVARRAY_LOG( "CUDA problems of size ( " << LvArray::benchmarking::CUDA_N << ", " << LvArray::benchmarking::CUDA_M << " )." ); #endif diff --git a/benchmarks/benchmarkMatrixVectorKernels.cpp b/benchmarks/benchmarkMatrixVectorKernels.cpp index 7ec8a51d..318697d8 100644 --- a/benchmarks/benchmarkMatrixVectorKernels.cpp +++ b/benchmarks/benchmarkMatrixVectorKernels.cpp @@ -171,14 +171,14 @@ template class MatrixVectorNative< RAJA::PERM_JI >; template class MatrixVectorRAJA< RAJA::PERM_IJ, serialPolicy >; template class MatrixVectorRAJA< RAJA::PERM_JI, serialPolicy >; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) template class MatrixVectorRAJA< RAJA::PERM_IJ, parallelHostPolicy >; template class MatrixVectorRAJA< RAJA::PERM_JI, parallelHostPolicy >; #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) template class MatrixVectorRAJA< RAJA::PERM_IJ, RAJA::cuda_exec< THREADS_PER_BLOCK > >; template class MatrixVectorRAJA< RAJA::PERM_JI, RAJA::cuda_exec< THREADS_PER_BLOCK > >; diff --git a/benchmarks/benchmarkOuterProduct.cpp b/benchmarks/benchmarkOuterProduct.cpp index a6062222..cbc22219 100644 --- a/benchmarks/benchmarkOuterProduct.cpp +++ b/benchmarks/benchmarkOuterProduct.cpp @@ -120,12 +120,12 @@ void pointerRAJA( benchmark::State & state ) INDEX_TYPE const SERIAL_N = (2 << 9) + 73; INDEX_TYPE const SERIAL_M = (2 << 9) - 71; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) INDEX_TYPE const OMP_N = (2 << 9) + 73; INDEX_TYPE const OMP_M = (2 << 9) - 71; #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) INDEX_TYPE const CUDA_N = (2 << 9) + 73; INDEX_TYPE const CUDA_M = (2 << 9) - 71; #endif @@ -165,11 +165,11 @@ void registerBenchmarks() }, std::make_tuple( SERIAL_N, SERIAL_M, RAJA::PERM_IJ {}, serialPolicy {} ) , std::make_tuple( SERIAL_N, SERIAL_M, RAJA::PERM_JI {}, serialPolicy {} ) - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) , std::make_tuple( OMP_N, OMP_M, RAJA::PERM_IJ {}, parallelHostPolicy {} ) , std::make_tuple( OMP_N, OMP_M, RAJA::PERM_JI {}, parallelHostPolicy {} ) #endif - #if defined(USE_CUDA) && defined(USE_CHAI) + #if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::make_tuple( CUDA_N, CUDA_M, RAJA::PERM_IJ {}, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) , std::make_tuple( CUDA_N, CUDA_M, RAJA::PERM_JI {}, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) #endif @@ -192,12 +192,12 @@ int main( int argc, char * * argv ) LVARRAY_LOG( "Serial problems of size ( " << LvArray::benchmarking::SERIAL_N << ", " << LvArray::benchmarking::SERIAL_M << " )." ); -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) LVARRAY_LOG( "OMP problems of size ( " << LvArray::benchmarking::OMP_N << ", " << LvArray::benchmarking::OMP_M << " )." ); #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) LVARRAY_LOG( "CUDA problems of size ( " << LvArray::benchmarking::CUDA_N << ", " << LvArray::benchmarking::CUDA_M << " )." ); #endif diff --git a/benchmarks/benchmarkOuterProductKernels.cpp b/benchmarks/benchmarkOuterProductKernels.cpp index 0d7ebff2..83bf9670 100644 --- a/benchmarks/benchmarkOuterProductKernels.cpp +++ b/benchmarks/benchmarkOuterProductKernels.cpp @@ -170,12 +170,12 @@ template class OuterProductNative< RAJA::PERM_JI >; template class OuterProductRAJA< RAJA::PERM_IJ, serialPolicy >; template class OuterProductRAJA< RAJA::PERM_JI, serialPolicy >; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) template class OuterProductRAJA< RAJA::PERM_IJ, parallelHostPolicy >; template class OuterProductRAJA< RAJA::PERM_JI, parallelHostPolicy >; #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) template class OuterProductRAJA< RAJA::PERM_IJ, RAJA::cuda_exec< THREADS_PER_BLOCK > >; template class OuterProductRAJA< RAJA::PERM_JI, RAJA::cuda_exec< THREADS_PER_BLOCK > >; #endif diff --git a/benchmarks/benchmarkReduce.cpp b/benchmarks/benchmarkReduce.cpp index 9e1591f7..9127a3cc 100644 --- a/benchmarks/benchmarkReduce.cpp +++ b/benchmarks/benchmarkReduce.cpp @@ -117,10 +117,10 @@ void pointerRAJA( benchmark::State & state ) } INDEX_TYPE const SERIAL_SIZE = (2 << 20) + 573; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) INDEX_TYPE const OMP_SIZE = SERIAL_SIZE; #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) INDEX_TYPE const CUDA_SIZE = SERIAL_SIZE; #endif @@ -149,10 +149,10 @@ void registerBenchmarks() REGISTER_BENCHMARK_TEMPLATE( { size }, pointerRAJA, POLICY ); }, std::make_tuple( SERIAL_SIZE, serialPolicy {} ) - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) , std::make_tuple( OMP_SIZE, parallelHostPolicy {} ) #endif - #if defined(USE_CUDA) && defined(USE_CHAI) + #if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::make_tuple( CUDA_SIZE, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) #endif ); @@ -175,11 +175,11 @@ int main( int argc, char * * argv ) LVARRAY_LOG( "Serial problems of size ( " << LvArray::benchmarking::SERIAL_SIZE << " )." ); -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) LVARRAY_LOG( "OMP problems of size ( " << LvArray::benchmarking::OMP_SIZE << " )." ); #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) LVARRAY_LOG( "CUDA problems of size ( " << LvArray::benchmarking::CUDA_SIZE << " )." ); #endif diff --git a/benchmarks/benchmarkReduceKernels.cpp b/benchmarks/benchmarkReduceKernels.cpp index 8502b64f..11ea75da 100644 --- a/benchmarks/benchmarkReduceKernels.cpp +++ b/benchmarks/benchmarkReduceKernels.cpp @@ -81,11 +81,11 @@ VALUE_TYPE ReduceRAJA< POLICY >::pointerKernel( VALUE_TYPE const * const LVARRAY template class ReduceRAJA< serialPolicy >; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) template class ReduceRAJA< parallelHostPolicy >; #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) template class ReduceRAJA< RAJA::cuda_exec< THREADS_PER_BLOCK > >; #endif diff --git a/benchmarks/benchmarkSparsityGeneration.cpp b/benchmarks/benchmarkSparsityGeneration.cpp index 5779d748..f2f961ea 100644 --- a/benchmarks/benchmarkSparsityGeneration.cpp +++ b/benchmarks/benchmarkSparsityGeneration.cpp @@ -93,11 +93,11 @@ void addToRow( benchmark::State & state ) int const NO_ALLOCATION_SIZE = 10; int const SERIAL_SIZE = 100; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) int const OMP_SIZE = 100; #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) int const CUDA_SIZE = 100; #endif @@ -120,10 +120,10 @@ void registerBenchmarks() REGISTER_BENCHMARK_TEMPLATE( WRAP( { size, size, size } ), nodeLoopPreallocatedRAJA, POLICY ); }, std::make_tuple( SERIAL_SIZE, serialPolicy {} ) - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) , std::make_tuple( OMP_SIZE, parallelHostPolicy {} ) #endif - #if defined(USE_CUDA) && defined(USE_CHAI) + #if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::make_tuple( CUDA_SIZE, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) #endif ); @@ -136,10 +136,10 @@ void registerBenchmarks() REGISTER_BENCHMARK_TEMPLATE( WRAP( { size, size, size } ), addToRow, POLICY ); }, std::make_tuple( SERIAL_SIZE, serialPolicy {} ) - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) , std::make_tuple( OMP_SIZE, parallelHostPolicy {} ) #endif - #if defined(USE_CUDA) && defined(USE_CHAI) + #if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::make_tuple( CUDA_SIZE, parallelDevicePolicy< THREADS_PER_BLOCK > {} ) #endif ); @@ -161,12 +161,12 @@ int main( int argc, char * * argv ) LvArray::benchmarking::INDEX_TYPE size = std::pow( LvArray::benchmarking::SERIAL_SIZE, 3 ); LVARRAY_LOG( "Serial problems of size ( " << size << " )." ); -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) size = std::pow( LvArray::benchmarking::OMP_SIZE, 3 ); LVARRAY_LOG( "OMP problems of size ( " << size << " )." ); #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) size = std::pow( LvArray::benchmarking::CUDA_SIZE, 3 ); LVARRAY_LOG( "CUDA problems of size ( " << size << " )." ); #endif diff --git a/benchmarks/benchmarkSparsityGenerationKernels.cpp b/benchmarks/benchmarkSparsityGenerationKernels.cpp index 838fb28e..2f562ca8 100644 --- a/benchmarks/benchmarkSparsityGenerationKernels.cpp +++ b/benchmarks/benchmarkSparsityGenerationKernels.cpp @@ -142,7 +142,7 @@ resizeExact() CALI_CXX_MARK_SCOPE( "resizeExact" ); std::vector< INDEX_TYPE > nnzPerRow( 3 * m_numNodes ); - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) using RESIZE_POLICY = std::conditional_t< std::is_same< serialPolicy, POLICY >::value, serialPolicy, parallelHostPolicy >; #else using RESIZE_POLICY = serialPolicy; @@ -256,12 +256,12 @@ template void SparsityGenerationNative::generateNodeLoop< SparsityPatternViewT c template class SparsityGenerationRAJA< serialPolicy >; template class CRSMatrixAddToRow< serialPolicy >; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) template class SparsityGenerationRAJA< parallelHostPolicy >; template class CRSMatrixAddToRow< parallelHostPolicy >; #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) template class SparsityGenerationRAJA< parallelDevicePolicy< THREADS_PER_BLOCK > >; template class CRSMatrixAddToRow< parallelDevicePolicy< THREADS_PER_BLOCK > >; #endif diff --git a/benchmarks/benchmarkSparsityGenerationKernels.hpp b/benchmarks/benchmarkSparsityGenerationKernels.hpp index e513da5c..878f82ba 100644 --- a/benchmarks/benchmarkSparsityGenerationKernels.hpp +++ b/benchmarks/benchmarkSparsityGenerationKernels.hpp @@ -27,7 +27,7 @@ using COLUMN_TYPE = std::ptrdiff_t; using ENTRY_TYPE = double; constexpr unsigned long THREADS_PER_BLOCK = 256; -#if defined(USE_CUDA) +#if defined(LVARRAY_USE_CUDA) using ELEM_TO_NODE_PERM = RAJA::PERM_JI; #else using ELEM_TO_NODE_PERM = RAJA::PERM_JI; @@ -117,7 +117,7 @@ class SparsityGenerationNative /// Iterate over all the nodes. m_sparsity.move( MemorySpace::CPU ); - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) using EXEC_POLICY = parallelHostPolicy; #else using EXEC_POLICY = serialPolicy; @@ -241,7 +241,7 @@ class CRSMatrixAddToRow : public SparsityGenerationRAJA< POLICY > { this->resizeExact(); - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) using EXEC_POLICY = parallelHostPolicy; #else using EXEC_POLICY = serialPolicy; @@ -263,7 +263,7 @@ class CRSMatrixAddToRow : public SparsityGenerationRAJA< POLICY > m_matrix.move( MemorySpace::CPU, false ); this->m_nodeToElemMap.move( MemorySpace::CPU, false ); - #if defined(USE_OPENMP) + #if defined(LVARRAY_USE_OPENMP) using EXEC_POLICY = parallelHostPolicy; #else using EXEC_POLICY = serialPolicy; diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 7ecd7d35..0cec35de 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -10,7 +10,7 @@ set( PREPROCESSOR_DEFINES ARRAY_BOUNDS_CHECK set( USE_CONFIGFILE ON CACHE BOOL "" ) foreach( DEP in ${PREPROCESSOR_DEFINES}) if( ${DEP}_FOUND OR ENABLE_${DEP} ) - set(USE_${DEP} TRUE ) + set( LVARRAY_USE_${DEP} TRUE ) endif() endforeach() @@ -29,18 +29,5 @@ endif() configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/LvArrayConfig.hpp.in ${CMAKE_BINARY_DIR}/include/LvArrayConfig.hpp ) -function( make_full_config_file - PREPROCESSOR_VARS ) - foreach( DEP in ${PREPROCESSOR_VARS}) - set(USE_${DEP} TRUE ) - set(GEOSX_USE_${DEP} TRUE ) - set(${DEP} TRUE ) - endforeach() - - configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/LvArrayConfig.hpp.in - ${CMAKE_CURRENT_SOURCE_DIR}/docs/doxygen/LvArrayConfig.hpp ) -endfunction() - - -make_full_config_file( "${PREPROCESSOR_DEFINES}" ) - +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/LvArrayConfig.hpp.in + ${CMAKE_CURRENT_SOURCE_DIR}/docs/doxygen/LvArrayConfig.hpp ) diff --git a/docs/doxygen/LvArrayConfig.hpp b/docs/doxygen/LvArrayConfig.hpp index a0fab3fc..f619b558 100644 --- a/docs/doxygen/LvArrayConfig.hpp +++ b/docs/doxygen/LvArrayConfig.hpp @@ -12,30 +12,18 @@ #pragma once -#define USE_ARRAY_BOUNDS_CHECK +/* #undef LVARRAY_BOUNDS_CHECK */ -#ifndef USE_CHAI -#define USE_CHAI -#endif +#define LVARRAY_USE_CHAI -#ifndef USE_CUDA -#define USE_CUDA -#endif +/* #undef LVARRAY_USE_CUDA */ -#ifndef USE_MPI -#define USE_MPI -#endif +#define LVARRAY_USE_MPI -#ifndef USE_TOTALVIEW_OUTPUT -#define USE_TOTALVIEW_OUTPUT -#endif +/* #undef LVARRAY_USE_TOTALVIEW_OUTPUT */ -#ifndef USE_OPENMP -#define USE_OPENMP -#endif +#define LVARRAY_USE_OPENMP -#ifndef USE_CALIPER -#define USE_CALIPER -#endif +#define LVARRAY_USE_CALIPER -#define LVARRAY_ADDR2LINE_EXEC "/usr/bin/addr2line" +#define LVARRAY_ADDR2LINE_EXEC /usr/bin/addr2line diff --git a/docs/sphinx/Array.rst b/docs/sphinx/Array.rst index 3d00317a..5cc47b89 100644 --- a/docs/sphinx/Array.rst +++ b/docs/sphinx/Array.rst @@ -176,9 +176,9 @@ Finally you can write a recursive function that operates on an ``LvArray::ArrayS *[Source: src/output.hpp]* -Usage with ``USE_ARRAY_BOUNDS_CHECK`` +Usage with ``LVARRAY_BOUNDS_CHECK`` ------------------------------------- -When ``USE_ARRAY_BOUNDS_CHECK`` is defined all accesses via ``operator[]`` and ``operator()`` is checked to make sure the indices are valid. If invalid indices are detected an error message is printed to standard out and the program is aborted. It should be noted that access via ``operator()`` is able to provide a more useful error message upon an invalid access because it has access to all of the indices whereas ``operator[]`` only has access to a single index at a time. ``size( int dim )``, ``linearIndex``, ``emplace`` and ``insert`` will also check that their arguments are in bounds. +When ``LVARRAY_BOUNDS_CHECK`` is defined all accesses via ``operator[]`` and ``operator()`` is checked to make sure the indices are valid. If invalid indices are detected an error message is printed to standard out and the program is aborted. It should be noted that access via ``operator()`` is able to provide a more useful error message upon an invalid access because it has access to all of the indices whereas ``operator[]`` only has access to a single index at a time. ``size( int dim )``, ``linearIndex``, ``emplace`` and ``insert`` will also check that their arguments are in bounds. .. literalinclude:: ../../examples/exampleArray.cpp :language: c++ diff --git a/docs/sphinx/ArrayOfArrays.rst b/docs/sphinx/ArrayOfArrays.rst index 5cb48f5c..7b4cb7c9 100644 --- a/docs/sphinx/ArrayOfArrays.rst +++ b/docs/sphinx/ArrayOfArrays.rst @@ -153,9 +153,9 @@ Calling the explicit ``move`` method with the touch parameter set to ``true`` on *[Source: examples/exampleArrayOfArrays.cpp]* -Usage with ``USE_ARRAY_BOUNDS_CHECK`` +Usage with ``LVARRAY_BOUNDS_CHECK`` ------------------------------------- -When ``USE_ARRAY_BOUNDS_CHECK`` is defined access via ``operator[]`` and ``operator()`` is checked. If an invalid access is detected the program is aborted. Methods such as ``sizeOfArray``, ``insertArray`` and ``emplace`` are also checked. +When ``LVARRAY_BOUNDS_CHECK`` is defined access via ``operator[]`` and ``operator()`` is checked. If an invalid access is detected the program is aborted. Methods such as ``sizeOfArray``, ``insertArray`` and ``emplace`` are also checked. .. literalinclude:: ../../examples/exampleArrayOfArrays.cpp :language: c++ diff --git a/docs/sphinx/ArrayOfSets.rst b/docs/sphinx/ArrayOfSets.rst index 4f7611f0..732da77f 100644 --- a/docs/sphinx/ArrayOfSets.rst +++ b/docs/sphinx/ArrayOfSets.rst @@ -56,9 +56,9 @@ The two types of ``LvArray::ArrayOfSetsView`` obtainable from an ``LvArray::Arra Calling the explicit ``move`` method with the touch parameter set to ``true`` on a view type has the behavior described above. However calling ``move( MemorySpace::CPU )`` on an ``LvArray::ArrayOfSets`` will also touch the offsets (if moving to the GPU the offsets aren't touched). This is the only way to touch the offsets so if an ``LvArray::ArrayOfSets`` was previously on the device then it must be explicitly moved and touched on the host before any modification to the offsets can safely take place. -Usage with ``USE_ARRAY_BOUNDS_CHECK`` +Usage with ``LVARRAY_BOUNDS_CHECK`` ------------------------------------- -When ``USE_ARRAY_BOUNDS_CHECK`` is defined access via ``operator[]`` and ``operator()`` is checked. If an invalid access is detected the program is aborted. Methods such as ``sizeOfArray``, ``insertArray`` and ``emplace`` are also checked. The values passed to ``insertIntoSet`` and ``removeFromSet`` are also checked to ensure they are sorted and contain no duplicates. +When ``LVARRAY_BOUNDS_CHECK`` is defined access via ``operator[]`` and ``operator()`` is checked. If an invalid access is detected the program is aborted. Methods such as ``sizeOfArray``, ``insertArray`` and ``emplace`` are also checked. The values passed to ``insertIntoSet`` and ``removeFromSet`` are also checked to ensure they are sorted and contain no duplicates. Guidelines ---------- diff --git a/docs/sphinx/SortedArray.rst b/docs/sphinx/SortedArray.rst index 2ea79666..abce4a52 100644 --- a/docs/sphinx/SortedArray.rst +++ b/docs/sphinx/SortedArray.rst @@ -46,9 +46,9 @@ It is worth noting that after a ``LvArray::SortedArray`` is moved to the device *[Source: examples/exampleSortedArray.cpp]* -Usage with ``USE_ARRAY_BOUNDS_CHECK`` +Usage with ``LVARRAY_BOUNDS_CHECK`` ------------------------------------- -Like ``LvArray::Array`` when ``USE_ARRAY_BOUNDS_CHECK`` is defined access via ``operator[]`` is checked for invalid access. If an out of bounds access is detected the program is aborted. In addition calls to insert and remove multiple values will error out if the values to insert or remove aren't sorted and unique. +Like ``LvArray::Array`` when ``LVARRAY_BOUNDS_CHECK`` is defined access via ``operator[]`` is checked for invalid access. If an out of bounds access is detected the program is aborted. In addition calls to insert and remove multiple values will error out if the values to insert or remove aren't sorted and unique. .. literalinclude:: ../../examples/exampleSortedArray.cpp :language: c++ diff --git a/docs/sphinx/SparsityPatternAndCRSMatrix.rst b/docs/sphinx/SparsityPatternAndCRSMatrix.rst index 6de46560..21657331 100644 --- a/docs/sphinx/SparsityPatternAndCRSMatrix.rst +++ b/docs/sphinx/SparsityPatternAndCRSMatrix.rst @@ -73,9 +73,9 @@ The three types of ``LvArray::CRSMatrixView`` obtainable from an ``LvArray::CRSM Calling the explicit ``move`` method with the touch parameter set to ``true`` on a view type has the behavior described above. However calling ``move( MemorySpace::CPU )`` on an ``LvArray::CRSMatrix`` or ``LvArray::SparsityPattern`` will also touch the offsets (if moving to the GPU the offsets aren't touched). This is the only way to touch the offsets so if an ``LvArray::CRSMatrix`` was previously on the device then it must be explicitly moved and touched on the host before any modification to the offsets can safely take place. -Usage with ``USE_ARRAY_BOUNDS_CHECK`` +Usage with ``LVARRAY_BOUNDS_CHECK`` ------------------------------------- -When ``USE_ARRAY_BOUNDS_CHECK`` is defined access all row and column access is checked. Methods which expect a sorted unique set of columns check that the columns are indeed sorted and unique. In addition if ``addToRow`` checks that all the given columns are present in the row. +When ``LVARRAY_BOUNDS_CHECK`` is defined access all row and column access is checked. Methods which expect a sorted unique set of columns check that the columns are indeed sorted and unique. In addition if ``addToRow`` checks that all the given columns are present in the row. Guidelines ---------- diff --git a/docs/sphinx/tensorOps.rst b/docs/sphinx/tensorOps.rst index 7e522427..b0396c4c 100644 --- a/docs/sphinx/tensorOps.rst +++ b/docs/sphinx/tensorOps.rst @@ -227,7 +227,7 @@ You can mix and match the data types of the objects and also call the ``tensorOp Bounds checking --------------- -Whatever the argument type the number of dimensions is checked at compile time. For example if you pass a ``double[ 3 ][ 3 ]`` or a three dimensional ``LvArray::ArraySlice`` to ``LvArray::tensorOps::crossProduct`` you will get a compilation error since that function is only implemented for vectors. When passing a c-array as an argument the size of the array is checked at compile time. For example if you pass ``int[ 2 ][ 3 ]`` to ``LvArray::tensorOps::addIdentity`` you will get a compilation error because that function only operates on square matrices. However when passing an ``LvArray::Array*`` object the size is only checked at runtime if ``USE_ARRAY_BOUNDS_CHECK`` is defined. +Whatever the argument type the number of dimensions is checked at compile time. For example if you pass a ``double[ 3 ][ 3 ]`` or a three dimensional ``LvArray::ArraySlice`` to ``LvArray::tensorOps::crossProduct`` you will get a compilation error since that function is only implemented for vectors. When passing a c-array as an argument the size of the array is checked at compile time. For example if you pass ``int[ 2 ][ 3 ]`` to ``LvArray::tensorOps::addIdentity`` you will get a compilation error because that function only operates on square matrices. However when passing an ``LvArray::Array*`` object the size is only checked at runtime if ``LVARRAY_BOUNDS_CHECK`` is defined. .. literalinclude:: ../../examples/exampleTensorOps.cpp :language: c++ diff --git a/examples/exampleArray.cpp b/examples/exampleArray.cpp index fb8b8754..0a388c6c 100644 --- a/examples/exampleArray.cpp +++ b/examples/exampleArray.cpp @@ -8,7 +8,7 @@ // Source includes #include "Array.hpp" #include "MallocBuffer.hpp" -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) #include "ChaiBuffer.hpp" #endif @@ -321,7 +321,7 @@ TEST( Array, arraySlice ) } // Sphinx end before arraySlice -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) // Sphinx start after chaiBuffer CUDA_TEST( Array, chaiBuffer ) { diff --git a/examples/exampleArrayOfArrays.cpp b/examples/exampleArrayOfArrays.cpp index fbe6563b..123fe962 100644 --- a/examples/exampleArrayOfArrays.cpp +++ b/examples/exampleArrayOfArrays.cpp @@ -8,7 +8,7 @@ // Source includes #include "ArrayOfArrays.hpp" #include "MallocBuffer.hpp" -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) #include "ChaiBuffer.hpp" #endif #include "sortedArrayManipulation.hpp" @@ -95,7 +95,7 @@ TEST( ArrayOfArrays, modification ) } // Sphinx end before examples -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) // Sphinx start after view TEST( ArrayOfArrays, view ) { @@ -275,7 +275,7 @@ TEST( ArrayOfArrays, resizeFromCapacities ) } // Sphinx end before resizeFromCapacities -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) // Sphinx start after ChaiBuffer CUDA_TEST( ArrayOfArrays, ChaiBuffer ) { @@ -365,7 +365,7 @@ CUDA_TEST( ArrayOfArrays, ChaiBuffer ) // Sphinx start after bounds check TEST( ArrayOfArrays, boundsCheck ) { -#if defined(USE_ARRAY_BOUNDS_CHECK) +#if defined(LVARRAY_BOUNDS_CHECK) LvArray::ArrayOfArrays< int, std::ptrdiff_t, LvArray::MallocBuffer > arrayOfArrays; // Append an array. diff --git a/examples/exampleBuffers.cpp b/examples/exampleBuffers.cpp index c8e71877..0d0d5d5d 100644 --- a/examples/exampleBuffers.cpp +++ b/examples/exampleBuffers.cpp @@ -8,7 +8,7 @@ // Source includes #include "MallocBuffer.hpp" #include "StackBuffer.hpp" -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) #include "ChaiBuffer.hpp" #endif @@ -79,7 +79,7 @@ TEST( MallocBuffer, nonPOD ) } // Sphinx end before MallocBuffer -#if defined(USE_CHAI) && defined(USE_CUDA) +#if defined(LVARRAY_USE_CHAI) && defined(LVARRAY_USE_CUDA) // Sphinx start after ChaiBuffer captureOnDevice CUDA_TEST( ChaiBuffer, captureOnDevice ) { diff --git a/examples/exampleSortedArray.cpp b/examples/exampleSortedArray.cpp index 1d6f9ea0..d65a4297 100644 --- a/examples/exampleSortedArray.cpp +++ b/examples/exampleSortedArray.cpp @@ -8,7 +8,7 @@ // Source includes #include "SortedArray.hpp" #include "MallocBuffer.hpp" -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) #include "ChaiBuffer.hpp" #endif @@ -59,7 +59,7 @@ TEST( SortedArray, construction ) } // Sphinx end before construction -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) // Sphinx start after ChaiBuffer CUDA_TEST( SortedArray, ChaiBuffer ) { @@ -95,7 +95,7 @@ CUDA_TEST( SortedArray, ChaiBuffer ) // Sphinx end before ChaiBuffer #endif -#if defined(USE_ARRAY_BOUNDS_CHECK) +#if defined(LVARRAY_BOUNDS_CHECK) // Sphinx start after bounds check TEST( SortedArray, boundsCheck ) { diff --git a/examples/exampleSparsityPatternAndCRSMatrix.cpp b/examples/exampleSparsityPatternAndCRSMatrix.cpp index 426a067b..1c7fb04b 100644 --- a/examples/exampleSparsityPatternAndCRSMatrix.cpp +++ b/examples/exampleSparsityPatternAndCRSMatrix.cpp @@ -151,7 +151,7 @@ TEST( CRSMatrix, assimilate ) } // Sphinx end before assimilate -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) // Sphinx start after views TEST( CRSMatrix, views ) { diff --git a/examples/exampleTensorOps.cpp b/examples/exampleTensorOps.cpp index 50d15e2b..94b99c56 100644 --- a/examples/exampleTensorOps.cpp +++ b/examples/exampleTensorOps.cpp @@ -9,7 +9,7 @@ #include "Array.hpp" #include "tensorOps.hpp" #include "MallocBuffer.hpp" -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) #include "ChaiBuffer.hpp" #endif @@ -66,7 +66,7 @@ TEST( tensorOps, AiBi ) } // Sphinx end before inner product -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) // Sphinx start after device CUDA_TEST( tensorOps, device ) { @@ -126,7 +126,7 @@ TEST( tensorOps, boundsCheck ) xArray( 0 ) = 10; -#if defined(USE_ARRAY_BOUNDS_CHECK) +#if defined(LVARRAY_BOUNDS_CHECK) // This will fail at runtime. EXPECT_DEATH_IF_SUPPORTED( LvArray::tensorOps::normalize< 3 >( xArray ), "" ); #endif diff --git a/src/Array.hpp b/src/Array.hpp index 95314d34..8c0a1248 100644 --- a/src/Array.hpp +++ b/src/Array.hpp @@ -93,7 +93,7 @@ class Array : public ArrayView< T, #if !defined(__CUDA_ARCH__) setName( "" ); #endif -#if defined(USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) +#if defined(LVARRAY_USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) Array::TV_ttf_display_type( nullptr ); #endif } @@ -438,7 +438,7 @@ class Array : public ArrayView< T, void setName( std::string const & name ) { this->m_dataBuffer.template setName< decltype(*this) >( name ); } -#if defined(USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) +#if defined(LVARRAY_USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) /** * @brief Static function that will be used by Totalview to display the array contents. * @param av A pointer to the array that is being displayed. diff --git a/src/ArrayOfArraysView.hpp b/src/ArrayOfArraysView.hpp index 9db19084..3cf9fc93 100644 --- a/src/ArrayOfArraysView.hpp +++ b/src/ArrayOfArraysView.hpp @@ -25,12 +25,12 @@ // System includes #include -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK /** * @brief Check that @p i is a valid array index. * @param i The array index to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYOFARRAYS_CHECK_BOUNDS( i ) \ LVARRAY_ERROR_IF( !arrayManipulation::isPositive( i ) || i >= this->size(), \ @@ -40,7 +40,7 @@ * @brief Check that @p i is a valid array index and that @p j is a valid index into that array. * @param i The array index to check. * @param j The index into the array to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYOFARRAYS_CHECK_BOUNDS2( i, j ) \ LVARRAY_ERROR_IF( !arrayManipulation::isPositive( i ) || i >= this->size() || \ @@ -51,7 +51,7 @@ /** * @brief Check that @p i is a valid index to insert an array at. * @param i The array index to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYOFARRAYS_CHECK_INSERT_BOUNDS( i ) \ LVARRAY_ERROR_IF( !arrayManipulation::isPositive( i ) || i > this->size(), \ @@ -61,7 +61,7 @@ * @brief Check that @p i is a valid array index and that @p j is a valid insertion index into that array. * @param i The array index to check. * @param j The index into the array to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYOFARRAYS_CHECK_INSERT_BOUNDS2( i, j ) \ LVARRAY_ERROR_IF( !arrayManipulation::isPositive( i ) || i >= this->size() || \ @@ -73,7 +73,7 @@ * @brief Check that the capacity of array @p i isn't exceeded when the size is increased by @p increase. * @param i The array index to check. * @param increase The increases in the capacity. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYOFARRAYS_CAPACITY_CHECK( i, increase ) \ LVARRAY_ERROR_IF( this->sizeOfArray( i ) + increase > this->capacityOfArray( i ), \ @@ -86,7 +86,7 @@ * @param i The array index to check. * @param previousSize The previous size of the array. * @param increase The increases in the capacity. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYOFARRAYS_ATOMIC_CAPACITY_CHECK( i, previousSize, increase ) \ LVARRAY_ERROR_IF( previousSize + increase > this->capacityOfArray( i ), \ @@ -94,12 +94,12 @@ " sizeOfArray( i )=" << previousSize << " capacityOfArray( i )=" << \ this->capacityOfArray( i ) ) -#else // USE_ARRAY_BOUNDS_CHECK +#else // LVARRAY_BOUNDS_CHECK /** * @brief Check that @p i is a valid array index. * @param i The array index to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYOFARRAYS_CHECK_BOUNDS( i ) @@ -107,14 +107,14 @@ * @brief Check that @p i is a valid array index and that @p j is a valid index into that array. * @param i The array index to check. * @param j The index into the array to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYOFARRAYS_CHECK_BOUNDS2( i, j ) /** * @brief Check that @p i is a valid index to insert an array at. * @param i The array index to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYOFARRAYS_CHECK_INSERT_BOUNDS( i ) @@ -122,7 +122,7 @@ * @brief Check that @p i is a valid array index and that @p j is a valid insertion index into that array. * @param i The array index to check. * @param j The index into the array to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYOFARRAYS_CHECK_INSERT_BOUNDS2( i, j ) @@ -130,7 +130,7 @@ * @brief Check that the capacity of array @p i isn't exceeded when the size is increased by @p increase. * @param i The array index to check. * @param increase The increases in the capacity. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYOFARRAYS_CAPACITY_CHECK( i, increase ) @@ -139,11 +139,11 @@ * @param i The array index to check. * @param previousSize The previous size of the array. * @param increase The increases in the capacity. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYOFARRAYS_ATOMIC_CAPACITY_CHECK( i, previousSize, increase ) -#endif // USE_ARRAY_BOUNDS_CHECK +#endif // LVARRAY_BOUNDS_CHECK namespace LvArray { @@ -509,7 +509,7 @@ class ArrayOfArraysView m_values.move( space, touch ); m_sizes.move( space, touch ); - #if defined(USE_CUDA) + #if defined(LVARRAY_USE_CUDA) if( space == MemorySpace::GPU ) touch = false; #endif m_offsets.move( space, touch ); @@ -625,7 +625,7 @@ class ArrayOfArraysView { LVARRAY_ASSERT( arrayManipulation::isPositive( numSubArrays ) ); - #ifdef USE_ARRAY_BOUNDS_CHECK + #ifdef LVARRAY_BOUNDS_CHECK for( INDEX_TYPE i = 0; i < numSubArrays; ++i ) { LVARRAY_ERROR_IF_LT( capacities[ i ], 0 ); diff --git a/src/ArrayOfSetsView.hpp b/src/ArrayOfSetsView.hpp index 521d0d82..4ddd5ca1 100644 --- a/src/ArrayOfSetsView.hpp +++ b/src/ArrayOfSetsView.hpp @@ -453,7 +453,7 @@ class ArrayOfSetsView : protected ArrayOfArraysView< T, INDEX_TYPE, std::is_cons T * incrementSize( T * const curPtr, INDEX_TYPE const nToAdd ) const LVARRAY_RESTRICT_THIS { LVARRAY_UNUSED_VARIABLE( curPtr ); -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK LVARRAY_ERROR_IF_GT_MSG( m_aos.sizeOfSet( m_indexOfSet ) + nToAdd, m_aos.capacityOfSet( m_indexOfSet ), "ArrayOfSetsView cannot do reallocation." ); #else diff --git a/src/ArraySlice.hpp b/src/ArraySlice.hpp index 9fb4e4e4..3857bc41 100644 --- a/src/ArraySlice.hpp +++ b/src/ArraySlice.hpp @@ -47,27 +47,27 @@ DEFINE_GDB_PY_SCRIPT( "scripts/gdb-printers.py" ); #include "totalview/tv_helpers.hpp" #endif -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK /** * @brief Check that @p index is a valid index into the first dimension. * @param index The index to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAY_SLICE_CHECK_BOUNDS( index ) \ LVARRAY_ERROR_IF( index < 0 || index >= m_dims[ 0 ], \ "Array Bounds Check Failed: index=" << index << " m_dims[0]=" << m_dims[0] ) -#else // USE_ARRAY_BOUNDS_CHECK +#else // LVARRAY_BOUNDS_CHECK /** * @brief Check that @p index is a valid index into the first dimension. * @param index The index to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAY_SLICE_CHECK_BOUNDS( index ) -#endif // USE_ARRAY_BOUNDS_CHECK +#endif // LVARRAY_BOUNDS_CHECK namespace LvArray @@ -128,7 +128,7 @@ class ArraySlice m_dims( inputDimensions ), m_strides( inputStrides ) { -#if defined(USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) && defined(USE_ARRAY_BOUNDS_CHECK) +#if defined(LVARRAY_USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) && defined(LVARRAY_BOUNDS_CHECK) ArraySlice::TV_ttf_display_type( nullptr ); #endif } @@ -180,7 +180,7 @@ class ArraySlice LVARRAY_HOST_DEVICE inline CONSTEXPR_WITHOUT_BOUNDS_CHECK INDEX_TYPE size( int dim ) const noexcept { -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK LVARRAY_ERROR_IF_GE( dim, NDIM ); #endif return m_dims[dim]; @@ -234,7 +234,7 @@ class ArraySlice INDEX_TYPE linearIndex( INDICES... indices ) const { static_assert( sizeof ... (INDICES) == NDIM, "number of indices does not match NDIM" ); -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK indexing::checkIndices( m_dims, indices ... ); #endif return indexing::getLinearIndex< USD >( m_strides, indices ... ); @@ -329,7 +329,7 @@ class ArraySlice ///@} -#if defined(USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) && defined(USE_ARRAY_BOUNDS_CHECK) +#if defined(LVARRAY_USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) && defined(LVARRAY_BOUNDS_CHECK) /** * @brief Static function that will be used by Totalview to display the array contents. * @param av A pointer to the array that is being displayed. diff --git a/src/ArrayView.hpp b/src/ArrayView.hpp index 62f06f10..3fbd14d2 100644 --- a/src/ArrayView.hpp +++ b/src/ArrayView.hpp @@ -21,7 +21,7 @@ #include "bufferManipulation.hpp" // System includes -#if defined(USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) +#if defined(LVARRAY_USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) #include "totalview/tv_helpers.hpp" #include "totalview/tv_data_display.h" #endif @@ -312,7 +312,7 @@ class ArrayView LVARRAY_HOST_DEVICE inline INDEX_TYPE size( int const dim ) const noexcept { -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK LVARRAY_ASSERT_GE( dim, 0 ); LVARRAY_ASSERT_GT( NDIM, dim ); #endif @@ -350,7 +350,7 @@ class ArrayView INDEX_TYPE linearIndex( INDICES const ... indices ) const { static_assert( sizeof ... (INDICES) == NDIM, "number of indices does not match NDIM" ); -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK indexing::checkIndices( m_dims, indices ... ); #endif return indexing::getLinearIndex< USD >( m_strides, indices ... ); @@ -526,7 +526,7 @@ class ArrayView ///@} -#if defined(USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) +#if defined(LVARRAY_USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) /** * @brief Static function that will be used by Totalview to display the array contents. * @param av A pointer to the array that is being displayed. @@ -563,7 +563,7 @@ class ArrayView m_strides{ 0 }, m_dataBuffer( true ) { -#if defined(USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) && defined(USE_ARRAY_BOUNDS_CHECK) +#if defined(LVARRAY_USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) && defined(LVARRAY_BOUNDS_CHECK) ArrayView::TV_ttf_display_type( nullptr ); #endif } diff --git a/src/CRSMatrixView.hpp b/src/CRSMatrixView.hpp index eff5d864..8c3bbc1b 100644 --- a/src/CRSMatrixView.hpp +++ b/src/CRSMatrixView.hpp @@ -512,7 +512,7 @@ class CRSMatrixView : protected SparsityPatternView< COL_TYPE, INDEX_TYPE, BUFFE COL_TYPE * incrementSize( COL_TYPE * const curPtr, INDEX_TYPE const nToAdd ) const { LVARRAY_UNUSED_VARIABLE( curPtr ); -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK LVARRAY_ERROR_IF_GT_MSG( m_rowNNZ + nToAdd, m_rowCapacity, "CRSMatrixView cannot do reallocation." ); #else LVARRAY_DEBUG_VAR( nToAdd ); diff --git a/src/ChaiBuffer.hpp b/src/ChaiBuffer.hpp index efd65321..ac11c875 100644 --- a/src/ChaiBuffer.hpp +++ b/src/ChaiBuffer.hpp @@ -55,7 +55,7 @@ inline chai::ExecutionSpace toChaiExecutionSpace( MemorySpace const space ) return chai::NONE; if( space == MemorySpace::CPU ) return chai::CPU; -#if defined(USE_CUDA) +#if defined(LVARRAY_USE_CUDA) if( space == MemorySpace::GPU ) return chai::GPU; #endif @@ -75,7 +75,7 @@ inline MemorySpace toMemorySpace( chai::ExecutionSpace const space ) return MemorySpace::NONE; if( space == chai::CPU ) return MemorySpace::CPU; -#if defined(USE_CUDA) +#if defined(LVARRAY_USE_CUDA) if( space == chai::GPU ) return MemorySpace::GPU; #endif @@ -157,7 +157,7 @@ class ChaiBuffer m_capacity( src.m_capacity ), m_pointer_record( src.m_pointer_record ) { - #if defined(USE_CUDA) && !defined(__CUDA_ARCH__) + #if defined(LVARRAY_USE_CUDA) && !defined(__CUDA_ARCH__) move( internal::toMemorySpace( internal::getArrayManager().getExecutionSpace() ), true ); #endif } @@ -175,7 +175,7 @@ class ChaiBuffer m_capacity( src.m_capacity ), m_pointer_record( src.m_pointer_record ) { - #if defined(USE_CUDA) && !defined(__CUDA_ARCH__) + #if defined(LVARRAY_USE_CUDA) && !defined(__CUDA_ARCH__) moveNested( internal::toMemorySpace( internal::getArrayManager().getExecutionSpace() ), size, true ); #else LVARRAY_UNUSED_VARIABLE( size ); @@ -315,7 +315,7 @@ class ChaiBuffer inline void moveNested( MemorySpace const space, std::ptrdiff_t const size, bool const touch ) const { - #if defined(USE_CUDA) + #if defined(LVARRAY_USE_CUDA) chai::ExecutionSpace const chaiSpace = internal::toChaiExecutionSpace( space ); if( m_pointer_record == nullptr || m_capacity == 0 || @@ -343,7 +343,7 @@ class ChaiBuffer */ void move( MemorySpace const space, bool const touch ) const { - #if defined(USE_CUDA) + #if defined(LVARRAY_USE_CUDA) chai::ExecutionSpace const chaiSpace = internal::toChaiExecutionSpace( space ); if( m_pointer_record == nullptr || m_capacity == 0 || diff --git a/src/LvArrayConfig.hpp.in b/src/LvArrayConfig.hpp.in index bb52bef2..eec1d744 100644 --- a/src/LvArrayConfig.hpp.in +++ b/src/LvArrayConfig.hpp.in @@ -12,30 +12,18 @@ #pragma once -#cmakedefine USE_ARRAY_BOUNDS_CHECK +#cmakedefine LVARRAY_BOUNDS_CHECK -#ifndef USE_CHAI -#cmakedefine USE_CHAI -#endif +#cmakedefine LVARRAY_USE_CHAI -#ifndef USE_CUDA -#cmakedefine USE_CUDA -#endif +#cmakedefine LVARRAY_USE_CUDA -#ifndef USE_MPI -#cmakedefine USE_MPI -#endif +#cmakedefine LVARRAY_USE_MPI -#ifndef USE_TOTALVIEW_OUTPUT -#cmakedefine USE_TOTALVIEW_OUTPUT -#endif +#cmakedefine LVARRAY_USE_TOTALVIEW_OUTPUT -#ifndef USE_OPENMP -#cmakedefine USE_OPENMP -#endif +#cmakedefine LVARRAY_USE_OPENMP -#ifndef USE_CALIPER -#cmakedefine USE_CALIPER -#endif +#cmakedefine LVARRAY_USE_CALIPER -#cmakedefine LVARRAY_ADDR2LINE_EXEC "@LVARRAY_ADDR2LINE_EXEC@" +#cmakedefine LVARRAY_ADDR2LINE_EXEC @LVARRAY_ADDR2LINE_EXEC@ diff --git a/src/Macros.hpp b/src/Macros.hpp index ad776ff9..8bf4da92 100644 --- a/src/Macros.hpp +++ b/src/Macros.hpp @@ -22,7 +22,7 @@ #include #include -#if defined(USE_CUDA) +#if defined(LVARRAY_USE_CUDA) #include #endif @@ -369,7 +369,7 @@ */ #define LVARRAY_ASSERT_GE( lhs, rhs ) LVARRAY_ASSERT_GE_MSG( lhs, rhs, "" ) -#if defined(USE_CUDA) && defined(__CUDACC__) +#if defined(LVARRAY_USE_CUDA) && defined(__CUDACC__) /// Mark a function for both host and device usage. #define LVARRAY_HOST_DEVICE __host__ __device__ @@ -418,7 +418,7 @@ #endif #endif -#if !defined(USE_ARRAY_BOUNDS_CHECK) +#if !defined(LVARRAY_BOUNDS_CHECK) /** * @brief Expands to constexpr when array bound checking is disabled. */ @@ -442,7 +442,7 @@ #define CONSTEXPR_WITH_NDEBUG #endif -#if !defined(USE_ARRAY_BOUNDS_CHECK) +#if !defined(LVARRAY_BOUNDS_CHECK) /** * @brief Expands to constexpr when array bound checking is disabled. */ diff --git a/src/SortedArrayView.hpp b/src/SortedArrayView.hpp index 989a1f9b..d7035b9a 100644 --- a/src/SortedArrayView.hpp +++ b/src/SortedArrayView.hpp @@ -16,27 +16,27 @@ #include "bufferManipulation.hpp" #include "sortedArrayManipulation.hpp" -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK /** * @brief Check that @p index falls within the size of the array. * @param index The index to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define SORTEDARRAY_CHECK_BOUNDS( index ) \ LVARRAY_ERROR_IF( index < 0 || index >= size(), \ "Array Bounds Check Failed: index=" << index << " size()=" << size()) -#else // USE_ARRAY_BOUNDS_CHECK +#else // LVARRAY_BOUNDS_CHECK /** * @brief Check that @p index falls within the size of the first dimension. * @param index The index to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define SORTEDARRAY_CHECK_BOUNDS( index ) -#endif // USE_ARRAY_BOUNDS_CHECK +#endif // LVARRAY_BOUNDS_CHECK namespace LvArray { @@ -231,7 +231,7 @@ class SortedArrayView inline void move( MemorySpace const space, bool touch=true ) const LVARRAY_RESTRICT_THIS { - #if defined(USE_CUDA) + #if defined(LVARRAY_USE_CUDA) if( space == MemorySpace::GPU ) touch = false; #endif m_values.move( space, touch ); diff --git a/src/SparsityPatternView.hpp b/src/SparsityPatternView.hpp index 704e3193..0429ebbe 100644 --- a/src/SparsityPatternView.hpp +++ b/src/SparsityPatternView.hpp @@ -18,23 +18,23 @@ // System includes #include -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK /** * @brief Check that @p col is a valid column in the matrix. * @param col The column to check. - * @note This macro is only active with USE_ARRAY_BOUNDS_CHECK. + * @note This macro is only active with LVARRAY_BOUNDS_CHECK. */ #define SPARSITYPATTERN_COLUMN_CHECK( col ) \ LVARRAY_ERROR_IF( !arrayManipulation::isPositive( col ) || col >= this->numColumns(), \ "Column Check Failed: col=" << col << " numColumns=" << this->numColumns() ) -#else // USE_ARRAY_BOUNDS_CHECK +#else // LVARRAY_BOUNDS_CHECK /** * @brief Check that @p col is a valid column in the matrix. * @param col The column to check. - * @note This macro is only active with USE_ARRAY_BOUNDS_CHECK. + * @note This macro is only active with LVARRAY_BOUNDS_CHECK. */ #define SPARSITYPATTERN_COLUMN_CHECK( col ) @@ -291,7 +291,7 @@ class SparsityPatternView : protected ArrayOfSetsView< COL_TYPE, INDEX_TYPE, BUF { ARRAYOFARRAYS_CHECK_BOUNDS( row ); - #ifdef USE_ARRAY_BOUNDS_CHECK + #ifdef LVARRAY_BOUNDS_CHECK for( ITER iter = first; iter != last; ++iter ) { SPARSITYPATTERN_COLUMN_CHECK( *iter ); } #endif @@ -329,7 +329,7 @@ class SparsityPatternView : protected ArrayOfSetsView< COL_TYPE, INDEX_TYPE, BUF { ARRAYOFARRAYS_CHECK_BOUNDS( row ); - #ifdef USE_ARRAY_BOUNDS_CHECK + #ifdef LVARRAY_BOUNDS_CHECK for( ITER iter = first; iter != last; ++iter ) { SPARSITYPATTERN_COLUMN_CHECK( *iter ); } #endif diff --git a/src/arrayManipulation.hpp b/src/arrayManipulation.hpp index c78bb49f..b467162a 100644 --- a/src/arrayManipulation.hpp +++ b/src/arrayManipulation.hpp @@ -14,12 +14,12 @@ #include "Macros.hpp" -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK /** * @brief Check that @p index is a valid into into the array. * @param index The index to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYMANIPULATION_CHECK_BOUNDS( index ) \ LVARRAY_ERROR_IF( !isPositive( index ) || index >= size, \ @@ -28,29 +28,29 @@ /** * @brief Check that @p index is a valid insertion position in the array. * @param index The index to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYMANIPULATION_CHECK_INSERT_BOUNDS( index ) \ LVARRAY_ERROR_IF( !isPositive( index ) || index > size, \ "Array Bounds Insert Check Failed: index=" << index << " size()=" << size ) -#else // USE_ARRAY_BOUNDS_CHECK +#else // LVARRAY_BOUNDS_CHECK /** * @brief Check that @p index is a valid into into the array. * @param index The index to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYMANIPULATION_CHECK_BOUNDS( index ) /** * @brief Check that @p index is a valid insertion position in the array. * @param index The index to check. - * @note This is only active when USE_ARRAY_BOUNDS_CHECK is defined. + * @note This is only active when LVARRAY_BOUNDS_CHECK is defined. */ #define ARRAYMANIPULATION_CHECK_INSERT_BOUNDS( index ) -#endif // USE_ARRAY_BOUNDS_CHECK +#endif // LVARRAY_BOUNDS_CHECK namespace LvArray { diff --git a/src/bufferManipulation.hpp b/src/bufferManipulation.hpp index e3caaead..86265966 100644 --- a/src/bufferManipulation.hpp +++ b/src/bufferManipulation.hpp @@ -32,7 +32,7 @@ enum class MemorySpace { NONE , CPU -#if defined(USE_CUDA) +#if defined(LVARRAY_USE_CUDA) , GPU #endif }; @@ -49,7 +49,7 @@ inline std::ostream & operator<<( std::ostream & os, MemorySpace const space ) os << "NONE"; if( space == MemorySpace::CPU ) os << "CPU"; -#if defined(USE_CUDA) +#if defined(LVARRAY_USE_CUDA) if( space == MemorySpace::GPU ) os << "GPU"; #endif @@ -131,13 +131,13 @@ struct VoidBuffer * @tparam BUFFER the buffer type. * @param buf The buffer to check. * @param size The size of the buffer. - * @note This method is a no-op when USE_ARRAY_BOUNDS_CHECK is not defined. + * @note This method is a no-op when LVARRAY_BOUNDS_CHECK is not defined. */ template< typename BUFFER > inline LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK void check( BUFFER const & buf, std::ptrdiff_t const size ) { -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK LVARRAY_ERROR_IF_GT( 0, buf.capacity() ); LVARRAY_ERROR_IF_GT( 0, size ); LVARRAY_ERROR_IF_GT( size, buf.capacity() ); @@ -153,13 +153,13 @@ void check( BUFFER const & buf, std::ptrdiff_t const size ) * @param buf The buffer to check. * @param size The size of the buffer. * @param pos The insertion position. - * @note This method is a no-op when USE_ARRAY_BOUNDS_CHECK is not defined. + * @note This method is a no-op when LVARRAY_BOUNDS_CHECK is not defined. */ template< typename BUFFER > inline void checkInsert( BUFFER const & buf, std::ptrdiff_t const size, std::ptrdiff_t const pos ) { -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK check( buf, size ); LVARRAY_ERROR_IF_GT( 0, pos ); LVARRAY_ERROR_IF_GT( pos, size ); diff --git a/src/genericTensorOps.hpp b/src/genericTensorOps.hpp index 5587fdbc..dfe312aa 100644 --- a/src/genericTensorOps.hpp +++ b/src/genericTensorOps.hpp @@ -209,7 +209,7 @@ void checkSizes( T const ( &src )[ INFERRED_M ][ INFERRED_N ] ) } /** - * @brief Verify at compile time that @tparam ARRAY is 1D and at runtime verify the size when USE_ARRAY_BOUNDS_CHECK. + * @brief Verify at compile time that @tparam ARRAY is 1D and at runtime verify the size when LVARRAY_BOUNDS_CHECK. * @tparam M The size expected size. * @tparam ARRAY The type o @p array, should be an Array, ArrayView or ArraySlice. * @param array The array to check. @@ -219,7 +219,7 @@ LVARRAY_HOST_DEVICE inline CONSTEXPR_WITHOUT_BOUNDS_CHECK void checkSizes( ARRAY const & array ) { static_assert( ARRAY::NDIM == 1, "Must be a 1D array." ); - #ifdef USE_ARRAY_BOUNDS_CHECK + #ifdef LVARRAY_BOUNDS_CHECK LVARRAY_ERROR_IF_NE( array.size( 0 ), M ); #else LVARRAY_UNUSED_VARIABLE( array ); @@ -227,7 +227,7 @@ void checkSizes( ARRAY const & array ) } /** - * @brief Verify at compile time that @tparam ARRAY is 2D and at runtime verify the sizes when USE_ARRAY_BOUNDS_CHECK. + * @brief Verify at compile time that @tparam ARRAY is 2D and at runtime verify the sizes when LVARRAY_BOUNDS_CHECK. * @tparam M The expected size of the first dimension. * @tparam N The expected size of the second dimension. * @tparam ARRAY The type o @p array, should be an Array, ArrayView or ArraySlice. @@ -238,7 +238,7 @@ LVARRAY_HOST_DEVICE inline CONSTEXPR_WITHOUT_BOUNDS_CHECK void checkSizes( ARRAY const & array ) { static_assert( ARRAY::NDIM == 2, "Must be a 1D array." ); -#ifdef USE_ARRAY_BOUNDS_CHECK +#ifdef LVARRAY_BOUNDS_CHECK LVARRAY_ERROR_IF_NE( array.size( 0 ), M ); LVARRAY_ERROR_IF_NE( array.size( 1 ), N ); #else diff --git a/src/system.cpp b/src/system.cpp index 82c31b5c..c9d2e314 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -30,7 +30,7 @@ #include #endif -#if defined( USE_MPI ) +#if defined( LVARRAY_USE_MPI ) #include #endif @@ -427,7 +427,7 @@ std::string calculateSize( size_t const bytes ) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void abort() { -#ifdef USE_MPI +#ifdef LVARRAY_USE_MPI int mpi = 0; MPI_Initialized( &mpi ); if( mpi ) diff --git a/unitTests/testArray1D.cpp b/unitTests/testArray1D.cpp index 11af4c4e..96a8e2e5 100644 --- a/unitTests/testArray1D.cpp +++ b/unitTests/testArray1D.cpp @@ -197,7 +197,7 @@ using Array1DTestTypes = ::testing::Types< Array< int, 1, RAJA::PERM_I, INDEX_TYPE, MallocBuffer > , Array< Tensor, 1, RAJA::PERM_I, INDEX_TYPE, MallocBuffer > , Array< TestString, 1, RAJA::PERM_I, INDEX_TYPE, MallocBuffer > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , Array< int, 1, RAJA::PERM_I, INDEX_TYPE, ChaiBuffer > , Array< Tensor, 1, RAJA::PERM_I, INDEX_TYPE, ChaiBuffer > , Array< TestString, 1, RAJA::PERM_I, INDEX_TYPE, ChaiBuffer > diff --git a/unitTests/testArray1DOfArray1D.cpp b/unitTests/testArray1DOfArray1D.cpp index 49ed9af4..0e1e2594 100644 --- a/unitTests/testArray1DOfArray1D.cpp +++ b/unitTests/testArray1DOfArray1D.cpp @@ -227,12 +227,12 @@ using Array1DOfArray1DTestTypes = ::testing::Types< std::pair< Array1D< int, MallocBuffer >, serialPolicy > , std::pair< Array1D< Tensor, MallocBuffer >, serialPolicy > , std::pair< Array1D< TestString, MallocBuffer >, serialPolicy > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , std::pair< Array1D< int, ChaiBuffer >, serialPolicy > , std::pair< Array1D< Tensor, ChaiBuffer >, serialPolicy > , std::pair< Array1D< TestString, ChaiBuffer >, serialPolicy > #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::pair< Array1D< int, ChaiBuffer >, parallelDevicePolicy< 32 > > , std::pair< Array1D< Tensor, ChaiBuffer >, parallelDevicePolicy< 32 > > #endif diff --git a/unitTests/testArray1DOfArray1DOfArray1D.cpp b/unitTests/testArray1DOfArray1DOfArray1D.cpp index 428e1b1d..d61ccad7 100644 --- a/unitTests/testArray1DOfArray1DOfArray1D.cpp +++ b/unitTests/testArray1DOfArray1DOfArray1D.cpp @@ -266,12 +266,12 @@ using Array1DOfArray1DOfArray1DTestTypes = ::testing::Types< std::pair< Array1D< int, MallocBuffer >, serialPolicy > , std::pair< Array1D< Tensor, MallocBuffer >, serialPolicy > , std::pair< Array1D< TestString, MallocBuffer >, serialPolicy > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , std::pair< Array1D< int, ChaiBuffer >, serialPolicy > , std::pair< Array1D< Tensor, ChaiBuffer >, serialPolicy > , std::pair< Array1D< TestString, ChaiBuffer >, serialPolicy > #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::pair< Array1D< int, ChaiBuffer >, parallelDevicePolicy< 32 > > , std::pair< Array1D< Tensor, ChaiBuffer >, parallelDevicePolicy< 32 > > #endif diff --git a/unitTests/testArrayOfArrays.cpp b/unitTests/testArrayOfArrays.cpp index eb2dc87e..e43c33de 100644 --- a/unitTests/testArrayOfArrays.cpp +++ b/unitTests/testArrayOfArrays.cpp @@ -598,7 +598,7 @@ using ArrayOfArraysTestTypes = ::testing::Types< ArrayOfArrays< int, std::ptrdiff_t, MallocBuffer > , ArrayOfArrays< Tensor, std::ptrdiff_t, MallocBuffer > , ArrayOfArrays< TestString, std::ptrdiff_t, MallocBuffer > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , ArrayOfArrays< int, std::ptrdiff_t, ChaiBuffer > , ArrayOfArrays< Tensor, std::ptrdiff_t, ChaiBuffer > , ArrayOfArrays< TestString, std::ptrdiff_t, ChaiBuffer > @@ -742,7 +742,7 @@ TYPED_TEST( ArrayOfArraysTest, resizeFromCapacities ) this->template resizeFromCapacities< serialPolicy >( 100, 10 ); this->emplace( 10 ); -#if defined( USE_OPENMP ) +#if defined( LVARRAY_USE_OPENMP ) this->template resizeFromCapacities< parallelHostPolicy >( 150, 10 ); this->emplace( 10 ); #endif @@ -1232,13 +1232,13 @@ using ArrayOfArraysViewTestTypes = ::testing::Types< std::pair< ArrayOfArrays< int, std::ptrdiff_t, MallocBuffer >, serialPolicy > , std::pair< ArrayOfArrays< Tensor, std::ptrdiff_t, MallocBuffer >, serialPolicy > , std::pair< ArrayOfArrays< TestString, std::ptrdiff_t, MallocBuffer >, serialPolicy > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , std::pair< ArrayOfArrays< int, std::ptrdiff_t, ChaiBuffer >, serialPolicy > , std::pair< ArrayOfArrays< Tensor, std::ptrdiff_t, ChaiBuffer >, serialPolicy > , std::pair< ArrayOfArrays< TestString, std::ptrdiff_t, ChaiBuffer >, serialPolicy > #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::pair< ArrayOfArrays< int, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > , std::pair< ArrayOfArrays< Tensor, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > #endif @@ -1404,24 +1404,24 @@ using ArrayOfArraysViewAtomicTestTypes = ::testing::Types< std::pair< ArrayOfArrays< int, std::ptrdiff_t, MallocBuffer >, serialPolicy > , std::pair< ArrayOfArrays< Tensor, std::ptrdiff_t, MallocBuffer >, serialPolicy > , std::pair< ArrayOfArrays< TestString, std::ptrdiff_t, MallocBuffer >, serialPolicy > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , std::pair< ArrayOfArrays< int, std::ptrdiff_t, ChaiBuffer >, serialPolicy > , std::pair< ArrayOfArrays< Tensor, std::ptrdiff_t, ChaiBuffer >, serialPolicy > , std::pair< ArrayOfArrays< TestString, std::ptrdiff_t, ChaiBuffer >, serialPolicy > #endif -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) , std::pair< ArrayOfArrays< int, std::ptrdiff_t, MallocBuffer >, parallelHostPolicy > , std::pair< ArrayOfArrays< Tensor, std::ptrdiff_t, MallocBuffer >, parallelHostPolicy > , std::pair< ArrayOfArrays< TestString, std::ptrdiff_t, MallocBuffer >, parallelHostPolicy > #endif -#if defined(USE_OPENMP) && defined(USE_CHAI) +#if defined(LVARRAY_USE_OPENMP) && defined(LVARRAY_USE_CHAI) , std::pair< ArrayOfArrays< int, std::ptrdiff_t, ChaiBuffer >, parallelHostPolicy > , std::pair< ArrayOfArrays< Tensor, std::ptrdiff_t, ChaiBuffer >, parallelHostPolicy > , std::pair< ArrayOfArrays< TestString, std::ptrdiff_t, ChaiBuffer >, parallelHostPolicy > #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::pair< ArrayOfArrays< int, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > , std::pair< ArrayOfArrays< Tensor, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > #endif diff --git a/unitTests/testArrayOfSets.cpp b/unitTests/testArrayOfSets.cpp index fe738c60..d502281b 100644 --- a/unitTests/testArrayOfSets.cpp +++ b/unitTests/testArrayOfSets.cpp @@ -527,7 +527,7 @@ using ArrayOfSetsTestTypes = ::testing::Types< ArrayOfSets< int, std::ptrdiff_t, MallocBuffer > , ArrayOfSets< Tensor, std::ptrdiff_t, MallocBuffer > , ArrayOfSets< TestString, std::ptrdiff_t, MallocBuffer > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , ArrayOfSets< int, std::ptrdiff_t, ChaiBuffer > , ArrayOfSets< Tensor, std::ptrdiff_t, ChaiBuffer > , ArrayOfSets< TestString, std::ptrdiff_t, ChaiBuffer > @@ -611,7 +611,7 @@ TYPED_TEST( ArrayOfSetsTest, resizeFromCapacities ) this->template resizeFromCapacities< serialPolicy >( 100, DEFAULT_MAX_INSERTS ); this->insertIntoSet( DEFAULT_MAX_INSERTS, DEFAULT_MAX_VALUE ); -#if defined( USE_OPENMP ) +#if defined( LVARRAY_USE_OPENMP ) this->template resizeFromCapacities< parallelHostPolicy >( 150, DEFAULT_MAX_INSERTS ); this->insertIntoSet( DEFAULT_MAX_INSERTS, DEFAULT_MAX_VALUE ); #endif @@ -939,13 +939,13 @@ using ArrayOfSetsViewTestTypes = ::testing::Types< std::pair< ArrayOfSets< int, std::ptrdiff_t, MallocBuffer >, serialPolicy > , std::pair< ArrayOfSets< Tensor, std::ptrdiff_t, MallocBuffer >, serialPolicy > , std::pair< ArrayOfSets< TestString, std::ptrdiff_t, MallocBuffer >, serialPolicy > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , std::pair< ArrayOfSets< int, std::ptrdiff_t, ChaiBuffer >, serialPolicy > , std::pair< ArrayOfSets< Tensor, std::ptrdiff_t, ChaiBuffer >, serialPolicy > , std::pair< ArrayOfSets< TestString, std::ptrdiff_t, ChaiBuffer >, serialPolicy > #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::pair< ArrayOfSets< int, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > , std::pair< ArrayOfSets< Tensor, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > #endif diff --git a/unitTests/testArrayView.hpp b/unitTests/testArrayView.hpp index 561947cb..690cef51 100644 --- a/unitTests/testArrayView.hpp +++ b/unitTests/testArrayView.hpp @@ -524,7 +524,7 @@ using ArrayViewPolicyTestTypes = ::testing::Types< , std::pair< Array< Tensor, 4, RAJA::PERM_IJKL, INDEX_TYPE, DEFAULT_BUFFER >, serialPolicy > , std::pair< Array< Tensor, 4, RAJA::PERM_LKJI, INDEX_TYPE, DEFAULT_BUFFER >, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::pair< Array< int, 1, RAJA::PERM_I, INDEX_TYPE, ChaiBuffer >, parallelDevicePolicy< 32 > > , std::pair< Array< int, 2, RAJA::PERM_IJ, INDEX_TYPE, ChaiBuffer >, parallelDevicePolicy< 32 > > , std::pair< Array< int, 2, RAJA::PERM_JI, INDEX_TYPE, ChaiBuffer >, parallelDevicePolicy< 32 > > diff --git a/unitTests/testBuffers.cpp b/unitTests/testBuffers.cpp index cc124534..c1e4af1f 100644 --- a/unitTests/testBuffers.cpp +++ b/unitTests/testBuffers.cpp @@ -67,7 +67,7 @@ using BufferAPITestTypes = ::testing::Types< StackBuffer< int, NO_REALLOC_CAPACITY > , MallocBuffer< int > , MallocBuffer< TestString > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , ChaiBuffer< int > , ChaiBuffer< TestString > #endif @@ -528,7 +528,7 @@ TYPED_TEST( BufferTestNoRealloc, copyInto ) COMPARE_TO_REFERENCE( copy, this->m_ref ); bufferManipulation::free( copy, NO_REALLOC_CAPACITY ); }, - #if defined(USE_CHAI) + #if defined(LVARRAY_USE_CHAI) ChaiBuffer< typename TypeParam::value_type >( true ), #endif MallocBuffer< typename TypeParam::value_type >( true ) @@ -624,7 +624,7 @@ class BufferTestWithRealloc : public BufferTestNoRealloc< BUFFER_TYPE > using BufferTestWithReallocTypes = ::testing::Types< MallocBuffer< int > , MallocBuffer< TestString > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , ChaiBuffer< int > , ChaiBuffer< TestString > #endif diff --git a/unitTests/testCRSMatrix.cpp b/unitTests/testCRSMatrix.cpp index cbb48d3f..f6bc4576 100644 --- a/unitTests/testCRSMatrix.cpp +++ b/unitTests/testCRSMatrix.cpp @@ -495,7 +495,7 @@ using CRSMatrixTestTypes = ::testing::Types< CRSMatrix< int, int, std::ptrdiff_t, MallocBuffer > , CRSMatrix< Tensor, int, std::ptrdiff_t, MallocBuffer > , CRSMatrix< TestString, int, std::ptrdiff_t, MallocBuffer > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , CRSMatrix< int, int, std::ptrdiff_t, ChaiBuffer > , CRSMatrix< Tensor, int, std::ptrdiff_t, ChaiBuffer > , CRSMatrix< TestString, int, std::ptrdiff_t, ChaiBuffer > @@ -559,7 +559,7 @@ TYPED_TEST( CRSMatrixTest, resizeFromRowCapacities ) this->template resizeFromRowCapacities< serialPolicy >( DEFAULT_NROWS, DEFAULT_NCOLS ); this->insert( DEFAULT_MAX_INSERTS, true ); -#if defined( USE_OPENMP ) +#if defined( LVARRAY_USE_OPENMP ) this->template resizeFromRowCapacities< parallelHostPolicy >( 2 * DEFAULT_NROWS, DEFAULT_NCOLS / 2 ); this->insert( DEFAULT_MAX_INSERTS, true ); #endif @@ -1010,13 +1010,13 @@ using CRSMatrixViewTestTypes = ::testing::Types< // Sphinx end before CRSMatrixViewTestTypes , std::pair< CRSMatrix< Tensor, int, std::ptrdiff_t, MallocBuffer >, serialPolicy > , std::pair< CRSMatrix< TestString, int, std::ptrdiff_t, MallocBuffer >, serialPolicy > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , std::pair< CRSMatrix< int, int, std::ptrdiff_t, ChaiBuffer >, serialPolicy > , std::pair< CRSMatrix< Tensor, int, std::ptrdiff_t, ChaiBuffer >, serialPolicy > , std::pair< CRSMatrix< TestString, int, std::ptrdiff_t, ChaiBuffer >, serialPolicy > #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::pair< CRSMatrix< int, int, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > , std::pair< CRSMatrix< Tensor, int, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > #endif @@ -1234,22 +1234,22 @@ using CRSMatrixViewAtomicTestTypes = ::testing::Types< std::pair< CRSMatrix< int, int, std::ptrdiff_t, MallocBuffer >, serialPolicy > , std::pair< CRSMatrix< Tensor, int, std::ptrdiff_t, MallocBuffer >, serialPolicy > , std::pair< CRSMatrix< TestString, int, std::ptrdiff_t, MallocBuffer >, serialPolicy > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , std::pair< CRSMatrix< int, int, std::ptrdiff_t, ChaiBuffer >, serialPolicy > , std::pair< CRSMatrix< Tensor, int, std::ptrdiff_t, ChaiBuffer >, serialPolicy > , std::pair< CRSMatrix< TestString, int, std::ptrdiff_t, ChaiBuffer >, serialPolicy > #endif -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) , std::pair< CRSMatrix< int, int, std::ptrdiff_t, MallocBuffer >, parallelHostPolicy > , std::pair< CRSMatrix< double, int, std::ptrdiff_t, MallocBuffer >, parallelHostPolicy > #endif -#if defined(USE_OPENMP) && defined(USE_CHAI) +#if defined(LVARRAY_USE_OPENMP) && defined(LVARRAY_USE_CHAI) , std::pair< CRSMatrix< int, int, std::ptrdiff_t, ChaiBuffer >, parallelHostPolicy > , std::pair< CRSMatrix< double, int, std::ptrdiff_t, ChaiBuffer >, parallelHostPolicy > #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::pair< CRSMatrix< int, int, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > , std::pair< CRSMatrix< double, int, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > #endif diff --git a/unitTests/testMath.cpp b/unitTests/testMath.cpp index 3007de76..3422cbc1 100644 --- a/unitTests/testMath.cpp +++ b/unitTests/testMath.cpp @@ -77,7 +77,7 @@ using TestMathTypes = ::testing::Types< , std::pair< long long int, serialPolicy > , std::pair< float, serialPolicy > , std::pair< double, serialPolicy > -#if defined(USE_CUDA) +#if defined(LVARRAY_USE_CUDA) , std::pair< int, parallelDevicePolicy< 32 > > , std::pair< long int, parallelDevicePolicy< 32 > > , std::pair< long long int, parallelDevicePolicy< 32 > > @@ -149,7 +149,7 @@ struct TestMathFloatingPointOnly : public ::testing::Test using TestMathFloatingPointOnlyTypes = ::testing::Types< std::pair< float, serialPolicy > , std::pair< double, serialPolicy > -#if defined(USE_CUDA) +#if defined(LVARRAY_USE_CUDA) , std::pair< float, parallelDevicePolicy< 32 > > , std::pair< double, parallelDevicePolicy< 32 > > #endif diff --git a/unitTests/testSortedArray.cpp b/unitTests/testSortedArray.cpp index bfbbbce4..f605c0a8 100644 --- a/unitTests/testSortedArray.cpp +++ b/unitTests/testSortedArray.cpp @@ -245,7 +245,7 @@ using TestTypes = ::testing::Types< SortedArray< int, INDEX_TYPE, MallocBuffer > , SortedArray< Tensor, INDEX_TYPE, MallocBuffer > , SortedArray< TestString, INDEX_TYPE, MallocBuffer > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , SortedArray< int, INDEX_TYPE, ChaiBuffer > , SortedArray< Tensor, INDEX_TYPE, ChaiBuffer > , SortedArray< TestString, INDEX_TYPE, ChaiBuffer > @@ -439,7 +439,7 @@ using SortedArrayViewTestTypes = ::testing::Types< std::pair< SortedArray< int, INDEX_TYPE, DEFAULT_BUFFER >, serialPolicy > , std::pair< SortedArray< Tensor, INDEX_TYPE, DEFAULT_BUFFER >, serialPolicy > , std::pair< SortedArray< TestString, INDEX_TYPE, DEFAULT_BUFFER >, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::pair< SortedArray< int, INDEX_TYPE, ChaiBuffer >, parallelDevicePolicy< 32 > > , std::pair< SortedArray< Tensor, INDEX_TYPE, ChaiBuffer >, parallelDevicePolicy< 32 > > #endif diff --git a/unitTests/testSortedArrayManipulation.cpp b/unitTests/testSortedArrayManipulation.cpp index 64449726..f2bf7f25 100644 --- a/unitTests/testSortedArrayManipulation.cpp +++ b/unitTests/testSortedArrayManipulation.cpp @@ -186,7 +186,7 @@ using SingleArrayTestTypes = ::testing::Types< , std::tuple< TestString, sortedArrayManipulation::greater< TestString >, serialPolicy > , std::tuple< TestString, sortedArrayManipulation::greater< TestString >, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::tuple< int, sortedArrayManipulation::less< int >, parallelDevicePolicy< 256 > > , std::tuple< int, sortedArrayManipulation::greater< int >, parallelDevicePolicy< 256 > > , std::tuple< Tensor, sortedArrayManipulation::less< Tensor >, parallelDevicePolicy< 256 > > @@ -286,7 +286,7 @@ using DualArrayTestTypes = ::testing::Types< , std::tuple< TestString, TestString, sortedArrayManipulation::less< TestString >, serialPolicy > , std::tuple< TestString, TestString, sortedArrayManipulation::greater< TestString >, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::tuple< int, int, sortedArrayManipulation::less< int >, parallelDevicePolicy< 256 > > , std::tuple< int, int, sortedArrayManipulation::greater< int >, parallelDevicePolicy< 256 > > , std::tuple< Tensor, Tensor, sortedArrayManipulation::less< Tensor >, parallelDevicePolicy< 256 > > diff --git a/unitTests/testSparsityPattern.cpp b/unitTests/testSparsityPattern.cpp index 054b3a6c..e88b2659 100644 --- a/unitTests/testSparsityPattern.cpp +++ b/unitTests/testSparsityPattern.cpp @@ -528,7 +528,7 @@ class SparsityPatternTest : public ::testing::Test using SparsityPatternTestTypes = ::testing::Types< SparsityPattern< int, std::ptrdiff_t, MallocBuffer > , SparsityPattern< uint, std::ptrdiff_t, MallocBuffer > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , SparsityPattern< int, std::ptrdiff_t, ChaiBuffer > , SparsityPattern< uint, std::ptrdiff_t, ChaiBuffer > #endif @@ -586,7 +586,7 @@ TYPED_TEST( SparsityPatternTest, resizeFromRowCapacities ) this->template resizeFromRowCapacities< serialPolicy >( 100, 75 ); this->insertTest( MAX_INSERTS ); -#if defined( USE_OPENMP ) +#if defined( LVARRAY_USE_OPENMP ) this->template resizeFromRowCapacities< parallelHostPolicy >( 150, 200 ); this->insertTest( MAX_INSERTS ); #endif @@ -998,12 +998,12 @@ class SparsityPatternViewTest : public SparsityPatternTest< typename SPARSITY_PA using SparsityPatternViewTestTypes = ::testing::Types< std::pair< SparsityPattern< int, std::ptrdiff_t, MallocBuffer >, serialPolicy > , std::pair< SparsityPattern< uint, std::ptrdiff_t, MallocBuffer >, serialPolicy > -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) , std::pair< SparsityPattern< int, std::ptrdiff_t, ChaiBuffer >, serialPolicy > , std::pair< SparsityPattern< uint, std::ptrdiff_t, ChaiBuffer >, serialPolicy > #endif -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::pair< SparsityPattern< int, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > , std::pair< SparsityPattern< uint, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > #endif @@ -1156,7 +1156,7 @@ using CRSMatrixTestTypes = ::testing::Types< std::pair< CRSMatrix< int, int, std::ptrdiff_t, MallocBuffer >, serialPolicy > , std::pair< CRSMatrix< Tensor, int, std::ptrdiff_t, MallocBuffer >, serialPolicy > , std::pair< CRSMatrix< TestString, int, std::ptrdiff_t, MallocBuffer >, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::pair< CRSMatrix< int, int, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > , std::pair< CRSMatrix< Tensor, int, std::ptrdiff_t, ChaiBuffer >, parallelDevicePolicy< 32 > > #endif diff --git a/unitTests/testStackArray.cpp b/unitTests/testStackArray.cpp index 8438993f..32f16df5 100644 --- a/unitTests/testStackArray.cpp +++ b/unitTests/testStackArray.cpp @@ -282,7 +282,7 @@ using StackArrayCaptureTestTypes = ::testing::Types< , std::pair< RAJA::PERM_KIJ, serialPolicy > , std::pair< RAJA::PERM_KJI, serialPolicy > -#if defined(USE_CUDA) +#if defined(LVARRAY_USE_CUDA) , std::pair< RAJA::PERM_I, parallelDevicePolicy< 32 > > , std::pair< RAJA::PERM_IJ, parallelDevicePolicy< 32 > > , std::pair< RAJA::PERM_JI, parallelDevicePolicy< 32 > > diff --git a/unitTests/testTensorOpsEigen.cpp b/unitTests/testTensorOpsEigen.cpp index ef4a5075..05b95c2c 100644 --- a/unitTests/testTensorOpsEigen.cpp +++ b/unitTests/testTensorOpsEigen.cpp @@ -242,7 +242,7 @@ using TestEigendecompositionTypes = ::testing::Types< , std::tuple< double, double, std::integral_constant< int, 3 >, serialPolicy > , std::tuple< std::int64_t, double, std::integral_constant< int, 3 >, serialPolicy > , std::tuple< float, float, std::integral_constant< int, 3 >, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::tuple< double, double, std::integral_constant< int, 2 >, parallelDevicePolicy< 32 > > , std::tuple< std::int64_t, double, std::integral_constant< int, 2 >, parallelDevicePolicy< 32 > > , std::tuple< float, float, std::integral_constant< int, 2 >, parallelDevicePolicy< 32 > > diff --git a/unitTests/testTensorOpsFixedSize.cpp b/unitTests/testTensorOpsFixedSize.cpp index e19da09f..cf39b9bc 100644 --- a/unitTests/testTensorOpsFixedSize.cpp +++ b/unitTests/testTensorOpsFixedSize.cpp @@ -430,7 +430,7 @@ using FixedSizeSquareMatrixTestTypes = ::testing::Types< std::tuple< double, std::integral_constant< int, 2 >, serialPolicy > , std::tuple< double, std::integral_constant< int, 3 >, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::tuple< double, std::integral_constant< int, 2 >, parallelDevicePolicy< 32 > > , std::tuple< double, std::integral_constant< int, 3 >, parallelDevicePolicy< 32 > > #endif diff --git a/unitTests/testTensorOpsInverse.hpp b/unitTests/testTensorOpsInverse.hpp index d4af72ee..74b7a210 100644 --- a/unitTests/testTensorOpsInverse.hpp +++ b/unitTests/testTensorOpsInverse.hpp @@ -370,7 +370,7 @@ using InverseTestTypes = ::testing::Types< , std::tuple< float, float, std::integral_constant< int, 3 >, serialPolicy > , std::tuple< int, double, std::integral_constant< int, 3 >, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::tuple< double, double, std::integral_constant< int, 2 >, parallelDevicePolicy< 32 > > , std::tuple< float, float, std::integral_constant< int, 2 >, parallelDevicePolicy< 32 > > , std::tuple< int, double, std::integral_constant< int, 2 >, parallelDevicePolicy< 32 > > @@ -395,7 +395,7 @@ using InverseFloatOnlyTestTypes = ::testing::Types< , std::tuple< double, double, std::integral_constant< int, 3 >, serialPolicy > , std::tuple< float, float, std::integral_constant< int, 3 >, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::tuple< double, double, std::integral_constant< int, 2 >, parallelDevicePolicy< 32 > > , std::tuple< float, float, std::integral_constant< int, 2 >, parallelDevicePolicy< 32 > > , std::tuple< double, double, std::integral_constant< int, 3 >, parallelDevicePolicy< 32 > > diff --git a/unitTests/testTensorOpsNoSize.cpp b/unitTests/testTensorOpsNoSize.cpp index b0007262..a371b752 100644 --- a/unitTests/testTensorOpsNoSize.cpp +++ b/unitTests/testTensorOpsNoSize.cpp @@ -349,7 +349,7 @@ using NoSizeTestTypes = ::testing::Types< std::tuple< double, serialPolicy > , std::tuple< int, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::tuple< double, parallelDevicePolicy< 32 > > , std::tuple< int, parallelDevicePolicy< 32 > > #endif diff --git a/unitTests/testTensorOpsOneSize.cpp b/unitTests/testTensorOpsOneSize.cpp index 398a17d4..7b9d46b7 100644 --- a/unitTests/testTensorOpsOneSize.cpp +++ b/unitTests/testTensorOpsOneSize.cpp @@ -658,7 +658,7 @@ using OneSizeTestTypes = ::testing::Types< , std::tuple< int, std::integral_constant< int, 3 >, serialPolicy > , std::tuple< double, std::integral_constant< int, 6 >, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::tuple< double, std::integral_constant< int, 2 >, parallelDevicePolicy< 32 > > , std::tuple< int, std::integral_constant< int, 3 >, parallelDevicePolicy< 32 > > , std::tuple< double, std::integral_constant< int, 6 >, parallelDevicePolicy< 32 > > diff --git a/unitTests/testTensorOpsThreeSizes.hpp b/unitTests/testTensorOpsThreeSizes.hpp index e5afb452..97c90853 100644 --- a/unitTests/testTensorOpsThreeSizes.hpp +++ b/unitTests/testTensorOpsThreeSizes.hpp @@ -530,7 +530,7 @@ using ThreeSizesTestTypes = ::testing::Types< std::integral_constant< int, 3 >, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::tuple< double, std::integral_constant< int, 2 >, std::integral_constant< int, 3 >, diff --git a/unitTests/testTensorOpsTwoSizes.hpp b/unitTests/testTensorOpsTwoSizes.hpp index baab36f8..84d10fdd 100644 --- a/unitTests/testTensorOpsTwoSizes.hpp +++ b/unitTests/testTensorOpsTwoSizes.hpp @@ -817,7 +817,7 @@ using TwoSizesTestTypes = ::testing::Types< , std::tuple< int, std::integral_constant< int, 5 >, std::integral_constant< int, 4 >, serialPolicy > , std::tuple< double, std::integral_constant< int, 3 >, std::integral_constant< int, 3 >, serialPolicy > -#if defined(USE_CUDA) && defined(USE_CHAI) +#if defined(LVARRAY_USE_CUDA) && defined(LVARRAY_USE_CHAI) , std::tuple< double, std::integral_constant< int, 2 >, std::integral_constant< int, 3 >, parallelDevicePolicy< 32 > > , std::tuple< int, std::integral_constant< int, 5 >, std::integral_constant< int, 4 >, parallelDevicePolicy< 32 > > , std::tuple< double, std::integral_constant< int, 3 >, std::integral_constant< int, 3 >, parallelDevicePolicy< 32 > > diff --git a/unitTests/testTypeManipulation.cpp b/unitTests/testTypeManipulation.cpp index e89e3707..ed01ac17 100644 --- a/unitTests/testTypeManipulation.cpp +++ b/unitTests/testTypeManipulation.cpp @@ -64,7 +64,7 @@ CUDA_TEST( typeManipulation, forEachArg ) EXPECT_EQ( str, "1010" ); EXPECT_EQ( pi, 6 ); -#if defined(USE_CUDA) +#if defined(LVARRAY_USE_CUDA) // Test on device. RAJA::ReduceSum< RAJA::cuda_reduce, int > intReducer( 1 ); RAJA::ReduceSum< RAJA::cuda_reduce, float > floatReducer( 3 ); diff --git a/unitTests/testUtils.hpp b/unitTests/testUtils.hpp index 093e9411..c35b1773 100644 --- a/unitTests/testUtils.hpp +++ b/unitTests/testUtils.hpp @@ -13,7 +13,7 @@ #include "MallocBuffer.hpp" -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) #include "ChaiBuffer.hpp" #endif @@ -45,7 +45,7 @@ struct RAJAHelper< serialPolicy > static constexpr MemorySpace space = MemorySpace::CPU; }; -#if defined(USE_OPENMP) +#if defined(LVARRAY_USE_OPENMP) using parallelHostPolicy = RAJA::omp_parallel_for_exec; @@ -59,7 +59,7 @@ struct RAJAHelper< parallelHostPolicy > #endif -#if defined(USE_CUDA) +#if defined(LVARRAY_USE_CUDA) template< unsigned long THREADS_PER_BLOCK > using parallelDevicePolicy = RAJA::cuda_exec< THREADS_PER_BLOCK >; @@ -102,7 +102,7 @@ struct PairComp } }; -#if defined(USE_CHAI) +#if defined(LVARRAY_USE_CHAI) template< typename T > using DEFAULT_BUFFER = ChaiBuffer< T >; #else