From 1608a5b40ccbb1810cea0d992b3fb45f218c0d2d Mon Sep 17 00:00:00 2001 From: xsjk Date: Fri, 8 May 2026 02:37:09 +0800 Subject: [PATCH] Fix CUDA minmax reduction for volatile collectors --- compyle/array.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/compyle/array.py b/compyle/array.py index 5b5a034..e737ac4 100644 --- a/compyle/array.py +++ b/compyle/array.py @@ -97,6 +97,22 @@ def get_backend(backend=None): minmax_operator_tpl = """ + __device__ ${dtype}() + { + } + + __device__ ${dtype}(${dtype} const volatile &src) + { + % for prop in prop_names: + % if not only_max: + this->cur_min_${prop} = src.cur_min_${prop}; + % endif + % if not only_min: + this->cur_max_${prop} = src.cur_max_${prop}; + % endif + % endfor + } + __device__ ${dtype} volatile &operator=( ${dtype} const &src) volatile {