Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Germasch msvc fixes #1581

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source/adios2/engine/hdf5/HDF5ReaderP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ size_t HDF5ReaderP::ReadDataset(hid_t dataSetId, hid_t h5Type,
}
else
{
hsize_t start[ndims], count[ndims], stride[ndims];
std::vector<hsize_t> start(ndims), count(ndims), stride(ndims);
bool isOrderC = helper::IsRowMajor(m_IO.m_HostLanguage);

for (int i = 0; i < ndims; i++)
Expand All @@ -164,12 +164,12 @@ size_t HDF5ReaderP::ReadDataset(hid_t dataSetId, hid_t h5Type,
slabsize *= count[i];
stride[i] = 1;
}
hid_t ret = H5Sselect_hyperslab(fileSpace, H5S_SELECT_SET, start,
stride, count, NULL);
hid_t ret = H5Sselect_hyperslab(fileSpace, H5S_SELECT_SET, start.data(),
stride.data(), count.data(), NULL);
if (ret < 0)
return 0;

hid_t memDataSpace = H5Screate_simple(ndims, count, NULL);
hid_t memDataSpace = H5Screate_simple(ndims, count.data(), NULL);
interop::HDF5TypeGuard g_mds(memDataSpace, interop::E_H5_SPACE);

int elementsRead = 1;
Expand Down
16 changes: 8 additions & 8 deletions source/adios2/helper/adiosMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ T ReadValue(const std::vector<char> &buffer, size_t &position,
* @param srcMemCount
*/
template <class T, class U>
void CopyMemory(T *dest, const Dims &destStart, const Dims &destCount,
const bool destRowMajor, const U *src, const Dims &srcStart,
const Dims &srcCount, const bool srcRowMajor,
const bool endianReverse = false,
const Dims &destMemStart = Dims(),
const Dims &destMemCount = Dims(),
const Dims &srcMemStart = Dims(),
const Dims &srcMemCount = Dims()) noexcept;
void CopyMemoryBlock(T *dest, const Dims &destStart, const Dims &destCount,
const bool destRowMajor, const U *src,
const Dims &srcStart, const Dims &srcCount,
const bool srcRowMajor, const bool endianReverse = false,
const Dims &destMemStart = Dims(),
const Dims &destMemCount = Dims(),
const Dims &srcMemStart = Dims(),
const Dims &srcMemCount = Dims()) noexcept;

void CopyPayload(char *dest, const Dims &destStart, const Dims &destCount,
const bool destRowMajor, const char *src, const Dims &srcStart,
Expand Down
12 changes: 6 additions & 6 deletions source/adios2/helper/adiosMemory.inl
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ void ClipVector(std::vector<T> &vec, const size_t start,
}

template <class T, class U>
void CopyMemory(T *dest, const Dims &destStart, const Dims &destCount,
const bool destRowMajor, const U *src, const Dims &srcStart,
const Dims &srcCount, const bool srcRowMajor,
const bool endianReverse, const Dims &destMemStart,
const Dims &destMemCount, const Dims &srcMemStart,
const Dims &srcMemCount) noexcept
void CopyMemoryBlock(T *dest, const Dims &destStart, const Dims &destCount,
const bool destRowMajor, const U *src,
const Dims &srcStart, const Dims &srcCount,
const bool srcRowMajor, const bool endianReverse,
const Dims &destMemStart, const Dims &destMemCount,
const Dims &srcMemStart, const Dims &srcMemCount) noexcept
{
// transform everything to payload dims
const Dims destStartPayload = PayloadDims<T>(destStart, destRowMajor);
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/toolkit/format/bp3/BP3Serializer.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ void BP3Serializer::PutPayloadInBuffer(
ProfilerStart("memcpy");
if (!blockInfo.MemoryStart.empty())
{
helper::CopyMemory(
helper::CopyMemoryBlock(
reinterpret_cast<T *>(m_Data.m_Buffer.data() + m_Data.m_Position),
blockInfo.Start, blockInfo.Count, sourceRowMajor, blockInfo.Data,
blockInfo.Start, blockInfo.Count, sourceRowMajor, false, Dims(),
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/toolkit/format/bp4/BP4Serializer.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ void BP4Serializer::PutPayloadInBuffer(
if (!blockInfo.MemoryStart.empty())
{
// TODO make it a BP4Serializer function
helper::CopyMemory(
helper::CopyMemoryBlock(
reinterpret_cast<T *>(m_Data.m_Buffer.data() + m_Data.m_Position),
blockInfo.Start, blockInfo.Count, sourceRowMajor, blockInfo.Data,
blockInfo.Start, blockInfo.Count, sourceRowMajor, false, Dims(),
Expand Down
4 changes: 2 additions & 2 deletions source/adios2/toolkit/interop/hdf5/HDF5Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ void HDF5Common::AddVar(core::IO &io, std::string const &name, hid_t datasetId,
{
hid_t dspace = H5Dget_space(datasetId);
const int ndims = H5Sget_simple_extent_ndims(dspace);
hsize_t dims[ndims];
H5Sget_simple_extent_dims(dspace, dims, NULL);
std::vector<hsize_t> dims(ndims);
H5Sget_simple_extent_dims(dspace, dims.data(), NULL);
H5Sclose(dspace);

Dims shape;
Expand Down