_aligned_malloc() on Windows first takes size, then alignment, which is the opposite of how the similar function behaves on Linux. Memory allocated by it also has to be freed using _aligned_free(), unlike Linux where we can use regular free().

Edit aligned_alloc() macro and add a aligned_free() one to align with the above behaviour.
Αυτή η υποβολή περιλαμβάνεται σε:
Vladislav Sytchenko
2019-10-17 18:58:32 -04:00
γονέας 10cc2f4ab3
υποβολή 8f0a226660
2 αρχεία άλλαξαν με 7 προσθήκες και 3 διαγραφές
@@ -120,8 +120,8 @@ void simpleTest2(size_t numElements, bool usePinnedHost) {
HIPCHECK(hipHostFree(A_h1));
HIPCHECK(hipHostFree(A_h2));
} else {
free(A_h1);
free(A_h2);
aligned_free(A_h1);
aligned_free(A_h2);
}
}