Commit 2c03e800 authored by Leonardo Solis's avatar Leonardo Solis

corrected data types: this removes undeterministic segfaults on cpus

parent 6cbe3302
......@@ -448,12 +448,12 @@ partial_interE[get_local_id(0)] += 16777216.0f;
else
{
// Getting coordinates
int x_low = (int)floor(x);
int y_low = (int)floor(y);
int z_low = (int)floor(z);
int x_high = (int)ceil(x);
int y_high = (int)ceil(y);
int z_high = (int)ceil(z);
uint x_low = (uint)floor(x);
uint y_low = (uint)floor(y);
uint z_low = (uint)floor(z);
uint x_high = (uint)ceil(x);
uint y_high = (uint)ceil(y);
uint z_high = (uint)ceil(z);
float dx = x - x_low;
float dy = y - y_low;
float dz = z - z_low;
......
......@@ -314,12 +314,12 @@ void gpu_calc_energy(
else
{
// Getting coordinates
int x_low = (int)floor(x);
int y_low = (int)floor(y);
int z_low = (int)floor(z);
int x_high = (int)ceil(x);
int y_high = (int)ceil(y);
int z_high = (int)ceil(z);
uint x_low = (uint)floor(x);
uint y_low = (uint)floor(y);
uint z_low = (uint)floor(z);
uint x_high = (uint)ceil(x);
uint y_high = (uint)ceil(y);
uint z_high = (uint)ceil(z);
float dx = x - x_low;
float dy = y - y_low;
float dz = z - z_low;
......
......@@ -381,12 +381,12 @@ void gpu_calc_gradient(
else
{
// Getting coordinates
int x_low = (int)floor(x);
int y_low = (int)floor(y);
int z_low = (int)floor(z);
int x_high = (int)ceil(x);
int y_high = (int)ceil(y);
int z_high = (int)ceil(z);
uint x_low = (uint)floor(x);
uint y_low = (uint)floor(y);
uint z_low = (uint)floor(z);
uint x_high = (uint)ceil(x);
uint y_high = (uint)ceil(y);
uint z_high = (uint)ceil(z);
float dx = x - x_low;
float dy = y - y_low;
float dz = z - z_low;
......
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