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

[llvm] Add a TI_WITH_LLVM option #3507

Merged
merged 6 commits into from
Nov 15, 2021

Conversation

AmesingFlank
Copy link
Collaborator

@AmesingFlank AmesingFlank commented Nov 14, 2021

This PR adds a TI_WITH_LLVM option, so that one can optionally disable compiling with LLVM. (For example, I'm trying to emscripten the entire taichi project, and LLVM doesn't like that).

TI_WITH_LLVM is defaulted to ON, so this PR won't affect any of our existing CI/CD/build tools.

@netlify
Copy link

netlify bot commented Nov 14, 2021

✔️ Deploy Preview for jovial-fermat-aa59dc canceled.

🔨 Explore the source changes: 8237e13

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/6191b1151b5a0800079b1aad

Co-authored-by: Bo Qiao <boqiao@taichi.graphics>
Copy link
Collaborator

@qiao-bo qiao-bo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. A quick grep into our cpp and h files shows 263 occurrences of endif, many of which are small blocks. I feel like this may hinder readability in the long term.

@AmesingFlank
Copy link
Collaborator Author

Thanks. A quick grep into our cpp and h files shows 263 occurrences of endif, many of which are small blocks. I feel like this may hinder readability in the long term.

I agree :(( The right thing to do here would be to:

  • Move taichi/llvm taichi/codegen (and some other stuff such as SNodeBufferManager) into a folder in taichi/backend, and use cmake to omit compiling that folder
  • Keep refactoring program.cpp until it is fully backend-independent (i.e. remove all the llvm stuff).

I'm happy to create an issue to track this, but it would be a rather big effort.

@qiao-bo
Copy link
Collaborator

qiao-bo commented Nov 15, 2021

Thanks. A quick grep into our cpp and h files shows 263 occurrences of endif, many of which are small blocks. I feel like this may hinder readability in the long term.

I agree :(( The right thing to do here would be to:

  • Move taichi/llvm taichi/codegen (and some other stuff such as SNodeBufferManager) into a folder in taichi/backend, and use cmake to omit compiling that folder
  • Keep refactoring program.cpp until it is fully backend-independent (i.e. remove all the llvm stuff).

I'm happy to create an issue to track this, but it would be a rather big effort.

Indeed a big effort. Having a llvm folder in taichi/backend seems reasonable to me. This can also move some llvm-specific code from device.h/cpp. For now, i think this is fine.

@qiao-bo qiao-bo self-requested a review November 15, 2021 01:22
Copy link
Collaborator

@qiao-bo qiao-bo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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

Successfully merging this pull request may close these issues.

2 participants