mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-24 17:31:16 +08:00
C++20 compatibility for fmt (#1519)
* C++20 compatibility for fmt * Address review feedback * Remove stray string * Add newlines back
This commit is contained in:
parent
f6afb9c09b
commit
32972a5924
@ -262,7 +262,7 @@ void Scatter::eval_gpu(const std::vector<array>& inputs, array& out) {
|
||||
break;
|
||||
}
|
||||
if (reduce_type_ != Scatter::None) {
|
||||
op_type = fmt::format(op_type, out_type_str);
|
||||
op_type = fmt::format(fmt::runtime(op_type), out_type_str);
|
||||
}
|
||||
auto [idx_args, idx_arr] = make_index_args(idx_type_str, nidx);
|
||||
|
||||
|
@ -445,8 +445,9 @@ MTL::ComputePipelineState* get_steel_gemm_splitk_accum_kernel(
|
||||
kernel_source << metal::utils() << metal::gemm()
|
||||
<< metal::steel_gemm_splitk()
|
||||
<< fmt::format(
|
||||
axbpy ? steel_gemm_splitk_accum_axbpy_kernels
|
||||
: steel_gemm_splitk_accum_kernels,
|
||||
fmt::runtime(
|
||||
axbpy ? steel_gemm_splitk_accum_axbpy_kernels
|
||||
: steel_gemm_splitk_accum_kernels),
|
||||
"name"_a = lib_name,
|
||||
"atype"_a = get_type_string(in.dtype()),
|
||||
"otype"_a = get_type_string(out.dtype()));
|
||||
|
@ -209,10 +209,10 @@ get_template_definition(std::string name, std::string func, Args... args) {
|
||||
};
|
||||
(add_arg(args), ...);
|
||||
s << ">";
|
||||
std::string base_string = R"(
|
||||
template [[host_name("{0}")]] [[kernel]] decltype({1}) {1};
|
||||
)";
|
||||
return fmt::format(base_string, name, s.str());
|
||||
return fmt::format(
|
||||
"\ntemplate [[host_name(\"{0}\")]] [[kernel]] decltype({1}) {1};\n",
|
||||
name,
|
||||
s.str());
|
||||
}
|
||||
|
||||
} // namespace mlx::core
|
||||
|
Loading…
Reference in New Issue
Block a user