Function: mem_flush

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Description

Flushes cache data to the DDR and invalidates the cache.

In this version, you do not need to care about the cache coherence between the CPU and NPU and therefore this API is unused in this version.

Prototype

  • C Prototype
    1
    aclError aclrtMemFlush(void *devPtr, size_t size)
    
  • Python Function
    1
    ret = acl.rt.mem_flush(dev_ptr, size)
    

Parameters

Parameter

Description

dev_ptr

Int, start address of the DDR memory to be flushed.

size

Int, size of the DDR memory to be flushed, in bytes. The size cannot be 0.

Return Values

Return Value

Description

ret

Int, error code. 0 on success; else, failure.