.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "MPIX_QUERY_CUDA_SUPPORT" "3" "Apr 11, 2024" "" "Open MPI" .sp \fBMPIX_Query_cuda_support\fP \- Returns 1 if there is CUDA\-aware support and 0 if there is not. .SH SYNTAX .SS C Syntax .INDENT 0.0 .INDENT 3.5 .sp .EX #include #include int MPIX_Query_cuda_support(void) .EE .UNINDENT .UNINDENT .SS Fortran Syntax .sp There is no Fortran binding for this function. .SS C++ Syntax .sp There is no C++ binding for this function. .SH DESCRIPTION .sp This function is part of an \fI\%Open MPI extension\fP; it is not part of standard MPI. .sp This routine returns 1 if both the MPI library was built with the NVIDIA CUDA library and the runtime supports CUDA buffers. Otherwise, it returns 0. This routine must be called after MPI is initialized, e.g., by a call to \fI\%MPI_Init(3)\fP or \fI\%MPI_Init_thread(3)\fP\&. .sp Including the Open MPI\-specific file \fB\fP will define the C preprocessor macro \fBOMPI_HAVE_MPI_EXT\fP to \fB1\fP\&. Otherwise, it will be undefined. This macro can be used by applications as a sentinel to know whether \fB\fP has been included or not. .sp The Open MPI CUDA extension is built by default (regardless of whether or not Open MPI was built with CUDA support), but \fIcould\fP have been disabled by an administrative action. It is therefore safest for applications to check that the preprocessor macro \fBOMPI_HAVE_MPI_EXT_CUDA\fP is defined and is set to 1 to know whether the \fBMPIX_Query_CUDA_support()\fP function is available. Checking for this macro also protects the use of this function when compiling the application with older versions of Open MPI or other MPI implementations that do not have this function. .SS EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .EX #include #include #include /* Needed for CUDA\-aware check */ int main(int argc, char *argv[]) { MPI_Init(&argc, &argv); bool happy = false; #if defined(OMPI_HAVE_MPI_EXT_CUDA) && OMPI_HAVE_MPI_EXT_CUDA happy = (bool) MPIX_Query_cuda_support(); #endif if (happy) { printf(\(dqThis Open MPI installation has CUDA\-aware support.\en\(dq); } else { printf(\(dqThis Open MPI installation does not have CUDA\-aware support.\en\(dq); } MPI_Finalize(); return 0; } .EE .UNINDENT .UNINDENT .sp \fBSEE ALSO:\fP .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 \fI\%MPIX_Query_rocm_support\fP .UNINDENT .UNINDENT .UNINDENT .SH COPYRIGHT 2003-2024, The Open MPI Community .\" Generated by docutils manpage writer. .