mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-27 05:44:15 +08:00
libgomp/plugin/plugin-gcn.c: async-queue init - fix function-return type and fail fatally
libgomp/ChangeLog: * plugin/plugin-gcn.c (GOMP_OFFLOAD_openacc_async_construct): In case of an error, call GOMP_PLUGIN_fatal not ..._error; use NULL not false in return.
This commit is contained in:
parent
944471eaee
commit
884637b636
@ -4388,7 +4388,9 @@ GOMP_OFFLOAD_openacc_async_exec (void (*fn_ptr) (void *),
|
|||||||
gcn_exec (kernel, devaddrs, dims, targ_mem_desc, true, aq);
|
gcn_exec (kernel, devaddrs, dims, targ_mem_desc, true, aq);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a new asynchronous thread and queue for running future kernels. */
|
/* Create a new asynchronous thread and queue for running future kernels;
|
||||||
|
issues a fatal error if the queue cannot be created as all callers expect
|
||||||
|
that the queue exists. */
|
||||||
|
|
||||||
struct goacc_asyncqueue *
|
struct goacc_asyncqueue *
|
||||||
GOMP_OFFLOAD_openacc_async_construct (int device)
|
GOMP_OFFLOAD_openacc_async_construct (int device)
|
||||||
@ -4416,18 +4418,18 @@ GOMP_OFFLOAD_openacc_async_construct (int device)
|
|||||||
|
|
||||||
if (pthread_mutex_init (&aq->mutex, NULL))
|
if (pthread_mutex_init (&aq->mutex, NULL))
|
||||||
{
|
{
|
||||||
GOMP_PLUGIN_error ("Failed to initialize a GCN agent queue mutex");
|
GOMP_PLUGIN_fatal ("Failed to initialize a GCN agent queue mutex");
|
||||||
return false;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (pthread_cond_init (&aq->queue_cond_in, NULL))
|
if (pthread_cond_init (&aq->queue_cond_in, NULL))
|
||||||
{
|
{
|
||||||
GOMP_PLUGIN_error ("Failed to initialize a GCN agent queue cond");
|
GOMP_PLUGIN_fatal ("Failed to initialize a GCN agent queue cond");
|
||||||
return false;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (pthread_cond_init (&aq->queue_cond_out, NULL))
|
if (pthread_cond_init (&aq->queue_cond_out, NULL))
|
||||||
{
|
{
|
||||||
GOMP_PLUGIN_error ("Failed to initialize a GCN agent queue cond");
|
GOMP_PLUGIN_fatal ("Failed to initialize a GCN agent queue cond");
|
||||||
return false;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
hsa_status_t status = hsa_fns.hsa_queue_create_fn (agent->id,
|
hsa_status_t status = hsa_fns.hsa_queue_create_fn (agent->id,
|
||||||
|
Loading…
Reference in New Issue
Block a user