Skip to content

Commit

Permalink
[bug] Unify error message matching with/without validation layers for…
Browse files Browse the repository at this point in the history
… CapiTest.FailMapDeviceOnlyMemory (#7110)

Issue: #

### Brief Summary
  • Loading branch information
jim19930609 authored Jan 13, 2023
1 parent 374361a commit 18edb20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
3 changes: 2 additions & 1 deletion c_api/src/taichi_core_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ void *ti_map_memory(TiRuntime runtime, TiMemory devmem) {
Runtime *runtime2 = (Runtime *)runtime;
TI_ASSERT(runtime2->get().map(devmem2devalloc(*runtime2, devmem), &out) ==
taichi::lang::RhiResult::success &&
"RHI map memory failed");
"RHI map memory failed: "
"Mapping Memory without VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT set");
TI_CAPI_TRY_CATCH_END();
return out;
}
Expand Down
8 changes: 0 additions & 8 deletions c_api/tests/c_api_interface_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,10 @@ TEST_F(CapiTest, FailMapDeviceOnlyMemory) {
ti::Memory mem = runtime.allocate_memory(100);
mem.map();

#ifdef __APPLE__
// Vulkan Validation aren't supported on MacOS platform
EXPECT_TAICHI_ERROR(TI_ERROR_INVALID_STATE, "Assertion failure",
/*reset_error=*/false);
EXPECT_TAICHI_ERROR(TI_ERROR_INVALID_STATE, "RHI map memory failed",
/*reset_error=*/true);
#else
EXPECT_TAICHI_ERROR(
TI_ERROR_INVALID_STATE,
"Mapping Memory without VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT set",
/*reset_error=*/true);
#endif
}
}

Expand Down

0 comments on commit 18edb20

Please sign in to comment.