Skip to content
Logo LogoArrayFire documentation
⌘ K
Logo LogoArrayFire documentation

The Basics

  • Overview
  • Tutorial
  • ArrayFire Installer
  • Getting Started

User Guide

  • Configuring ArrayFire Environment
  • Introduction to Vectorization
  • ArrayFire JIT Code Generation
  • Array and Matrix Manipulation
  • Indexing
  • Timing ArrayFire
  • Debugging ArrayFire Issues

Reference

  • Functions
  • Examples
  • Index
  • Release Notes
  • Get Help
  • License
ArrayFire documentation
/
print_mem_info

print_mem_info

arrayfire_wrapper.lib.print_mem_info(msg: str = 'Memory Info', device_id: None | int = None, /) → None

Prints the memory used for the specified device.

Parameters

title: optional. Default: “Memory Info”
  • Title to display before printing the memory info.

device_id: optional. Default: None
  • Specifies the device for which the memory info should be displayed.

  • If None, uses the current device.

Examples

>>> a = af.randu(5,5)
>>> af.print_mem_info()
Memory Info
---------------------------------------------------------
|     POINTER      |    SIZE    |  AF LOCK  | USER LOCK |
---------------------------------------------------------
|     0x706400000  |       1 KB |       Yes |        No |
---------------------------------------------------------
>>> b = af.randu(5,5)
>>> af.print_mem_info()
Memory Info
---------------------------------------------------------
|     POINTER      |    SIZE    |  AF LOCK  | USER LOCK |
---------------------------------------------------------
|     0x706400400  |       1 KB |       Yes |        No |
|     0x706400000  |       1 KB |       Yes |        No |
---------------------------------------------------------
>>> a = af.randu(1000,1000)
>>> af.print_mem_info()
Memory Info
---------------------------------------------------------
|     POINTER      |    SIZE    |  AF LOCK  | USER LOCK |
---------------------------------------------------------
|     0x706500000  |   3.815 MB |       Yes |        No |
|     0x706400400  |       1 KB |       Yes |        No |
|     0x706400000  |       1 KB |        No |        No |
---------------------------------------------------------

source: https://arrayfire.org/docs/group__device__func__mem.htm#ga7c928031579de47fe21594fd745e9188

On this page

  • print_mem_info()

© 2025, ArrayFire Built with Sphinx 8.2.3