Skip to content
Snippets Groups Projects
Commit 44f8a0df authored by James Willis's avatar James Willis
Browse files

Changed type of max_d from float to int.

parent a38b7ff6
Branches
Tags
1 merge request!396Avx512 fixes
...@@ -114,6 +114,7 @@ __attribute__((always_inline)) INLINE void cache_init(struct cache *c, ...@@ -114,6 +114,7 @@ __attribute__((always_inline)) INLINE void cache_init(struct cache *c,
unsigned int pad = 2 * VEC_SIZE, rem = count % VEC_SIZE; unsigned int pad = 2 * VEC_SIZE, rem = count % VEC_SIZE;
if (rem > 0) pad += VEC_SIZE - rem; if (rem > 0) pad += VEC_SIZE - rem;
unsigned int sizeBytes = (count + pad) * sizeof(float); unsigned int sizeBytes = (count + pad) * sizeof(float);
unsigned int sizeIntBytes = (count + pad) * sizeof(int);
int error = 0; int error = 0;
/* Free memory if cache has already been allocated. */ /* Free memory if cache has already been allocated. */
...@@ -137,7 +138,7 @@ __attribute__((always_inline)) INLINE void cache_init(struct cache *c, ...@@ -137,7 +138,7 @@ __attribute__((always_inline)) INLINE void cache_init(struct cache *c,
error += posix_memalign((void **)&c->vy, CACHE_ALIGN, sizeBytes); error += posix_memalign((void **)&c->vy, CACHE_ALIGN, sizeBytes);
error += posix_memalign((void **)&c->vz, CACHE_ALIGN, sizeBytes); error += posix_memalign((void **)&c->vz, CACHE_ALIGN, sizeBytes);
error += posix_memalign((void **)&c->h, CACHE_ALIGN, sizeBytes); error += posix_memalign((void **)&c->h, CACHE_ALIGN, sizeBytes);
error += posix_memalign((void **)&c->max_d, CACHE_ALIGN, sizeBytes); error += posix_memalign((void **)&c->max_d, CACHE_ALIGN, sizeIntBytes);
if (error != 0) if (error != 0)
error("Couldn't allocate cache, no. of particles: %d", (int)count); error("Couldn't allocate cache, no. of particles: %d", (int)count);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment