diff --git a/src/ComputeForce.cuh b/src/ComputeForce.cuh
index 6a7e4fe0ea4535947f335aa55cc5743a259f51d3..b2bab6e5444c36173e37bb3eb2ff3abc2378c760 100644
--- a/src/ComputeForce.cuh
+++ b/src/ComputeForce.cuh
@@ -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;
diff --git a/src/RigidBodyType.cu b/src/RigidBodyType.cu
index 838e9cc31aedf589b0c012a39c316ede933f89a4..5d4d3a4ebd71ad31109e9d0fc0c62804d8127850 100644
--- a/src/RigidBodyType.cu
+++ b/src/RigidBodyType.cu
@@ -1,4 +1,4 @@
-#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];
}
}
diff --git a/src/TabulatedMethods.cuh b/src/TabulatedMethods.cuh
index 84965ed9e783300abc76090266f18bbbb983593a..c298ab324ab8da30dad207fdea3f4966b69a580c 100644
--- a/src/TabulatedMethods.cuh
+++ b/src/TabulatedMethods.cuh
@@ -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;
diff --git a/src/myAssert.cu b/src/myAssert.cu
new file mode 100644
index 0000000000000000000000000000000000000000..99f57d28b215628bcfaef641ff29b565bed2cfa5
--- /dev/null
+++ b/src/myAssert.cu
@@ -0,0 +1,8 @@
+#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
diff --git a/src/myAssert.h b/src/myAssert.h
new file mode 100644
index 0000000000000000000000000000000000000000..a50c1ce74998d4f96d92fa50011f535e1630f20e
--- /dev/null
+++ b/src/myAssert.h
@@ -0,0 +1,4 @@
+#pragma once
+// #include <assert.h>
+
+__host__ __device__ void myAssert(bool statement);