Skip to content

Commit 2453349

Browse files
committed
Allow btl/sm to memcpy from unified memory
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
1 parent a51da91 commit 2453349

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

opal/datatype/opal_convertor.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,18 @@ static inline int32_t opal_convertor_on_device(const opal_convertor_t *pConverto
192192
return !!(pConvertor->flags & CONVERTOR_ACCELERATOR);
193193
}
194194

195+
static inline int32_t opal_convertor_on_discrete_device(const opal_convertor_t *pConvertor)
196+
{
197+
return (CONVERTOR_ACCELERATOR == ((pConvertor->flags & CONVERTOR_ACCELERATOR) |
198+
(pConvertor->flags & CONVERTOR_ACCELERATOR_UNIFIED)));
199+
}
200+
201+
static inline int32_t opal_convertor_on_unified_device(const opal_convertor_t *pConvertor)
202+
{
203+
return (!!(pConvertor->flags & CONVERTOR_ACCELERATOR) &&
204+
!!(pConvertor->flags & CONVERTOR_ACCELERATOR_UNIFIED));
205+
}
206+
195207
/**
196208
* Update the size of the remote datatype representation. The size will
197209
* depend on the configuration of the master convertor. In homogeneous

opal/mca/btl/sm/btl_sm_module.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ static struct mca_btl_base_descriptor_t *sm_prepare_src(struct mca_btl_base_modu
430430

431431
/* in place send fragment */
432432
if (OPAL_UNLIKELY(opal_convertor_need_buffers(convertor) ||
433-
opal_convertor_on_device(convertor))) {
433+
opal_convertor_on_discrete_device(convertor) ||
434+
(opal_convertor_on_unified_device(convertor) &&
435+
total_size > (size_t) mca_btl_sm_component.max_inline_send))) {
434436
uint32_t iov_count = 1;
435437
struct iovec iov;
436438

0 commit comments

Comments
 (0)