MATLAB PARALLEL COMPUTING TOOLBOX - S Guía de usuario Pagina 622

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 656
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 621
11 Functions — Alphabetical List
11-278
setConstantMemory
Set some constant memory on GPU
Syntax
setConstantMemory(kern,sym,val)
setConstantMemory(kern,sym1,val1,sym2,val2,...)
Description
setConstantMemory(kern,sym,val) sets the constant memory in the CUDA kernel
kern with symbol name sym to contain the data in val. val can be any numeric array,
including a gpuArray. The command errors if the named symbol does not exist or if it is
not big enough to contain the specified data. Partially filling a constant is allowed.
There is no automatic data-type conversion for constant memory, so it is important to
make sure that the supplied data is of the correct type for the constant memory symbol
being filled.
setConstantMemory(kern,sym1,val1,sym2,val2,...) sets multiple constant
symbols.
Examples
If KERN represents a CUDA kernel whose CU file contains the following includes and
constant definitions:
#include “tmwtypes.h”
__constant__ int32_t N1;
__constant__ int N2; // Assume 'int' is 32 bits
__constant__ double CONST_DATA[256];
you can fill these with MATLAB data as follows:
KERN = parallel.gpu.CUDAKernel(ptxFile,cudaFile);
Vista de pagina 621
1 2 ... 617 618 619 620 621 622 623 624 625 626 627 ... 655 656

Comentarios a estos manuales

Sin comentarios