Commit 44e28fd
committed
WIP
```c++
int main() {
const char *src = R"""(
// #include <stdio.h>
namespace syclext = sycl::ext::oneapi;
namespace syclexp = sycl::ext::oneapi::experimental;
extern "C"
SYCL_EXT_ONEAPI_FUNCTION_PROPERTY((syclexp::single_task_kernel))
void foo(int *p) {
*p = 42;
}
)""";
jit_compiler::InMemoryFile SrcFile{"a.cpp", src};
std::vector<jit_compiler::InMemoryFile> IncludeFiles{
{"/fake_includes/assert.h", "#pragma once\n#define assert(...)\n"}
};
std::vector<const char *> opts = {
"--stdlib=libc++", "-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES"
, "-include", "stdio.h"
// "-Xclang", "-isystem-after", "-Xclang", "/sycl-jit-toolchain/lib/clang/22/include/libc"
// ,
// "-isystem-after=/sycl-jit-toolchain/lib/clang/22/include/libc"
};
{
auto Res = jit_compiler::calculateHash(SrcFile, IncludeFiles, opts,
jit_compiler::BinaryFormat::SPIRV);
std::cerr << "Failed: " << std::boolalpha << Res.failed() << std::endl;
}
{
auto Res = jit_compiler::compileSYCL(SrcFile, IncludeFiles, opts,
{nullptr, 0}, false,
jit_compiler::BinaryFormat::SPIRV);
std::cerr << (int)Res.getErrorCode() << std::endl;
std::cerr << Res.getBuildLog() << std::endl;
}
}
```1 parent f976569 commit 44e28fd
File tree
4 files changed
+28
-4
lines changed- clang/lib/Driver/ToolChains
- sycl-jit/jit-compiler
- lib/rtc
- sycl/include/sycl/ext/oneapi/properties
4 files changed
+28
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2083 | 2083 | | |
2084 | 2084 | | |
2085 | 2085 | | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
2086 | 2089 | | |
2087 | 2090 | | |
2088 | 2091 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
216 | 218 | | |
217 | 219 | | |
218 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
219 | 224 | | |
220 | 225 | | |
221 | 226 | | |
| |||
278 | 283 | | |
279 | 284 | | |
280 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
281 | 294 | | |
282 | 295 | | |
283 | 296 | | |
| |||
543 | 556 | | |
544 | 557 | | |
545 | 558 | | |
| 559 | + | |
546 | 560 | | |
547 | 561 | | |
548 | 562 | | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
549 | 569 | | |
550 | 570 | | |
551 | 571 | | |
| |||
704 | 724 | | |
705 | 725 | | |
706 | 726 | | |
707 | | - | |
| 727 | + | |
708 | 728 | | |
709 | 729 | | |
710 | 730 | | |
| 731 | + | |
| 732 | + | |
711 | 733 | | |
712 | 734 | | |
713 | 735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
0 commit comments