MCPcopy Create free account
hub / github.com/evilsocket/cake / hip_atexit_handler

Function hip_atexit_handler

cake-core/src/backends/rocm/mod.rs:41–49  ·  view source on GitHub ↗

atexit handler: terminates process before HIP's broken atexit cleanup runs. Registered after HIP init, so runs before HIP's handler (LIFO order).

()

Source from the content-addressed store, hash-verified

39/// atexit handler: terminates process before HIP's broken atexit cleanup runs.
40/// Registered after HIP init, so runs before HIP's handler (LIFO order).
41extern "C" fn hip_atexit_handler() {
42 if HIP_INITIALIZED.load(Ordering::Relaxed) {
43 // Flush stdio then hard-exit to prevent HIP atexit crash
44 unsafe {
45 libc::fflush(std::ptr::null_mut());
46 libc::syscall(libc::SYS_exit_group, 0);
47 }
48 }
49}
50
51use candle_core::{DType, Device, Result, Tensor, TensorId, D};
52

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected