-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a check in the HDF5 data reader to check that the metadata for
each field actually matches the dimensions of the data fields. Added a helper function for conduit to allow the calculation of a product of a data array's elements.
- Loading branch information
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// Copyright (c) 2014-2023, Lawrence Livermore National Security, LLC. | ||
// Produced at the Lawrence Livermore National Laboratory. | ||
// Written by the LBANN Research Team (B. Van Essen, et al.) listed in | ||
// the CONTRIBUTORS file. <[email protected]> | ||
// | ||
// LLNL-CODE-697807. | ||
// All rights reserved. | ||
// | ||
// This file is part of LBANN: Livermore Big Artificial Neural Network | ||
// Toolkit. For details, see http://software.llnl.gov/LBANN or | ||
// http://github.com/LBANN. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "Licensee"); you | ||
// may not use this file except in compliance with the License. You may | ||
// obtain a copy of the License at: | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
// implied. See the License for the specific language governing | ||
// permissions and limitations under the license. | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
#include "conduit/conduit_data_array.hpp" | ||
|
||
namespace conduit { | ||
|
||
template <typename T> | ||
T | ||
data_array_prod(DataArray<T> a) | ||
{ | ||
T res = 1; | ||
for(index_t i = 0; i < a.number_of_elements(); i++) | ||
{ | ||
const T &val = a.element(i); | ||
res *= val; | ||
} | ||
|
||
return res; | ||
} | ||
|
||
} // conduit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters