Skip to content

Commit

Permalink
fix code execution with Intel CPU driver
Browse files Browse the repository at this point in the history
  • Loading branch information
kif committed Dec 7, 2024
1 parent af92780 commit b23d02a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/pyFAI/opencl/azim_csr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,8 +1301,6 @@ def medfilt(self, data, dark=None, dummy=None, delta_dummy=None,

res = Integrate1dtpl(self.bin_centers, avgint, sem, merged[:, 0], merged[:, 2], merged[:, 4], merged[:, 6],
std, sem, merged[:, 7])
# print(self.get_buffer("merged8")[0])
# raise RuntimeError()
return res


Expand Down
8 changes: 4 additions & 4 deletions src/pyFAI/opencl/test/test_ocl_azim_csr.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ def integrate_ng(self, block_size=None, method_called="integrate_ng", extra=None


# histogram of normalization
print(ref.sum_normalization)
print(res.normalization)
# print(ref.sum_normalization)
# print(res.normalization)
err = abs((res.normalization - ref.sum_normalization))
print(err)
# print(err)
self.assertLess(err.max(), 5e-4, "normalization content is the same: %s<5e-5" % (err.max))

# histogram of signal
Expand All @@ -136,7 +136,7 @@ def integrate_ng(self, block_size=None, method_called="integrate_ng", extra=None

# Intensities are not that different:
delta = ref.intensity - res.intensity
print(delta)
# print(delta)
self.assertLessEqual(abs(delta).max(), 1e-5, "intensity is almost the same")


Expand Down
8 changes: 6 additions & 2 deletions src/pyFAI/resources/openCL/collective/reduction.cl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ int inline sum_int_reduction(local int* shared)
shared[tid] += shared[tid+stride];
}
barrier(CLK_LOCAL_MEM_FENCE);
return shared[0];
int res = shared[0];
barrier(CLK_LOCAL_MEM_FENCE);
return res;
}

/* sum all elements in a shared memory, same size as the workgroup size 0
Expand All @@ -35,7 +37,9 @@ int inline sum_int_atomic(local int* shared)
if (tid)
atomic_add(shared, value);
barrier(CLK_LOCAL_MEM_FENCE);
return shared[0];
int res = shared[0];
barrier(CLK_LOCAL_MEM_FENCE);
return res;
}

/*
Expand Down
4 changes: 3 additions & 1 deletion src/pyFAI/resources/openCL/medfilt.cl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ float2 inline sum_float2_reduction(local float* shared)

}
barrier(CLK_LOCAL_MEM_FENCE);
return (float2)(shared[0], shared[1]);
float2 res = (float2)(shared[0], shared[1]);
barrier(CLK_LOCAL_MEM_FENCE);
return res;
}


Expand Down

0 comments on commit b23d02a

Please sign in to comment.