sanitizerRtMalloc
Description
Calls the aclrtMalloc interface to allocate size bytes linear memory on the device, returns the pointer to the allocated memory by using *devPtr, and reports the memory allocation information to the check tool. The actual memory allocation behavior and parameter meanings are the same as those of aclrtMalloc.
For details about aclrtMalloc, see .
Prototype
aclError sanitizerRtMalloc(void **devPtr, size_t size, aclrtMemMallocPolicy policy, char const *filename, int lineno);
Parameters
Option |
Input/Output |
Description |
|---|---|---|
devPtr |
Output |
Pointer to the pointer to the allocated device memory. |
size |
Input |
Allocated memory size, in bytes. The size cannot be 0. |
policy |
Input |
Memory allocation policy. |
filename |
Input |
Name of the file where memory allocation is called. |
lineno |
Input |
Number of the line where memory allocation is called. |
Return
0 on success; else, failure.
Example
For details, see Step 4.
Parent topic: sanitizer APIs