Skip to content
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

Assessment of the difficulty in porting CPU architecture for the ITK #4207

Closed
wangyuliu opened this issue Sep 6, 2023 · 8 comments
Closed

Comments

@wangyuliu
Copy link

Hello everyone! I am working on implementing a tool to assess the complexity of CPU architecture porting. It primarily focuses on RISC-V architecture porting. As part of my dataset, I have collected the ITK project. I would like to gather community opinions to support my assessment. I appreciate your help and response! Based on scanning tools, the porting complexity is determined to be moderate, with a moderate amount of code related to the CPU architecture in the project,such as Assembly code,Intrinsic and builtin function. It would require a professional team, but not a large-scale one, to handle this task (referring to the overall workload from adapting the project to a specific architecture to achieving full functionality on that architecture). Is this assessment accurate? I look forward to your help and response.
各位好!我在实现一个关于CPU架构的移植工作复杂度评估的工具,主要面向riscv架构移植,我收集ITK项目作为我的数据集之一,需要收集社区的意见作为支撑,期待您的帮助和回答!通过扫描工具得出其移植复杂度为中等,工程中与CPU架构相关的代码量也为中等,例如汇编代码、内建函数等,需要较专业团队但不需要大规模的团队进行,(这里指的是从工程尚未适配某架构到实现某架构的较完整功能的总体工作量)这样的判断是否准确?期待您的帮助与回答

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

Thank you for contributing an issue! 🙏

Welcome to the ITK community! 🤗👋☀️

We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜
Also, please check existing open issues and consider discussion on the ITK Discourse. 📖

This is an automatic message. Allow for time for the ITK community to be able to read the issue and comment on it.

@dzenanz
Copy link
Member

dzenanz commented Sep 6, 2023

I don't think it would take a team of people. ITK is meant to be multi-platform, and the bundled third-party libraries too. Which means that a single person should be able to port it to a reasonably popular platform such as RISC-V. Others are welcome to pitch in with their own opinion.

@jhlegarreta
Copy link
Member

Closing due to lack of follow-up to maintainers' response. Can be re-opened in the future if necessary.

@wangyuliu
Copy link
Author

I don't think it would take a team of people. ITK is meant to be multi-platform, and the bundled third-party libraries too. Which means that a single person should be able to port it to a reasonably popular platform such as RISC-V. Others are welcome to pitch in with their own opinion.
#4207 (comment)

Thank you very much for your comment. Our tool has collected hundreds of lines of assembly code and counted thousands of Intrinsic functions (with duplicates) for ITK. There are also some structures with #if and architecture-related macros, so the tool evaluates it as moderately complexity to transplant. Is this correct? What other comments do you have?

@dzenanz
Copy link
Member

dzenanz commented Dec 5, 2023

ITK itself has no assembly code. That comes from bundled third-party libraries, such as zlib-ng. In most of those cases, assembly is only a platform-specific optimization for specific popular platforms, with C or C++ fallback for less known platforms. If I remember correctly, most problems related to architecture porting were compiler differences and missing header inclusions.

@blowekamp
Copy link
Member

ITK itself has no assembly code.

This is correct, but we do use some cpu intrinsic is a couple places such as here:
https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkMathDetail.h

And as @dzenanz the code is written as an optimization for common architectures, and has C/C++ fall back code.

@wangyuliu
Copy link
Author

Thank you for your reply. Can I confirm again? By filtering the third-party libraries you mentioned, we did obtain only a small amount of code for architecture-bound structures such as Intrinsic functions, including the contents in the directory https://github.com/InsightSoftwareConsortium/ ITK/blob/master/Modules/Core/Common/include/itkMathDetail.h. In the end, our tool believed that the porting complexity of ITK was very low. You mentioned that this part of the code is independent of each architecture, so you also think that the workload required for porting is very small, right?

@dzenanz
Copy link
Member

dzenanz commented Dec 7, 2023

Correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants