[英]CUDA Virtual memory on Windows - what is the handle type?
From the CUDA driver API documentation:从 CUDA 驱动程序 API 文档:
enum CUmemAllocationHandleType
枚举 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?什么是
HANDLE
类型? ie what is its definition?即它的定义是什么? And - can I define it manually, or must I include some Windows header for it?
并且 - 我可以手动定义它,还是必须为其包含一些 Windows 标头?
Well, an answer to this question:好吧,这个问题的答案:
What is a Windows Handle? 什么是 Windows 句柄?
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
. HANDLE
在winnt.h
中定义。
It's a pretty sizable file though, ~22000 lines.这是一个相当大的文件,大约 22000 行。 Minimal but hardly innocuous.
最小但几乎无害。 You can reduce the API surface somewhat with #defines:
您可以使用#defines 稍微减少 API 表面:
#define WINAPI_FAMILY WINAPI_FAMILY_SERVER
A precompiled header is your friend, if the compiler allows.如果编译器允许,预编译的头文件是你的朋友。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.