bugfix: do not dereference ctx during create_ctx if we did run out (#83)
This commit is contained in:
committed by
GitHub
parent
f6ef19f5a9
commit
9befbe8293
@@ -289,7 +289,9 @@ __device__ int rocshmem_wg_ctx_create(long option, rocshmem_ctx_t *ctx) {
|
||||
if (get_flat_block_id() == 0) {
|
||||
ctx->team_opaque = reinterpret_cast<TeamInfo *>(ROCSHMEM_CTX_DEFAULT.team_opaque);
|
||||
result = device_backend_proxy->create_ctx(option, ctx);
|
||||
reinterpret_cast<Context *>(ctx->ctx_opaque)->setFence(option);
|
||||
if(result) {
|
||||
reinterpret_cast<Context *>(ctx->ctx_opaque)->setFence(option);
|
||||
}
|
||||
}
|
||||
__syncthreads();
|
||||
return result == true ? 0 : -1;
|
||||
@@ -308,7 +310,9 @@ __device__ int rocshmem_wg_team_create_ctx(rocshmem_team_t team, long options,
|
||||
TeamInfo *info_wrt_world = team_obj->tinfo_wrt_world;
|
||||
ctx->team_opaque = info_wrt_world;
|
||||
result = device_backend_proxy->create_ctx(options, ctx);
|
||||
reinterpret_cast<Context *>(ctx->ctx_opaque)->setFence(options);
|
||||
if(result) {
|
||||
reinterpret_cast<Context *>(ctx->ctx_opaque)->setFence(options);
|
||||
}
|
||||
}
|
||||
__syncthreads();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user