Skip to content

Commit d2d8acf

Browse files
committed
hacks
1 parent 357bf9f commit d2d8acf

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

backends/cuda/runtime/cuda_backend.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,19 +391,25 @@ static executorch::runtime::Error success_with_compiler =
391391
#endif
392392

393393
extern "C" CUDA_BACKEND_INIT_EXPORT void InitCudaBackend() {
394-
ET_LOG(
395-
Info,
396-
"CALLING INITCUDABACKEND");
397394
#ifdef _WIN32
398395
// On Windows, explicitly register the backend since DLL static initializers
399396
// don't run reliably
400397
static bool initialized = false;
401398
if (!initialized) {
402-
register_backend(backend);
399+
ET_LOG(Info, "Registering CUDA backend on Windows");
400+
auto error = register_backend(backend);
401+
if (error == executorch::runtime::Error::Ok) {
402+
ET_LOG(Info, "Successfully registered CudaBackend");
403+
} else {
404+
ET_LOG(Error, "Failed to register CudaBackend: error code %d", (int)error);
405+
}
403406
initialized = true;
407+
} else {
408+
ET_LOG(Info, "CUDA backend already initialized");
404409
}
405410
#else
406411
// On other platforms, static initialization already happened
412+
ET_LOG(Info, "CUDA backend using static initialization");
407413
(void)success_with_compiler;
408414
#endif
409415
}

0 commit comments

Comments
 (0)