okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-mac-rel (Mac Metal support) into f-144-rel6a74320ca

main
571 B12 linesraw
1// metal/include/metal_compat/linux/mman.h - the Linux mmap flags src/core/pinned.cu asks for, on macOS.  There are no
2// hugetlb pages and no transparent huge pages: MAP_HUGETLB is spelled as MAP_FIXED at address 0, which macOS refuses
3// (the 4 GiB __PAGEZERO), and MADV_HUGEPAGE as an advice madvise refuses, so pinned.cu takes its 4 KB-page fallback
4// and reports it, exactly as on a Linux box without a hugetlb pool.
5#pragma once
6#include <sys/mman.h>
7#ifndef MAP_HUGETLB
8#define MAP_HUGETLB MAP_FIXED
9#endif
10#ifndef MADV_HUGEPAGE
11#define MADV_HUGEPAGE (-1)
12#endif