mlx/mlx/backend/rocm/utils.cpp
2025-06-16 22:42:56 +01:00

17 lines
397 B
C++

// Copyright © 2025 Apple Inc.
#include "mlx/backend/rocm/utils.h"
#include <sstream>
#include <stdexcept>
namespace mlx::core::rocm {
void check_hip_error(const char* msg, hipError_t error) {
if (error != hipSuccess) {
std::ostringstream oss;
oss << "[ROCm] " << msg << ": " << hipGetErrorString(error);
throw std::runtime_error(oss.str());
}
}
} // namespace mlx::core::rocm