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

[BUG]: Heterogenous compilation with Intel LLVM Fortran compiler #6370

Open
ivan-pi opened this issue Apr 17, 2024 · 2 comments
Open

[BUG]: Heterogenous compilation with Intel LLVM Fortran compiler #6370

ivan-pi opened this issue Apr 17, 2024 · 2 comments
Labels

Comments

@ivan-pi
Copy link

ivan-pi commented Apr 17, 2024

Describe the bug

Assembly output is not working when using the Intel Fortran compiler and OpenMP offloading. The error message is,

/opt/compiler-explorer/intel-fortran-2024.0.0.49493/compiler/2024.0/bin/compiler/clang-offload-bundler: error: unable to find 'llvm-objcopy' in path
Compiler returned: 1

The equivalent program with icx/icpx works (although it doesn't display the SPIR part), even if the device code is not unbundled.

(The related issue for C++ was #2244)

Steps to reproduce

Visit godbolt.org, select the latest ifx compiler, and provide the input,

subroutine triad_gpu(n,a,b,c)
integer, intent(in) :: n
real, intent(in) :: a(n), b(n)
real, intent(out) :: c(n)
integer :: i
!$omp target teams loop map(to:a,b) map(from:c)
do i = 1, n
    c(i) = a(i) + b(i)
end do
end subroutine

Expected behavior

The assembly output should be there (at the very least); ideally also the device code would be shown.

Reproduction link

https://godbolt.org/z/c3zvzK6q3

Screenshots

Not applicable

Operating System

No response

Browser version

No response

@ivan-pi ivan-pi added the bug label Apr 17, 2024
@ivan-pi
Copy link
Author

ivan-pi commented Apr 17, 2024

It appears like the tools to unbundle device code introduced in #4019, don't work anymore for newer versions of icx/ifx including 2023 and 2024.

@partouf
Copy link
Contributor

partouf commented Apr 17, 2024

For the failing c/c++ icx > 2023.1, we can probably set up alternative paths for llvm-dis and the likes through some properties (https://github.com/compiler-explorer/compiler-explorer/blob/main/lib/compilers/clang.ts#L71) here https://github.com/compiler-explorer/compiler-explorer/blob/main/etc/config/c%2B%2B.amazon.properties#L1184

For the failing icx 2024 it seems that the directory with the clang-offload-bunder has changed to /opt/compiler-explorer/intel-cpp-2024.0.0.49524/compiler/2024.0/bin/compiler and is not like https://github.com/compiler-explorer/compiler-explorer/blob/main/lib/compilers/clang.ts#L372 suggests in ../bin-llvm - we should be able to set that as a property in icx 2024

For fortran 2024 similar directory changes have occured, the offload-builder is now in bin/compiler as well, but llvm-objcopy is Not there. We would probably need to add a directory to PATH before executing the bundler - that's going to a bit more complicated.

Also ifx has never actually been configured to work with these things, we'll need to do more than add some paths. (add new compilerType, copy device extraction code, etc from https://github.com/compiler-explorer/compiler-explorer/blob/main/lib/compilers/clang.ts - currently https://github.com/compiler-explorer/compiler-explorer/blob/main/lib/compilers/fortran.ts is used which knows nothing about device code)

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

No branches or pull requests

2 participants