MATLAB PARALLEL COMPUTING TOOLBOX - S Guide de l'utilisateur Page 545

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 656
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 544
mxInitGPU (C)
11-201
mxInitGPU (C)
Initialize MATLAB GPU library on currently selected device
C Syntax
#include "gpu/mxGPUArray.h"
int mxInitGPU()
Returns
int type with one of the following values:
MX_GPU_SUCCESS if the MATLAB GPU library is successfully initialized.
MX_GPU_FAILURE if not successfully initialized.
Description
Before using any CUDA code in your MEX file, initialize the MATLAB GPU library if
you intend to use any mxGPUArray functionality in MEX or any GPU calls in MATLAB.
There are many ways to initialize the MATLAB GPU API, including:
Call mxInitGPU at the beginning of your MEX file before any CUDA code.
Call gpuDevice(deviceIndex) in MATLAB before running any MEX code.
Create a gpuArray in MATLAB before running any MEX code.
You should call mxInitGPU at the beginning of your MEX file, unless you have an
alternate way of guaranteeing that the MATLAB GPU library is initialized at the start of
your MEX file.
If the library is initialized, this function returns without doing any work. If the library is
not initialized, the function initializes the default device. Note: At present, a MATLAB
MEX file can work with only one GPU device at a time.
See Also
gpuArray | gpuDevice
Vue de la page 544
1 2 ... 540 541 542 543 544 545 546 547 548 549 550 ... 655 656

Commentaires sur ces manuels

Pas de commentaire