Skip to content

Commit e73d1c9

Browse files
Debug
1 parent 3187e3c commit e73d1c9

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

sycl-jit/jit-compiler/lib/rtc/DeviceCompilation.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ class SYCLToolchain {
282282
std::unique_ptr<MemoryBuffer> PrecompiledPreamble,
283283
const PreambleBounds &Bounds, CompilerInvocation &CI,
284284
IntrusiveRefCntPtr<llvm::vfs::FileSystem> &VFS) {
285+
std::cerr << __PRETTY_FUNCTION__ << "\n";
285286

286287
// Processing similar to PrecompiledPreamble::configurePreamble.
287288

@@ -361,15 +362,18 @@ class SYCLToolchain {
361362
// need this extra `Success` variable to be able to properly return
362363
// compilatoin status.
363364
bool Success = false;
364-
auto RunWithoutPCH = [&]() -> bool {
365+
auto RunWithoutPCH = [&](unsigned LINE = __builtin_LINE()) -> bool {
366+
std::cerr << __PRETTY_FUNCTION__ << " " << LINE << "\n";
365367
// Run original invocation:
366368
Success =
367369
Action::runInvocation(std::move(Invocation), Files,
368370
std::move(PCHContainerOps), DiagConsumer);
369371
return Success;
370372
};
371373

372-
auto UseCachedPreamble = [&](StringRef PCHContent) {
374+
auto UseCachedPreamble = [&](StringRef PCHContent,
375+
unsigned LINE = __builtin_LINE()) {
376+
std::cerr << __PRETTY_FUNCTION__ << " " << LINE << "\n";
373377
std::unique_ptr<MemoryBuffer> PCHMemBuf =
374378
MemoryBuffer::getMemBufferCopy(PCHContent);
375379

@@ -395,6 +399,8 @@ class SYCLToolchain {
395399

396400
auto CacheCallback = [&](size_t, const Twine &,
397401
std::unique_ptr<MemoryBuffer> MB) -> void {
402+
std::cerr << __PRETTY_FUNCTION__ << " " << std::boolalpha << CacheHit
403+
<< "\n";
398404
if (!CacheHit)
399405
return; // See above.
400406

@@ -468,7 +474,11 @@ class SYCLToolchain {
468474

469475
OS << NewPreamble->memoryContents();
470476

471-
consumeError(CFS->commit());
477+
auto Err = CFS->commit();
478+
if (Err) {
479+
std::cerr << "Error in commit\n";
480+
}
481+
consumeError(std::move(Err));
472482

473483
return Success;
474484
} else {

sycl/test-e2e/KernelCompiler/persistent_auto_pch_read_error.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@
1919
// RUN: %{run-aux} cp %s %t.dir/*
2020
// RUN: %{run-unfiltered-devices} %t.out
2121

22+
// RUN: false
23+
2224
#include <sycl/detail/core.hpp>
2325
#include <sycl/kernel_bundle.hpp>
2426

27+
#include <iostream>
28+
2529
namespace syclexp = sycl::ext::oneapi::experimental;
2630

2731
const std::string src = R"""(
@@ -38,6 +42,7 @@ void foo(int *p) {
3842
)""";
3943

4044
int main() {
45+
std::cout << "PCH_DIR: " PCH_DIR << std::endl;
4146
sycl::queue q;
4247
auto kb_src = syclexp::create_kernel_bundle_from_source(
4348
q.get_context(), syclexp::source_language::sycl, src);

0 commit comments

Comments
 (0)