diff --git a/opal/mca/accelerator/rocm/accelerator_rocm_component.c b/opal/mca/accelerator/rocm/accelerator_rocm_component.c index 4358bb345f3..86d71c0034b 100644 --- a/opal/mca/accelerator/rocm/accelerator_rocm_component.c +++ b/opal/mca/accelerator/rocm/accelerator_rocm_component.c @@ -33,7 +33,6 @@ size_t opal_accelerator_rocm_memcpyH2D_limit=1048576; /* Initialization lock for lazy rocm initialization */ static opal_mutex_t accelerator_rocm_init_lock; static bool accelerator_rocm_init_complete = false; -static int checkmem; hipStream_t *opal_accelerator_rocm_MemcpyStream = NULL; @@ -171,6 +170,7 @@ static int accelerator_rocm_component_register(void) int opal_accelerator_rocm_lazy_init() { + int prio_hi, prio_lo; int err = OPAL_SUCCESS; /* Double checked locking to avoid having to @@ -191,7 +191,7 @@ int opal_accelerator_rocm_lazy_init() /* Create stream for use in cuMemcpyAsync synchronous copies */ hipStream_t memcpy_stream; err = hipStreamCreate(&memcpy_stream); - if (OPAL_UNLIKELY(result != hipSuccess)) { + if (OPAL_UNLIKELY(err != hipSuccess)) { opal_show_help("help-accelerator-rocm.txt", "hipStreamCreateWithFlags failed", true, OPAL_PROC_MY_HOSTNAME, err); goto out; diff --git a/opal/mca/accelerator/rocm/accelerator_rocm_module.c b/opal/mca/accelerator/rocm/accelerator_rocm_module.c index 8180dc24409..ee31233199f 100644 --- a/opal/mca/accelerator/rocm/accelerator_rocm_module.c +++ b/opal/mca/accelerator/rocm/accelerator_rocm_module.c @@ -139,11 +139,11 @@ static int mca_accelerator_rocm_check_addr (const void *addr, int *dev_id, uint6 static int mca_accelerator_rocm_get_default_stream(int dev_id, opal_accelerator_stream_t **stream) { - int delayed_init = opal_accelerator_rocm_delayed_init(); + int delayed_init = opal_accelerator_rocm_lazy_init(); if (OPAL_UNLIKELY(0 != delayed_init)) { return delayed_init; } - *stream = &opal_accelerator_rocm_default_stream; + *stream = &opal_accelerator_rocm_default_stream.base; return OPAL_SUCCESS; } @@ -359,7 +359,7 @@ static int mca_accelerator_rocm_memmove_async(int dest_dev_id, int src_dev_id, v hipError_t result; void *ptr; - int delayed_init = opal_accelerator_rocm_delayed_init(); + int delayed_init = opal_accelerator_rocm_lazy_init(); if (OPAL_UNLIKELY(0 != delayed_init)) { return delayed_init; } @@ -649,7 +649,7 @@ static int mca_accelerator_rocm_mem_alloc_stream( //#if HIP_VERSION >= ??? //TODO hipError_t result; - int delayed_init = opal_accelerator_rocm_delayed_init(); + int delayed_init = opal_accelerator_rocm_lazy_init(); if (OPAL_UNLIKELY(0 != delayed_init)) { return delayed_init; } @@ -734,7 +734,7 @@ static int mca_accelerator_rocm_get_num_devices(int *num_devices) static int mca_accelerator_rocm_get_mem_bw(int device, float *bw) { - int delayed_init = opal_accelerator_rocm_delayed_init(); + int delayed_init = opal_accelerator_rocm_lazy_init(); if (OPAL_UNLIKELY(0 != delayed_init)) { return delayed_init; }