From 627f7e1934ddb667e390b87db9022f115d98723e Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Wed, 28 Aug 2024 22:10:37 -0500 Subject: [PATCH] fix after rebase --- .github/workflows/ci-linux.yml | 2 +- .../target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp | 5 ++++- runtime/src/iree-amd-aie/driver/xrt/native_executable.cc | 7 +++++-- runtime/src/iree-amd-aie/driver/xrt/xrt_driver.cc | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index a3a0bbe57..100ea0eca 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -93,7 +93,7 @@ jobs: strategy: fail-fast: false matrix: - runs-on: [linux-phoenix-20240819] + runs-on: [linux-phoenix] runs-on: ${{ matrix.runs-on }} env: XILINXD_LICENSE_FILE: /opt/xilinx/Xilinx.lic diff --git a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp index 17549f214..455416f2d 100644 --- a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp +++ b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp @@ -639,7 +639,10 @@ static LogicalResult generateCoreElfFiles( if (verbose) flags.emplace_back("-v"); // we run clang (ie cc) so that libc, libm, crt0/1 paths are injected // automatically into the ld.lld invocation - return runTool((peanoDir / "bin" / "clang").string(), flags, verbose); + if (failed( + runTool((peanoDir / "bin" / "clang").string(), flags, verbose))) { + return failure(); + } } return success(); } diff --git a/runtime/src/iree-amd-aie/driver/xrt/native_executable.cc b/runtime/src/iree-amd-aie/driver/xrt/native_executable.cc index f4f990ab2..582a789fa 100644 --- a/runtime/src/iree-amd-aie/driver/xrt/native_executable.cc +++ b/runtime/src/iree-amd-aie/driver/xrt/native_executable.cc @@ -279,8 +279,11 @@ static void iree_hal_xrt_native_executable_destroy( for (iree_host_size_t i = 0; i < executable->entry_point_count; ++i) { try { - // delete executable->entry_points[i].kernel; - // delete executable->entry_points[i].instr; +#ifndef _WIN32 + // causes segmentation fault on windows + delete executable->entry_points[i].kernel; + delete executable->entry_points[i].instr; +#endif // TODO(jornt): deleting the xclbin here will result in a corrupted size // error in XRT. It looks like the xclbin needs to stay alive while the // device is alive if it has been registered. diff --git a/runtime/src/iree-amd-aie/driver/xrt/xrt_driver.cc b/runtime/src/iree-amd-aie/driver/xrt/xrt_driver.cc index 3c9effd98..6dd8feb0a 100644 --- a/runtime/src/iree-amd-aie/driver/xrt/xrt_driver.cc +++ b/runtime/src/iree-amd-aie/driver/xrt/xrt_driver.cc @@ -85,7 +85,7 @@ iree_status_t iree_hal_xrt_driver_create_internal( return iree_make_status(IREE_STATUS_FAILED_PRECONDITION, "No XRT devices found"); } - } catch (std::runtime_error& e) { + } catch (std::exception& e) { return iree_make_status(IREE_STATUS_INTERNAL, "xrt::system::enumerate_devices failed: %s", e.what()); @@ -94,7 +94,7 @@ iree_status_t iree_hal_xrt_driver_create_internal( try { global_device = xrt::device(0); driver->device = &global_device; - } catch (std::runtime_error& e) { + } catch (std::exception& e) { return iree_make_status(IREE_STATUS_INTERNAL, "xrt::device(0) failed: %s", e.what()); }