mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-25 09:51:17 +08:00
21 lines
460 B
C++
21 lines
460 B
C++
// Copyright © 2025 Apple Inc.
|
|
|
|
#include "mlx/dtype_utils.h"
|
|
|
|
namespace mlx::core {
|
|
|
|
const char* dtype_to_string(Dtype arg) {
|
|
if (arg == bool_) {
|
|
return "bool";
|
|
}
|
|
#define SPECIALIZE_DtypeToString(CPP_TYPE, DTYPE) \
|
|
if (DTYPE == arg) { \
|
|
return #DTYPE; \
|
|
}
|
|
MLX_FORALL_DTYPES(SPECIALIZE_DtypeToString)
|
|
#undef SPECIALIZE_DtypeToString
|
|
return "(unknown)";
|
|
}
|
|
|
|
} // namespace mlx::core
|