Skip to content

Commit 50e3a2b

Browse files
committed
clean example code
1 parent 9780fa7 commit 50e3a2b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

advanced_source/cpp_custom_ops_sycl.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,16 @@ in a separate ``TORCH_LIBRARY_IMPL`` block:
211211
// 4. Windows Linker
212212
// ==========================================================
213213
extern "C" {
214-
// 必须导出该符号
215214
#ifdef _WIN32
216215
__declspec(dllexport)
217216
#endif
218217
PyObject* PyInit__C(void) {
219218
static struct PyModuleDef moduledef = {
220219
PyModuleDef_HEAD_INIT,
221-
"_C", // 模块名,必须与 setup.py 一致
222-
"XPU Extension Shim", // 文档
223-
-1, // 模块状态大小
224-
NULL // 方法列表 (我们不通过 Python C-API 暴露方法,全靠 torch ops)
220+
"_C",
221+
"XPU Extension Shim",
222+
-1,
223+
NULL
225224
};
226225
return PyModule_Create(&moduledef);
227226
}

0 commit comments

Comments
 (0)