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

[flang][cuda] Using the -x cuda option switch to cc1 instead of fc1 #104483

Closed
clementval opened this issue Aug 15, 2024 · 4 comments
Closed

[flang][cuda] Using the -x cuda option switch to cc1 instead of fc1 #104483

clementval opened this issue Aug 15, 2024 · 4 comments
Assignees

Comments

@clementval
Copy link
Contributor

When trying to compile a cuda fortran example with -x cuda, cc1 is picked but fc1 should still be used.

@llvmbot
Copy link
Member

llvmbot commented Aug 15, 2024

@llvm/issue-subscribers-flang-driver

Author: Valentin Clement (バレンタイン クレメン) (clementval)

When trying to compile a cuda fortran example with `-x cuda`, `cc1` is picked but `fc1` should still be used.

@clementval
Copy link
Contributor Author

@banach-space Do you have any idea where this switch is made?

@banach-space
Copy link
Contributor

banach-space commented Aug 16, 2024

Roughly here:

Tool *ToolChain::SelectTool(const JobAction &JA) const {
if (D.IsFlangMode() && getDriver().ShouldUseFlangCompiler(JA)) return getFlang();
if (getDriver().ShouldUseClangCompiler(JA)) return getClang();
Action::ActionClass AC = JA.getKind();
if (AC == Action::AssembleJobClass && useIntegratedAs() &&
!getTriple().isOSAIX())
return getClangAs();
return getTool(AC);
}

@clementval
Copy link
Contributor Author

Thanks for the pointer @banach-space !

clementval added a commit that referenced this issue Aug 16, 2024
Flang is switch to cc1 when we use `-x cuda`. Make sure we can use fc1
with cuda fortran input.

The current pipeline will fail at MLIR level for the moment. 

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

No branches or pull requests

4 participants