coder.specifyAsGPU
Specify that value is a GPU input to an entry-point function for GPU code generation
Since R2023b
Description
coder.specifyAsGPU(
is primarily used to specify that value
,className
)value
is a GPU input with an
underlying class of className
for code generation. To learn more about
input-type specification using arguments
blocks, see Use Function Argument Validation to Specify Entry-Point Input Types.
The coder.specifyAsGPU
validator has three distinct behaviors:
In MATLAB® execution,
coder.specifyAsGPU
throws an error ifvalue
is a GPU array with an underlying type that does not matchclassName
. Alternatively, ifvalue
is not a GPU array,coder.specifyAsGPU
throws an error if the type ofvalue
does not matchclassName
.During input-type specification using function argument validation,
coder.specifyAsGPU
specifies thatvalue
is a GPU array with an underlying type ofclassName
.During code generation,
coder.specifyAsGPU
throws an error if the type ofvalue
does not matchclassName
.
Examples
Input Arguments
Extended Capabilities
Version History
Introduced in R2023b