Skip to content

Commit

Permalink
Fixed various compilation errors introduced by #12 and #34
Browse files Browse the repository at this point in the history
  • Loading branch information
carljohnsen committed Sep 19, 2024
1 parent 66f898f commit 7644a26
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/lib/cpp/cpu_seq/morphology.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ namespace cpu_seq {
// Apply the spherical kernel
bool value = neutral;

#pragma omp simd collapse(3) reduction(op:value)
for (int32_t pz = -radius; pz <= radius; pz++) {
for (int32_t py = -radius; py <= radius; py++) {
for (int32_t px = -radius; px <= radius; px++) {
Expand Down Expand Up @@ -139,8 +138,8 @@ namespace cpu_seq {
int64_t X[3] = {z, y, x};
int64_t limits[6];
for (int axis = 0; axis < 3; axis++) {
limits[(axis*2)] = -min(radius, X[axis]);
limits[(axis*2)+1] = min(radius, N[axis] - X[axis] - 1);
limits[(axis*2)] = -std::min(radius, X[axis]);
limits[(axis*2)+1] = std::min(radius, N[axis] - X[axis] - 1);
}

// Apply the spherical kernel
Expand Down
5 changes: 2 additions & 3 deletions src/lib/cpp/gpu/morphology.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ namespace gpu {
// Apply the spherical kernel
bool value = neutral;

#pragma omp simd collapse(3) reduction(op:value)
for (int32_t pz = -radius; pz <= radius; pz++) {
for (int32_t py = -radius; py <= radius; py++) {
for (int32_t px = -radius; px <= radius; px++) {
Expand Down Expand Up @@ -155,8 +154,8 @@ namespace gpu {
int64_t X[3] = {z, y, x};
int64_t limits[6];
for (int axis = 0; axis < 3; axis++) {
limits[(axis*2)] = -min(radius, X[axis]);
limits[(axis*2)+1] = min(radius, N[axis] - X[axis] - 1);
limits[(axis*2)] = -std::min(radius, X[axis]);
limits[(axis*2)+1] = std::min(radius, N[axis] - X[axis] - 1);
}

// Apply the spherical kernel
Expand Down
4 changes: 2 additions & 2 deletions src/lib/cpp/include/boilerplate.hh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
#define FOR_BLOCK_BEGIN(ARR) \
for (int64_t ARR##_buffer_start = 0; ARR##_buffer_start < ARR##_length; ARR##_buffer_start += acc_block_size<ARR##_type>) { \
ARR##_type *ARR##_buffer = (ARR##_type *) ARR.data + ARR##_buffer_start; \
ssize_t ARR##_buffer_length = min(acc_block_size<ARR##_type>, ARR##_length-ARR##_buffer_start); \
ssize_t ARR##_buffer_length = std::min(acc_block_size<ARR##_type>, ARR##_length-ARR##_buffer_start); \
PRAGMA(acc data copy(ARR##_buffer[:ARR##_buffer_length])) \
{

Expand Down Expand Up @@ -139,7 +139,7 @@
for (int64_t ARR_IN##_buffer_start = 0; ARR_IN##_buffer_start < ARR_IN##_length; ARR_IN##_buffer_start += acc_block_size<ARR_IN##_type> / 2) { \
ARR_IN##_type *ARR_IN##_buffer = (ARR_IN##_type *) ARR_IN.data + ARR_IN##_buffer_start; \
ARR_OUT##_type *ARR_OUT##_buffer = (ARR_OUT##_type *) ARR_OUT.data + ARR_IN##_buffer_start; \
ssize_t ARR_IN##_buffer_length = min(acc_block_size<ARR_IN##_type>, ARR_IN##_length - ARR_IN##_buffer_start); \
ssize_t ARR_IN##_buffer_length = std::min(acc_block_size<ARR_IN##_type>, ARR_IN##_length - ARR_IN##_buffer_start); \
PRAGMA(acc data copyin(ARR_IN##_buffer[:ARR_IN##_buffer_length]) copy(ARR_OUT##_buffer[:ARR_IN##_buffer_length])) \
{

Expand Down
2 changes: 1 addition & 1 deletion src/lib/py/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from config.paths import binary_root, hdf5_root
import h5py
import lib.gpu.bitpacking as lib_bitpacking
import lib.cpp.gpu.bitpacking as lib_bitpacking
import lib.cpp.cpu.io as lib_io
import lib.cpp.cpu.general as lib_general
import lib.cpp.gpu.morphology as lib_morphology
Expand Down

0 comments on commit 7644a26

Please sign in to comment.