Repository navigation
issue/20:寒武纪平台针对任意维度的swiglu算子重构 - #57
Closed
xgqdut2016 wants to merge 1 commit into
Closed
xgqdut2016 wants to merge 1 commit into
xgqdut2016 wants to merge 1 commit into
Conversation
xgqdut2016
commented
Feb 18, 2025
Collaborator
PanZezhong1725
requested changes
Feb 18, 2025
| int device_id; | ||
| infiniDtype_t dtype; | ||
| int ndim; | ||
| int *shape; |
Collaborator
There was a problem hiding this comment.
请按照统一规则,形状大小使用 size_t,步长使用ptrdiff_t。如硬件有限制,可以使用硬件认可的类型
| #include "../../utils.h" | ||
| #include "swiglu_bang_api.h" | ||
|
|
||
| const int SRC_MAX_SIZE = 1024 * 32;//至少大于等于128字节 |
Collaborator
There was a problem hiding this comment.
这种是不是应该放在common代码里
| #define __INFINIOP__COMMON_CPU_H__ | ||
|
|
||
| #include <cmath> | ||
| #include <cstddef> |
|
|
||
|
|
||
| template <typename T> | ||
| __mlu_global__ void swigluKernel(T const *a_, T const *b_, T *c_, int *shape, int64_t *mlu_strides_a, int64_t *mlu_strides_b, int64_t *mlu_strides_c, int ndim){ |
Collaborator
There was a problem hiding this comment.
这里可以使用size_t和ptrdiff_t吗
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.