Skip to content
Snippets Groups Projects
Commit 6e9ee086 authored by James Wilson's avatar James Wilson
Browse files

Cleaned up assertion

parent eb7e7f6d
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
// Terrance Howard <heyterrance@gmail.com>
#pragma once
#include <assert.h>
#include "myAssert.h"
#include "CudaUtil.cuh"
#include "TabulatedMethods.cuh"
......@@ -268,7 +268,7 @@ void createPairlists(Vector3* __restrict__ pos, const int num, const int numRepl
// Skip excludes
// Implementation requires that aj increases monotonically
assert( ajLast < aj ); ajLast = aj; // TODO: remove this sanity check
myAssert( ajLast < aj ); ajLast = aj; // TODO: remove this sanity check
if (nextEx == (aj - repID * num)) {
nextEx = (currEx < ex_end - 1) ? excludes[++currEx].ind2 : -1;
......
#include <assert.h>
#include "myAssert.h"
#include "Configuration.h"
#include "RigidBodyType.h"
#include "Reservoir.h"
......@@ -298,7 +298,7 @@ void RigidBodyType::initializeParticleLists() {
if (gridNames[k] == gridName) {
// Copy type j particles to particles[i]
memcpy( &(particles[i][pid]), tmp, sizeof(int)*currId );
assert(currId == conf->numPartsOfType[j]);
myAssert(currId == conf->numPartsOfType[j]);
pid += conf->numPartsOfType[j];
}
}
......
......@@ -43,8 +43,8 @@ __device__ inline void computeAngle(const TabulatedAnglePotential* __restrict__
// tableAngle[1] stores the potential at angle_step * 2, etc.
// 'home' is the index after which 'convertedAngle' would appear if it were stored in the table
int home = int(floor(angle));
assert(home >= 0);
assert(home < a->size);
myAssert(home >= 0);
myAssert(home < a->size);
// // Make angle the distance from [0,1) from the first index in the potential array index
// angle -= home;
......@@ -111,8 +111,8 @@ __device__ inline void computeDihedral(const TabulatedDihedralPotential* __restr
int home = (int) floorf(t);
t = t - home;
assert(home >= 0);
assert(home < d->size);
myAssert(home >= 0);
myAssert(home < d->size);
// home = home % size;
int home1 = (home + 1) >= d->size ? (home+1-d->size) : home+1;
......@@ -126,7 +126,7 @@ __device__ inline void computeDihedral(const TabulatedDihedralPotential* __restr
// avoid singularity when one angle is straight
force = (crossABC.rLength() > 1.0f || crossBCD.rLength() > 1.0f) ? 0.0f : force;
assert( force < 10000.0f );
myAssert( force < 10000.0f );
f1 *= force;
f2 *= force;
f3 *= force;
......
#include "myAssert.h"
#ifdef __APPLE__
__host__ __device__ void myAssert(bool statement) { }
#else
#include <assert.h>
__host__ __device__ void myAssert(bool statement) { assert(statement); }
#endif
\ No newline at end of file
#pragma once
// #include <assert.h>
__host__ __device__ void myAssert(bool statement);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment