From 2b30d775b9bf5580ca92aacdbab3c0c7ebcb4f45 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 23 Jan 2022 11:48:23 -0800 Subject: [PATCH] ircd::simt: Add intrinsic integer max. --- include/ircd/simt/reduce_max.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/ircd/simt/reduce_max.h b/include/ircd/simt/reduce_max.h index 5394fc04b..7c10beacc 100644 --- a/include/ircd/simt/reduce_max.h +++ b/include/ircd/simt/reduce_max.h @@ -30,3 +30,23 @@ ircd_simt_reduce_max_flldr(__local float *const buf, } } #endif + +#ifdef __OPENCL_VERSION__ +inline void +ircd_simt_reduce_max_illdr(__local int *const buf, + const uint ln, + const uint li) +{ + buf[li] = atomic_max(buf, buf[li]); +} +#endif + +#ifdef __OPENCL_VERSION__ +inline void +ircd_simt_reduce_max_ulldr(__local uint *const buf, + const uint ln, + const uint li) +{ + buf[li] = atomic_max(buf, buf[li]); +} +#endif