mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-24 01:17:26 +08:00
17 lines
397 B
C++
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
|