WOLFRAM

CUDAMemoryLoad[list]

registers list into the CUDALink memory manager.

CUDAMemoryLoad[img]

registers img into the CUDALink memory manager.

Details and Options

  • The CUDALink application must be loaded using Needs["CUDALink`"].
  • Possible types for CUDAMemoryLoad are:
  • IntegerRealComplex
    "Byte""Bit16""Integer"
    "Byte[2]""Bit16[2]""Integer32[2]"
    "Byte[3]""Bit16[3]""Integer32[3]"
    "Byte[4]""Bit16[4]""Integer32[4]"
    "UnsignedByte""UnsignedBit16""UnsignedInteger"
    "UnsignedByte[2]""UnsignedBit16[2]""UnsignedInteger[2]"
    "UnsignedByte[3]""UnsignedBit16[3]""UnsignedInteger[3]"
    "UnsignedByte[4]""UnsignedBit16[4]""UnsignedInteger[4]"
    "Double""Float""Integer64"
    "Double[2]""Float[2]""Integer64[2]"
    "Double[3]""Float[3]""Integer64[3]"
    "Double[4]""Float[4]""Integer64[4]"
  • The following options can be given:
  • "Device"$CUDADeviceCUDA device used in computation
    "TargetPrecision" Automaticprecision used in computation

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

First, load the CUDALink application:

This loads memory:

Out[2]=2

Information about memory can be retrieved using CUDAMemoryInformation:

Out[3]=3

Memory added must be freed with CUDAMemoryUnload:

Scope  (4)Survey of the scope of standard use cases

Adding memory as Real or Complex gets the type based on whether the device supports double precision or not:

Out[1]=1

In this case, the CUDA device has double-precision support:

Out[2]=2

The behavior can be forced to change by setting the "TargetPrecision":

Out[3]=3

Memory added must be freed with CUDAMemoryUnload:

Images can be added with type "UnsignedByte":

Out[1]=1

Getting the memory returns an image with the same properties as the original. Memory is retrieved using CUDAMemoryGet:

Out[2]=2

The "TypeInformation" contains the image information:

Out[3]=3

Memory added must be freed with CUDAMemoryUnload:

Images can be added with specified type:

Out[1]=1

Getting the memory returns an image:

Out[2]=2

When adding graphics objects, the object is rasterized:

Out[1]=1

When getting the memory, an image is returned:

Out[2]=2

Memory added must be freed with CUDAMemoryUnload:

Options  (1)Common values & functionality for each option

"TargetPrecision"  (1)

Adding memory as Real or Complex gets the type based on whether the device supports double precision or not:

Out[1]=1

This can be overridden by setting the "TargetPrecision" option to either "Single" or "Double". In this case, the machine has double-precision hardware, but a "Float" is used because the "TargetPrecision" is single:

Out[2]=2

If type is always single precision, then setting the type as "Float" or "ComplexFloat" may be more readable:

Out[3]=3

Applications  (2)Sample problems that can be solved with this function

This adds two to an input list:

Out[1]=1
Out[2]=2
Out[3]=3
Out[4]=4

Internally, running a CUDAFunction will load and (if the input is not CUDAMemory) will unload the memory. To demonstrate, this color negates an input image:

This loads the function using CUDAFunctionLoad:

Out[2]=2

This defines input parameters:

Out[3]=3
Out[3]=3

This runs the CUDAFunction:

Out[4]=4
Wolfram Research (2010), CUDAMemoryLoad, Wolfram Language function, https://reference.wolfram.com/language/CUDALink/ref/CUDAMemoryLoad.html.
Wolfram Research (2010), CUDAMemoryLoad, Wolfram Language function, https://reference.wolfram.com/language/CUDALink/ref/CUDAMemoryLoad.html.

Text

Wolfram Research (2010), CUDAMemoryLoad, Wolfram Language function, https://reference.wolfram.com/language/CUDALink/ref/CUDAMemoryLoad.html.

Wolfram Research (2010), CUDAMemoryLoad, Wolfram Language function, https://reference.wolfram.com/language/CUDALink/ref/CUDAMemoryLoad.html.

CMS

Wolfram Language. 2010. "CUDAMemoryLoad." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/CUDALink/ref/CUDAMemoryLoad.html.

Wolfram Language. 2010. "CUDAMemoryLoad." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/CUDALink/ref/CUDAMemoryLoad.html.

APA

Wolfram Language. (2010). CUDAMemoryLoad. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/CUDALink/ref/CUDAMemoryLoad.html

Wolfram Language. (2010). CUDAMemoryLoad. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/CUDALink/ref/CUDAMemoryLoad.html

BibTeX

@misc{reference.wolfram_2024_cudamemoryload, author="Wolfram Research", title="{CUDAMemoryLoad}", year="2010", howpublished="\url{https://reference.wolfram.com/language/CUDALink/ref/CUDAMemoryLoad.html}", note=[Accessed: 10-January-2025 ]}

@misc{reference.wolfram_2024_cudamemoryload, author="Wolfram Research", title="{CUDAMemoryLoad}", year="2010", howpublished="\url{https://reference.wolfram.com/language/CUDALink/ref/CUDAMemoryLoad.html}", note=[Accessed: 10-January-2025 ]}

BibLaTeX

@online{reference.wolfram_2024_cudamemoryload, organization={Wolfram Research}, title={CUDAMemoryLoad}, year={2010}, url={https://reference.wolfram.com/language/CUDALink/ref/CUDAMemoryLoad.html}, note=[Accessed: 10-January-2025 ]}

@online{reference.wolfram_2024_cudamemoryload, organization={Wolfram Research}, title={CUDAMemoryLoad}, year={2010}, url={https://reference.wolfram.com/language/CUDALink/ref/CUDAMemoryLoad.html}, note=[Accessed: 10-January-2025 ]}