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;
|
break;
|
||||||
}
|
}
|
||||||
if (reduce_type_ != Scatter::None) {
|
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);
|
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()
|
kernel_source << metal::utils() << metal::gemm()
|
||||||
<< metal::steel_gemm_splitk()
|
<< metal::steel_gemm_splitk()
|
||||||
<< fmt::format(
|
<< fmt::format(
|
||||||
axbpy ? steel_gemm_splitk_accum_axbpy_kernels
|
fmt::runtime(
|
||||||
: steel_gemm_splitk_accum_kernels,
|
axbpy ? steel_gemm_splitk_accum_axbpy_kernels
|
||||||
|
: steel_gemm_splitk_accum_kernels),
|
||||||
"name"_a = lib_name,
|
"name"_a = lib_name,
|
||||||
"atype"_a = get_type_string(in.dtype()),
|
"atype"_a = get_type_string(in.dtype()),
|
||||||
"otype"_a = get_type_string(out.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), ...);
|
(add_arg(args), ...);
|
||||||
s << ">";
|
s << ">";
|
||||||
std::string base_string = R"(
|
return fmt::format(
|
||||||
template [[host_name("{0}")]] [[kernel]] decltype({1}) {1};
|
"\ntemplate [[host_name(\"{0}\")]] [[kernel]] decltype({1}) {1};\n",
|
||||||
)";
|
name,
|
||||||
return fmt::format(base_string, name, s.str());
|
s.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace mlx::core
|
} // namespace mlx::core
|
||||||
|
Loading…
Reference in New Issue
Block a user