aclrtReserveMemAddressNoUCMemory
Note: The function of specifying a start address is for trial use and may be changed in later versions. It is not available in commercial products.
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
☓ |
√ |
|
☓ |
|
☓ |
|
☓ |
|
☓ |
Function
Reserves virtual memory.
The usage of this API is the same as that of aclrtReserveMemAddress. The difference is that the environment variable AUTO_USE_UC_MEMORY determines whether to allow operators that do not pass through the L2 cache to move data. The virtual memory reserved by this API cannot be used as the input or output memory of such operators. Otherwise, operator accuracy problems or exceptions may occur. For details about the environment variable AUTO_USE_UC_MEMORY, see Environment Variables.
In addition, the start address of the virtual memory in this API cannot be automatically allocated by the system and must be specified by the user. It is recommended that the address range be from 40 TB to 224 TB.
Prototype
1 | aclError aclrtReserveMemAddressNoUCMemory(void **virPtr, size_t size, size_t alignment, void *expectPtr, uint64_t flags) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
virPtr |
Output |
Pointer to "the pointer to the allocated virtual memory address". |
size |
Input |
Virtual memory size, in bytes. The size cannot be 0. It must be an integer multiple of 1 GB. The minimum size is 1 GB. |
alignment |
Input |
Alignment value of the virtual address. This parameter is reserved and can only be set to 0. |
expectPtr |
Input |
Start address of the virtual memory to be returned. Specify a start address. It is recommended that the address range be from 40 TB to 224 TB. Ensure that the specified address is not occupied. Otherwise, the virtual memory cannot be reserved and an error will be returned. |
flags |
Input |
Huge page/Common page flag. This parameter is reserved. The recommended value is 0. |
Returns
0 on success; else, failure. For details, see aclError.