Commit 7c6d50e1 authored by kicici's avatar kicici

Rename `_ALIGNBYTES_` to `CUBISM_ALIGNMENT`.

Not sure about this, but now Cubism automatically defines
`CUBISM_ALIGNMENT` if it is not already defined.
That means that if the app intends to define the value,
it must define it before including _any_ Cubism header.

An alternative would be to put these ifdefs to Matrix3D.h (the only file
using the constant), but probably better to be strict.
parent 74f6ad12
......@@ -11,6 +11,14 @@
#define CUBISM_ON_FERMI
#endif
#ifdef _ALIGNBYTES_
#warning _ALIGNBYTES_ is deprecated, use CUBISM_ALIGN_BYTES instead.
#define CUBISM_ALIGNMENT _ALIGNBYTES_
#elif !defined(CUBISM_ALIGNMENT)
#define CUBISM_ALIGNMENT // If you get duplicate definition, put all Cubism
// includes after the main header include.
#endif
#ifndef CUBISM_NAMESPACE_BEGIN
#define CUBISM_NAMESPACE_BEGIN namespace cubism {
#endif
......
......@@ -59,8 +59,8 @@ public:
//allocator<DataType> alloc;
//m_pData = alloc.allocate(m_nElements);
const int retval = posix_memalign((void **)&m_pData, std::max(8, _ALIGNBYTES_), sizeof(DataType)*m_nElements);
(void)retval; // Silent -Wunused-variable.
const int retval = posix_memalign((void **)&m_pData, std::max(8, CUBISM_ALIGNMENT), sizeof(DataType)*m_nElements);
(void)(retval + retval); // Silent -Wunused-variable.
// printf("Allocated %d bytes at 0x%lx\n", sizeof(DataType)*m_nElements, m_pData); // peh
assert(retval == 0);
assert(m_pData != NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment