diff --git a/boxtree/rotation_classes.py b/boxtree/rotation_classes.py index 97df572cc3994bf7bf1221c087563631337a53fe..4fee3279f0b9ee65918ec13e84247fc7fce64b27 100644 --- a/boxtree/rotation_classes.py +++ b/boxtree/rotation_classes.py @@ -132,7 +132,7 @@ TRANSLATION_CLASS_FINDER_TEMPLATE = ElementwiseTemplate( // Ensure levels are the same. if (box_levels[source_box_id] != box_levels[target_box_id]) { - *error_flag = 1; + atomic_or(error_flag, 1); PYOPENCL_ELWISE_CONTINUE; } @@ -148,7 +148,7 @@ TRANSLATION_CLASS_FINDER_TEMPLATE = ElementwiseTemplate( // Ensure valid translation class. if (translation_class == -1) { - *error_flag = 1; + atomic_or(error_flag, 1); PYOPENCL_ELWISE_CONTINUE; } diff --git a/boxtree/tree_build_kernels.py b/boxtree/tree_build_kernels.py index 3bab74bb6b115fe494294e8b8441d1af779f6d41..9742c4c3f1e5bd3ae38f269c1830e71c1e23021c 100644 --- a/boxtree/tree_build_kernels.py +++ b/boxtree/tree_build_kernels.py @@ -878,7 +878,7 @@ LEVEL_RESTRICT_TPL = Template( box_force_split[child_box_id])) { box_force_split[box_id] = 1; - *have_upper_level_split_box = 1; + atomic_or(have_upper_level_split_box, 1); continue_walk = false; } }