Commit 334d2376 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Removed some double --> float conversions that slipped under the carpet

parent 67061bd5
......@@ -71,7 +71,7 @@ gravity_compute_timestep_self(const struct phys_const* const phys_const,
const float ac = (ac2 > 0.f) ? sqrtf(ac2) : FLT_MIN;
const float dt = sqrt(2.f * const_gravity_eta * gp->epsilon / ac);
const float dt = sqrtf(2.f * const_gravity_eta * gp->epsilon / ac);
return dt;
}
......@@ -115,10 +115,10 @@ __attribute__((always_inline)) INLINE static void gravity_init_gpart(
* Multiplies the forces and accelerations by the appropiate constants
*
* @param gp The particle to act upon
* @param const_G Newton's constant
* @param const_G Newton's constant in internal units
*/
__attribute__((always_inline)) INLINE static void gravity_end_force(
struct gpart* gp, double const_G) {
struct gpart* gp, float const_G) {
/* Let's get physical... */
gp->a_grav[0] *= const_G;
......
......@@ -50,7 +50,7 @@ static const float
-10.66666667f,
38.4f,
-48.f,
21.3333333,
21.3333333f,
0.f,
0.f,
-0.066666667f, /* 0.5 < u < 1 */
......
......@@ -41,7 +41,7 @@ __attribute__((always_inline)) INLINE static void kernel_long_grav_eval(
const float arg2 = u * one_over_sqrt_pi;
const float arg3 = -arg1 * arg1;
const float term1 = erfc(arg1);
const float term1 = erfcf(arg1);
const float term2 = arg2 * expf(arg3);
*W = term1 + term2;
......
......@@ -39,8 +39,8 @@ __attribute__((always_inline)) INLINE static void kick_gpart(
/* Compute the time step for this kick */
const int ti_start = (gp->ti_begin + gp->ti_end) / 2;
const int ti_end = gp->ti_end + new_dti / 2;
const double dt = (ti_end - ti_start) * timeBase;
const double half_dt = (ti_end - gp->ti_end) * timeBase;
const float dt = (ti_end - ti_start) * timeBase;
const float half_dt = (ti_end - gp->ti_end) * timeBase;
/* Move particle forward in time */
gp->ti_begin = gp->ti_end;
......@@ -70,8 +70,8 @@ __attribute__((always_inline)) INLINE static void kick_part(
/* Compute the time step for this kick */
const int ti_start = (p->ti_begin + p->ti_end) / 2;
const int ti_end = p->ti_end + new_dti / 2;
const double dt = (ti_end - ti_start) * timeBase;
const double half_dt = (ti_end - p->ti_end) * timeBase;
const float dt = (ti_end - ti_start) * timeBase;
const float half_dt = (ti_end - p->ti_end) * timeBase;
/* Move particle forward in time */
p->ti_begin = p->ti_end;
......
......@@ -1739,7 +1739,7 @@ void DOSUB_PAIR1(struct runner *r, struct cell *ci, struct cell *cj, int sid,
if (ci->ti_end_min > ti_current && cj->ti_end_min > ti_current) return;
/* Get the cell dimensions. */
const float h = fmin(ci->width[0], fmin(ci->width[1], ci->width[2]));
const float h = fminf(ci->width[0], fminf(ci->width[1], ci->width[2]));
/* Get the type of pair if not specified explicitly. */
// if ( sid < 0 )
......@@ -2023,7 +2023,7 @@ void DOSUB_PAIR2(struct runner *r, struct cell *ci, struct cell *cj, int sid,
if (ci->ti_end_min > ti_current && cj->ti_end_min > ti_current) return;
/* Get the cell dimensions. */
const float h = fmin(ci->width[0], fmin(ci->width[1], ci->width[2]));
const float h = fminf(ci->width[0], fminf(ci->width[1], ci->width[2]));
/* Get the type of pair if not specified explicitly. */
// if ( sid < 0 )
......@@ -2336,7 +2336,7 @@ void DOSUB_SUBSET(struct runner *r, struct cell *ci, struct part *parts,
else {
/* Get the cell dimensions. */
const float h = fmin(ci->width[0], fmin(ci->width[1], ci->width[2]));
const float h = fminf(ci->width[0], fminf(ci->width[1], ci->width[2]));
/* Recurse? */
if (ci->split && cj->split &&
......
......@@ -116,9 +116,9 @@ static void scheduler_splittask(struct task *t, struct scheduler *s) {
{-1, -1, -1, 12, 7, 6, 4, 3}, {-1, -1, -1, -1, 8, 7, 5, 4},
{-1, -1, -1, -1, -1, 12, 10, 9}, {-1, -1, -1, -1, -1, -1, 11, 10},
{-1, -1, -1, -1, -1, -1, -1, 12}};
static const float sid_scale[13] = {0.1897, 0.4025, 0.1897, 0.4025, 0.5788,
0.4025, 0.1897, 0.4025, 0.1897, 0.4025,
0.5788, 0.4025, 0.5788};
static const float sid_scale[13] = {0.1897f, 0.4025f, 0.1897f, 0.4025f, 0.5788f,
0.4025f, 0.1897f, 0.4025f, 0.1897f, 0.4025f,
0.5788f, 0.4025f, 0.5788f};
/* Iterate on this task until we're done with it. */
int redo = 1;
......
Supports Markdown
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