Skip to content

Commit f1c35bf

Browse files
committed
Update on "refactor cuda_backend.cpp"
This diff does a comprehensive refactor on cuda_backend.cpp. Two main points: 1. Reuse ExecuTorch standard macros (ET_CHECK_OR_RETURN_ERROR and others) to replaces exiting if..else + ET_LOG branches 2. Introduced LOAD_SYMBOL macro to concentrate the symbol loading pipeline. Differential Revision: [D84135844](https://our.internmc.facebook.com/intern/diff/D84135844/) [ghstack-poisoned]
2 parents 202fb2a + 0965208 commit f1c35bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backends/cuda/runtime/cuda_backend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ class ET_EXPERIMENTAL CudaBackend final
322322
if (handle->container_handle != nullptr) {
323323
AOTIRuntimeError delete_result =
324324
AOTInductorModelContainerDelete(handle->container_handle);
325-
ET_CHECK_OR_LOG(
325+
ET_CHECK_OR_LOG_ERROR(
326326
delete_result == Error::Ok,
327327
"Failed to delete AOTInductorModelContainer with error code %d",
328328
delete_result);
@@ -338,7 +338,7 @@ class ET_EXPERIMENTAL CudaBackend final
338338
if (!handle->so_path.empty()) {
339339
std::error_code remove_error;
340340
std::filesystem::remove(handle->so_path, remove_error);
341-
ET_CHECK_OR_LOG(
341+
ET_CHECK_OR_LOG_ERROR(
342342
!remove_error,
343343
"Failed to remove temporary shared library %s: %s",
344344
handle->so_path.c_str(),

0 commit comments

Comments
 (0)