Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions parsec/mca/device/device_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "parsec/scheduling.h"

#include <limits.h>
#include <threads.h>

#define PARSEC_DEVICE_DATA_COPY_ATOMIC_SENTINEL 1024

Expand All @@ -39,6 +40,8 @@ static int parsec_gpu_profiling_initiated = 0;
int parsec_gpu_output_stream = -1;
int parsec_gpu_verbosity;

static thread_local int active_w2r_tasks = 0;

static inline int
parsec_device_check_space_needed(parsec_device_gpu_module_t *gpu_device,
parsec_gpu_task_t *gpu_task)
Expand Down Expand Up @@ -2596,9 +2599,13 @@ parsec_device_kernel_scheduler( parsec_device_module_t *module,

/* TODO: check this */
/* If we can extract data go for it, otherwise try to drain the pending tasks */
gpu_task = parsec_gpu_create_w2r_task(gpu_device, es);
if( NULL != gpu_task )
goto get_data_out_of_device;
if (active_w2r_tasks == 0) {
gpu_task = parsec_gpu_create_w2r_task(gpu_device, es);
if( NULL != gpu_task ) {
active_w2r_tasks++;
goto get_data_out_of_device;
}
}
}
gpu_task = progress_task;

Expand Down Expand Up @@ -2694,6 +2701,7 @@ parsec_device_kernel_scheduler( parsec_device_module_t *module,
PARSEC_LIST_ITEM_SINGLETON(gpu_task);
if (gpu_task->task_type == PARSEC_GPU_TASK_TYPE_D2HTRANSFER) {
parsec_gpu_complete_w2r_task(gpu_device, gpu_task, es);
active_w2r_tasks--;
gpu_task = progress_task;
goto fetch_task_from_shared_queue;
}
Expand Down
Loading