Skip to content

Conversation

@cadivus
Copy link

@cadivus cadivus commented Jun 13, 2025

This PR fixes installing LLVM and using the installed version.
The relative were broken if using installed LLVM, resulting in errors like this:

In file included from main.cu:4:
/tmp/installed_software/llvm/include/offload/cuda/cuda_runtime.h:14:10: fatal error: '../../kernel/include/DefineLanguageNames.inc' file not found
   14 | #include "../../kernel/include/DefineLanguageNames.inc"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated when compiling for gfx90a.

Now, this works. If you don't want to do an extra -I on compiling, you can now include

#include <offload/cuda/cuda_runtime.h>

instead of

#include <cuda_runtime.h>

The structure of installed files is:

$ tree include/offload/
include/offload/
├── cuda
│   └── cuda_runtime.h
├── hip
│   └── hip_runtime.h
├── kernel
│   ├── DefineLanguageNames.inc
│   ├── LanguageRuntime.h
│   └── UndefineLanguageNames.inc
├── OffloadAPI.h
└── OffloadPrint.hpp

4 directories, 7 files

@cadivus cadivus force-pushed the structural-improvements branch 2 times, most recently from 6871cec to e29d88d Compare June 15, 2025 18:08
@cadivus cadivus force-pushed the structural-improvements branch 4 times, most recently from ef851e6 to caf1439 Compare June 16, 2025 15:41
@cadivus cadivus force-pushed the structural-improvements branch from caf1439 to 30633cb Compare June 16, 2025 17:08
@cadivus cadivus force-pushed the structural-improvements branch 2 times, most recently from 3b388f2 to 3313c01 Compare June 16, 2025 17:14
@cadivus cadivus force-pushed the structural-improvements branch from 3313c01 to 60c8312 Compare June 16, 2025 17:17
@kevinsala
Copy link
Collaborator

LGTM

@kevinsala kevinsala merged commit 823c157 into jdoerfert:llvm_kernel_languages Jun 16, 2025
2 checks passed
@cadivus cadivus deleted the structural-improvements branch June 16, 2025 19:11
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