简体   繁体   中英

CUDA Virtual memory on Windows - what is the handle type?

From the CUDA driver API documentation:

enum CUmemAllocationHandleType

 Flags for specifying particular handle types Values CU_MEM_HANDLE_TYPE_NONE = 0x0 Does not allow any export mechanism. CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR = 0x1 Allows a file descriptor to be used for exporting. Permitted only on POSIX systems. (int) CU_MEM_HANDLE_TYPE_WIN32 = 0x2 Allows a Win32 NT handle to be used for exporting. (HANDLE) CU_MEM_HANDLE_TYPE_WIN32_KMT = 0x4 Allows a Win32 KMT handle to be used for exporting. (D3DKMT_HANDLE) CU_MEM_HANDLE_TYPE_MAX = 0x7FFFFFFF

What is the HANDLE type? ie what is its definition? And - can I define it manually, or must I include some Windows header for it?

Well, an answer to this question:

What is a Windows Handle?

suggests that:

typedef void* HANDLE;

may be a valid thing to do. I'm not sure that's the case, but will give it a try.

HANDLE is defined in winnt.h .

It's a pretty sizable file though, ~22000 lines. Minimal but hardly innocuous. You can reduce the API surface somewhat with #defines:

#define WINAPI_FAMILY WINAPI_FAMILY_SERVER

A precompiled header is your friend, if the compiler allows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM