sanitizerRtMallocCached

Function

Calls the aclrtMallocCached 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 detection tool. In any scenario, the allocated memory supports cache. The actual memory allocation behavior and parameter meanings are the same as those of aclrtMallocCached.

For details about aclrtMallocCached, see .

Prototype

aclError sanitizerRtMallocCached(void **devPtr, size_t size, aclrtMemMallocPolicy policy, char const *filename, int lineno);

Parameters

Table 1 Parameters

Parameter

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.