Call function from function table. Discovered during static build.
This commit was SVN r29755.
Этот коммит содержится в:
родитель
90ebdd920f
Коммит
aa98b0333b
@ -94,6 +94,7 @@ struct cudaFunctionTable {
|
|||||||
#if OPAL_CUDA_SUPPORT_60
|
#if OPAL_CUDA_SUPPORT_60
|
||||||
int (*cuPointerSetAttribute)(const void *, CUpointer_attribute, CUdeviceptr);
|
int (*cuPointerSetAttribute)(const void *, CUpointer_attribute, CUdeviceptr);
|
||||||
#endif /* OPAL_CUDA_SUPPORT_60 */
|
#endif /* OPAL_CUDA_SUPPORT_60 */
|
||||||
|
int (*cuCtxSetCurrent)(CUcontext);
|
||||||
} cudaFunctionTable;
|
} cudaFunctionTable;
|
||||||
typedef struct cudaFunctionTable cudaFunctionTable_t;
|
typedef struct cudaFunctionTable cudaFunctionTable_t;
|
||||||
cudaFunctionTable_t cuFunc;
|
cudaFunctionTable_t cuFunc;
|
||||||
@ -454,6 +455,7 @@ int mca_common_cuda_stage_one_init(void)
|
|||||||
#if OPAL_CUDA_SUPPORT_60
|
#if OPAL_CUDA_SUPPORT_60
|
||||||
OMPI_CUDA_DLSYM(libcuda_handle, cuPointerSetAttribute);
|
OMPI_CUDA_DLSYM(libcuda_handle, cuPointerSetAttribute);
|
||||||
#endif /* OPAL_CUDA_SUPPORT_60 */
|
#endif /* OPAL_CUDA_SUPPORT_60 */
|
||||||
|
OMPI_CUDA_DLSYM(libcuda_handle, cuCtxSetCurrent);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1537,7 +1539,7 @@ static int mca_common_cuda_is_gpu_buffer(const void *pUserBuf)
|
|||||||
"res=%d, ptr=%p aborting...", res, pUserBuf);
|
"res=%d, ptr=%p aborting...", res, pUserBuf);
|
||||||
ompi_rte_abort(1, NULL);
|
ompi_rte_abort(1, NULL);
|
||||||
} else {
|
} else {
|
||||||
res = cuCtxSetCurrent(ctx);
|
res = cuFunc.cuCtxSetCurrent(ctx);
|
||||||
if (res != CUDA_SUCCESS) {
|
if (res != CUDA_SUCCESS) {
|
||||||
opal_output(0, "CUDA: error calling cuCtxSetCurrent: "
|
opal_output(0, "CUDA: error calling cuCtxSetCurrent: "
|
||||||
"res=%d, ptr=%p aborting...", res, pUserBuf);
|
"res=%d, ptr=%p aborting...", res, pUserBuf);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user