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

支持多核吗?怎么支持 #26

Open
sumo2017 opened this issue Aug 9, 2021 · 1 comment
Open

支持多核吗?怎么支持 #26

sumo2017 opened this issue Aug 9, 2021 · 1 comment

Comments

@sumo2017
Copy link

sumo2017 commented Aug 9, 2021

如题,如果要编译支持多核(多core)的算子,应该怎么做?

@lyuchuny3
Copy link
Contributor

可以通过parallel()调度原语来调用: https://autokernel-docs-en.readthedocs.io/en/latest/tutorials/halide/halide_schedule.html#schedules-within-stages-domain-order

parallel (x,size) | Splits the dimension by size and parallelizes the outer dimension.

如果要控制具体的线程数,可以通后环境变量HL_NUM_THREADS:

HL_NUM_THREADS=... specifies the number of threads to create for the thread pool. When the async scheduling directive is used, more threads than this number may be required and thus allocated. A maximum of 256 threads is allowed. (By default, the number of cores on the host is used.)

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

2 participants