CopyPastor

Detecting plagiarism made easy.

Score: 2; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Reposted on 2025-01-28
by Smilediver

Original Post

Original - Posted on 2025-01-28
by Smilediver



            
Present in both answers; Present only in the new answer; Present only in the old answer;

To get how much GPU memory your app is using on macOS or iOS you can use this method:
```cpp auto vm_info = task_vm_info_data_t(); auto count = TASK_VM_INFO_COUNT; auto kerr = task_info(mach_task_self(), TASK_VM_INFO, task_info_t(&vm_info), &count);
if (kerr == KERN_SUCCESS) { // This seems to match GPU memory usage well. On macOS it seems the memory is released // more lazily, so the value may be higher than actual usage. auto memoryGpu = count >= TASK_VM_INFO_REV3_COUNT ? int64_t(vm_info.ledger_tag_graphics_footprint + vm_info.ledger_tag_graphics_footprint_compressed) : 0; } ```
To get how much GPU memory your app is using on macOS or iOS you can use this method:
```cpp auto vm_info = task_vm_info_data_t(); auto count = TASK_VM_INFO_COUNT; auto kerr = task_info(mach_task_self(), TASK_VM_INFO, task_info_t(&vm_info), &count);
if (kerr == KERN_SUCCESS) { // This seems to match GPU memory usage well. On macOS it seems the memory is released // more lazily, so the value may be higher than actual usage. auto memoryGpu = count >= TASK_VM_INFO_REV3_COUNT ? int64_t(vm_info.ledger_tag_graphics_footprint + vm_info.ledger_tag_graphics_footprint_compressed) : 0; } ```

        
Present in both answers; Present only in the new answer; Present only in the old answer;