Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Fallback to CPU in case code generation fails. #373

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions omniscidb/QueryEngine/Compiler/Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1026,8 +1026,9 @@ std::shared_ptr<L0CompilationContext> L0Backend::generateNativeGPUCode(
try {
bin_result = spv_to_bin(ss.str(), func_name, gpu_target.block_size, l0_mgr);
} catch (l0::L0Exception& e) {
llvm::errs() << e.what() << "\n";
return {};
LOG(WARNING) << "Failed to generate native GPU code: " << e.what()
<< ". Switching to CPU execution target.";
throw QueryMustRunOnCpu();
}

auto compilation_ctx = std::make_shared<L0CompilationContext>();
Expand Down
4 changes: 4 additions & 0 deletions omniscidb/Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ add_test(QueryBuilderTest QueryBuilderTest ${TEST_ARGS})
if(ENABLE_CUDA)
add_test(GpuSharedMemoryTest GpuSharedMemoryTest ${TEST_ARGS})
endif()
if(ENABLE_L0)
add_test(NAME PuntToCpu COMMAND ArrowBasedExecuteTest "--gtest_filter=Select.Punt*" ${TEST_ARGS})
set_tests_properties(PuntToCpu PROPERTIES LABELS "enabling")
endif()

if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
add_test(UdfTest UdfTest ${TEST_ARGS})
Expand Down