17.2.465. MPIX_Query_cuda_support

MPIX_Query_cuda_support - Returns 1 if there is CUDA aware support and 0 if there is not.

17.2.465.1. SYNTAX

17.2.465.1.1. C Syntax

#include <mpi.h>
#include <mpi-ext.h>

int MPIX_Query_cuda_support(void)

17.2.465.1.2. Fortran Syntax

There is no Fortran binding for this function.

17.2.465.1.3. C++ Syntax

There is no C++ binding for this function.

17.2.465.2. DESCRIPTION

This routine return 1 if MPI library is build with CUDA and runtime supports CUDA buffers. This routine must be called after MPI is initialized by a call to MPI_Init or MPI_Init_thread.

17.2.465.2.1. Examples

#include <stdio.h>
#include "mpi.h"

#include "mpi-ext.h" /* Needed for CUDA-aware check */

int main(int argc, char *argv[])

    MPI_Init(&argc, &argv);

    if (MPIX_Query_cuda_support()) {
        printf("This MPI library has CUDA-aware support.);
    } else {
        printf("This MPI library does not have CUDA-aware support.);

    return 0;