Skip to content

Commit

Permalink
Use starpu_execute_on_each_worker_ex() instead of starpu_execute_on_e…
Browse files Browse the repository at this point in the history
…ach_worker()

The _ex() version allows to provide a task name, which is useful when
using the profiling interface.
  • Loading branch information
philippemilink committed Sep 16, 2024
1 parent ab89eef commit 870b500
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/drivers/cuda/starpu_cublas.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ void starpu_cublas_init(void)
for (i = 0; i < STARPU_MAXCUDADEVS; i++)
STARPU_PTHREAD_MUTEX_INIT0(&mutex[i], NULL);

starpu_execute_on_each_worker(init_cublas_func, NULL, STARPU_CUDA);
starpu_execute_on_each_worker(set_cublas_stream_func, NULL, STARPU_CUDA);
starpu_execute_on_each_worker_ex(init_cublas_func, NULL, STARPU_CUDA, "init_cublas");
starpu_execute_on_each_worker_ex(set_cublas_stream_func, NULL, STARPU_CUDA, "set_cublas_stream_func");

_starpu_cublas_v2_init();
#endif
Expand All @@ -100,7 +100,7 @@ void starpu_cublas_shutdown(void)
#ifdef STARPU_USE_CUDA
if (!starpu_cuda_worker_get_count())
return;
starpu_execute_on_each_worker(shutdown_cublas_func, NULL, STARPU_CUDA);
starpu_execute_on_each_worker_ex(shutdown_cublas_func, NULL, STARPU_CUDA, "shutdown_cublas");

_starpu_cublas_v2_shutdown();
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/cuda/starpu_cusolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void starpu_cusolver_init(void)
#ifdef STARPU_HAVE_LIBCUSOLVER
if (!starpu_cuda_worker_get_count())
return;
starpu_execute_on_each_worker(init_cusolver_func, NULL, STARPU_CUDA);
starpu_execute_on_each_worker_ex(init_cusolver_func, NULL, STARPU_CUDA, "init_cusolver");

if (cusolverDnCreate(&mainDn_handle) != CUSOLVER_STATUS_SUCCESS)
mainDn_handle = NULL;
Expand All @@ -73,7 +73,7 @@ void starpu_cusolver_shutdown(void)
#ifdef STARPU_HAVE_LIBCUSOLVER
if (!starpu_cuda_worker_get_count())
return;
starpu_execute_on_each_worker(shutdown_cusolver_func, NULL, STARPU_CUDA);
starpu_execute_on_each_worker_ex(shutdown_cusolver_func, NULL, STARPU_CUDA, "shutdown_cusolver");

if (mainDn_handle)
cusolverDnDestroy(mainDn_handle);
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/cuda/starpu_cusparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void starpu_cusparse_init(void)
#ifdef STARPU_HAVE_LIBCUSPARSE
if (!starpu_cuda_worker_get_count())
return;
starpu_execute_on_each_worker(init_cusparse_func, NULL, STARPU_CUDA);
starpu_execute_on_each_worker_ex(init_cusparse_func, NULL, STARPU_CUDA, "init_cusparse");

if (cusparseCreate(&main_handle) != CUSPARSE_STATUS_SUCCESS)
main_handle = NULL;
Expand All @@ -59,7 +59,7 @@ void starpu_cusparse_shutdown(void)
#ifdef STARPU_HAVE_LIBCUSPARSE
if (!starpu_cuda_worker_get_count())
return;
starpu_execute_on_each_worker(shutdown_cusparse_func, NULL, STARPU_CUDA);
starpu_execute_on_each_worker_ex(shutdown_cusparse_func, NULL, STARPU_CUDA, "shutdown_cusparse");

if (main_handle)
cusparseDestroy(main_handle);
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/hip/starpu_hipblas.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void starpu_hipblas_init(void)
{
#ifdef STARPU_USE_HIP
#ifdef STARPU_USE_HIPBLAS
starpu_execute_on_each_worker(init_hipblas_func, NULL, STARPU_HIP);
starpu_execute_on_each_worker_ex(init_hipblas_func, NULL, STARPU_HIP, "init_hipblas");

if (hipblasCreate(&main_handle) != HIPBLAS_STATUS_SUCCESS)
main_handle = NULL;
Expand All @@ -109,7 +109,7 @@ void starpu_hipblas_shutdown(void)
{
#ifdef STARPU_USE_HIP
#ifdef STARPU_USE_HIPBLAS
starpu_execute_on_each_worker(shutdown_hipblas_func, NULL, STARPU_HIP);
starpu_execute_on_each_worker_ex(shutdown_hipblas_func, NULL, STARPU_HIP, "shutdown_hipblas");

if (main_handle)
hipblasDestroy(main_handle);
Expand Down

0 comments on commit 870b500

Please sign in to comment.