-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support gdr malloc&free #8
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ flagcxResult_t mluAdaptorDeviceMemcpy(void *dst, void *src, size_t size, flagcxM | |
if (stream == NULL) { | ||
DEVCHECK(cnrtMemcpy(dst, src, size, memcpy_type_map[type])); | ||
} else { | ||
DEVCHECK(cnrtMemcpyAsync_V3(dst, src, size, stream->base, memcpy_type_map[type])); | ||
DEVCHECK(cnrtMemcpyAsync_V2(dst, src, size, stream->base, memcpy_type_map[type])); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里后续会升级导致兼容问题么? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个貌似没有更好的办法,只能锚定cambricon的某个版本,后续更新cambricon docker后再升级接口。 |
||
} | ||
return flagcxSuccess; | ||
} | ||
|
@@ -73,12 +73,18 @@ flagcxResult_t mluAdaptorGetVendor(char *vendor) { | |
} | ||
|
||
flagcxResult_t mluAdaptorGdrMemAlloc(void **ptr, size_t size, void *memHandle) { | ||
// TODO: Implement GDR memory allocation | ||
if (ptr == NULL) { | ||
return flagcxInvalidArgument; | ||
} | ||
DEVCHECK(cnrtMalloc(ptr, size)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里直接用cnrtMalloc就可以了?不需要再进行额外操作? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 参照cuda代码,添加了防呆。mlu申请gdr内存时暂时没有设置属性的函数,因此暂不需要其他其他操作。 |
||
return flagcxSuccess; | ||
} | ||
|
||
flagcxResult_t mluAdaptorGdrMemFree(void *ptr, void *memHandle) { | ||
// TODO: Implement GDR memory free | ||
if (ptr == NULL) { | ||
return flagcxSuccess; | ||
} | ||
DEVCHECK(cnrtFree(ptr)); | ||
return flagcxSuccess; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NEUWARE_HOME是系统默认环境变量?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mlu的docker中都默认设置了这个环境变量,不需要用户自己设置。