Skip to content

Commit 33a933c

Browse files
authored
Update src/shamrock/include/shamrock/patch/PatchDataField.hpp
1 parent 0f431e2 commit 33a933c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/shamrock/include/shamrock/patch/PatchDataField.hpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,16 @@ class PatchDataField {
391391
// buffer of booleans to store result of the condition
392392
sham::DeviceBuffer<u32> mask(obj_cnt, dev_sched);
393393

394-
return get_ids_where_recycle_buffer(mask, cd_true, args...);
394+
sham::kernel_call(
395+
q,
396+
sham::MultiRef{buf},
397+
sham::MultiRef{mask},
398+
obj_cnt,
399+
[=, nvar_field = nvar](u32 id, const T *__restrict acc, u32 *__restrict acc_mask) {
400+
acc_mask[id] = cd_true(acc, id * nvar_field, args...);
401+
});
402+
403+
return shamalgs::stream_compact(dev_sched, mask, obj_cnt);
395404
} else {
396405
return sham::DeviceBuffer<u32>(0, dev_sched);
397406
}

0 commit comments

Comments
 (0)