Skip to content

Commit 82e976e

Browse files
committed
sw: Add snrt_dma_start_1d_reduction with communicator argument
1 parent 47d4319 commit 82e976e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

sw/runtime/src/dma.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,24 @@ static inline uint32_t snrt_dma_start_1d_reduction(
135135
return txid;
136136
}
137137

138+
/**
139+
* @brief Start an asynchronous reduction 1D DMA transfer with 64-bit wide
140+
* pointers.
141+
* @param comm The communicator for the reduction operation
142+
* @param opcode Reduction operation
143+
* @see snrt_dma_start_1d(uint64_t, uint64_t, size_t, uint32_t) for a
144+
* description of the other parameters.
145+
*/
146+
static inline uint32_t snrt_dma_start_1d_reduction(
147+
uint64_t dst, uint64_t src, size_t size, snrt_comm_t comm,
148+
snrt_collective_opcode_t opcode, const uint32_t channel = 0) {
149+
150+
uint64_t mask = snrt_get_collective_mask(comm);
151+
uint32_t txid = snrt_dma_start_1d_reduction(dst, src, size, mask, opcode,
152+
channel);
153+
return txid;
154+
}
155+
138156
/**
139157
* @brief Start an asynchronous multicast 1D DMA transfer with 64-bit wide
140158
* pointers.

0 commit comments

Comments
 (0)