Skip to content

Commit

Permalink
e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Oct 12, 2024
1 parent 996a7bb commit 8e0d61a
Show file tree
Hide file tree
Showing 29 changed files with 1,207 additions and 465 deletions.
2 changes: 1 addition & 1 deletion build_tools/build_test_cpp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ echo "-----"
# better have git-bash installed...
$env:Path = "C:\Program Files\Git\bin;$env:Path"
pushd $build_dir
& bash -l -c "ctest -R amd-aie -E driver/xrt-lite --output-on-failure -j --repeat until-pass:5"
& bash -l -c "ctest -R amd-aie -E driver --output-on-failure -j --repeat until-pass:5"
popd

if ($llvm_install_dir -and (Test-Path "$llvm_install_dir"))
Expand Down
2 changes: 1 addition & 1 deletion build_tools/build_test_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ cmake --build "$build_dir" --target iree-install-dist
echo "CTest"
echo "-----"
if [[ "$OSTYPE" == "linux"* ]]; then
ctest --test-dir "$build_dir" -R amd-aie -E "driver/xrt-lite" --output-on-failure -j
ctest --test-dir "$build_dir" -R amd-aie -E "driver" --output-on-failure -j
elif [[ "$OSTYPE" == "darwin"* ]]; then
ctest --test-dir "$build_dir" -R amd-aie -E "matmul_pack_peel_air_e2e|matmul_elementwise_pack_peel_air_e2e|conv_fill_spec_pad" --output-on-failure -j --repeat until-pass:5
fi
Expand Down
8 changes: 7 additions & 1 deletion iree_compiler_plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ if("xrt" IN_LIST IREE_EXTERNAL_HAL_DRIVERS)
set(IREE_AMD_AIE_ENABLE_XRT_DRIVER ON)
endif()

if(IREE_AMD_AIE_ENABLE_XRT_DRIVER)
set(IREE_AMD_AIE_ENABLE_XRT_LITE_DRIVER OFF)
if("xrt-lite" IN_LIST IREE_EXTERNAL_HAL_DRIVERS)
message(STATUS "Enabling XRT-LITE build because it is an enabled HAL driver")
set(IREE_AMD_AIE_ENABLE_XRT_LITE_DRIVER ON)
endif()

if(IREE_AMD_AIE_ENABLE_XRT_DRIVER OR IREE_AMD_AIE_ENABLE_XRT_LITE_DRIVER)
include(iree_aie_xrt)
endif()
include(iree_aie_bootgen)
Expand Down
7 changes: 5 additions & 2 deletions runtime/src/iree-amd-aie/driver/xrt-lite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@ iree_cc_library(
api.h
buffer.cc
buffer.h
command_buffer.cc
command_buffer.h
direct_command_buffer.cc
direct_command_buffer.h
device.cc
driver.cc
executable.cc
executable.h
nop_executable_cache.cc
nop_executable_cache.h
nop_semaphore.cc
nop_semaphore.h
util.h
DEPS
iree::base
iree::base::core_headers
iree::hal::utils::deferred_command_buffer
iree::base::internal::flatcc::parsing
iree-amd-aie::schemas::xrt_executable_def_c_fbs
iree-amd-aie::driver::xrt-lite::shim::linux::kmq::shim-xdna
Expand Down
11 changes: 4 additions & 7 deletions runtime/src/iree-amd-aie/driver/xrt-lite/buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ iree_status_t iree_hal_xrt_lite_buffer::invalidate_range(
IREE_STATUS_FAILED_PRECONDITION,
"buffer does not have device memory attached and cannot be mapped");
}
this->bo->sync(shim_xdna::direction::device2host, local_byte_length,
local_byte_offset);
this->bo->sync(shim_xdna::direction::device2host);
return iree_ok_status();
}

Expand All @@ -86,8 +85,7 @@ iree_status_t iree_hal_xrt_lite_buffer::flush_range(
IREE_STATUS_FAILED_PRECONDITION,
"buffer does not have device memory attached and cannot be mapped");
}
this->bo->sync(shim_xdna::direction::host2device, local_byte_length,
local_byte_offset);
this->bo->sync(shim_xdna::direction::host2device);
return iree_ok_status();
}

Expand Down Expand Up @@ -146,11 +144,10 @@ static void iree_hal_xrt_lite_buffer_destroy(iree_hal_buffer_t* base_buffer) {
IREE_TRACE_ZONE_END(z0);
}

std::unique_ptr<shim_xdna::bo> iree_hal_xrt_lite_buffer_unwrap(
iree_hal_buffer_t* base_buffer) {
shim_xdna::bo* iree_hal_xrt_lite_buffer_handle(iree_hal_buffer_t* base_buffer) {
iree_hal_xrt_lite_buffer* buffer =
reinterpret_cast<iree_hal_xrt_lite_buffer*>(base_buffer);
return std::move(buffer->bo);
return buffer->bo.get();
}

#define BUFFER_MEMBER_STATUS(member) \
Expand Down
3 changes: 1 addition & 2 deletions runtime/src/iree-amd-aie/driver/xrt-lite/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ iree_status_t iree_hal_xrt_lite_buffer_wrap(
iree_hal_buffer_release_callback_t release_callback,
iree_allocator_t host_allocator, iree_hal_buffer_t** out_buffer);

std::unique_ptr<shim_xdna::bo> iree_hal_xrt_lite_buffer_unwrap(
iree_hal_buffer_t* base_buffer);
shim_xdna::bo* iree_hal_xrt_lite_buffer_handle(iree_hal_buffer_t* base_buffer);

#endif // IREE_HAL_DRIVERS_XRT_LITE_BUFFER_H_
Loading

0 comments on commit 8e0d61a

Please sign in to comment.