-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[CINN] remove cinn_pod_value_t(part1) #70503
base: develop
Are you sure you want to change the base?
[CINN] remove cinn_pod_value_t(part1) #70503
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
… try_to_call_cuda_kernel_launch
int64_t cinn_get_value_in_cuda_kernel_args(void *v_args, int idx) { | ||
cinn_pod_value_t *args = static_cast<cinn_pod_value_t *>(v_args); | ||
return args[idx].operator int64_t(); | ||
KernelArgsNode *args = static_cast<KernelArgsNode *>(v_args); | ||
return args[idx].symbol_val; | ||
} |
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.
这里后续是否可以加上type的检查以便定位arg不一致问题
func_args_[i] = KernelArgsNode{ | ||
kernel_tensor_args[i]->data(), -1, KernelArgsType::void_p_args_type}; |
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.
优化一下构造函数写法?
unk_args_type = -1, //! Unknown type | ||
void_p_args_type = 0, //! void* | ||
int64_args_type = 1, //! int64_t |
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.
void* data_ptr{nullptr}; | ||
int64_t symbol_val{-1}; |
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.
symbol_val的含义是什么,感觉需要一点注释说明?
if (args[idx].type_code() == ::cinn_type_code<cinn_buffer_t *>()) { | ||
kernel_args.emplace_back( | ||
&((cinn_buffer_t *)(args[idx]))->memory); // NOLINT | ||
// kernel_args.emplace_back( &(args[idx])); // NOLINT |
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.
无用注释?
if (args[idx].args_type == KernelArgsType::void_p_args_type) { | ||
kernel_args.emplace_back(&(args[idx].data_ptr)); // NOLINT | ||
} else if (args[idx].args_type == KernelArgsType::int64_args_type) { | ||
kernel_args.emplace_back(&(args[idx].symbol_val)); // NOLINT |
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.
这里对int取地址会不会有风险?
PR Category
PR Types
Description
为了清理nvrtc编译的头文件个数,需要清理下cinn pod value,这个pr是cinn jit kernel中,不再使用 cinn pod value
本来计划直接使用 void* 进行传递,但是会产生cuda 700 error,引入了一个新的数据结构