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