mirror of
https://github.com/ml-explore/mlx.git
synced 2025-07-14 20:41:13 +08:00

* unify matmuls * Update mlx/backend/common/matmul.cpp Co-authored-by: Angelos Katharopoulos <a_katharopoulos@apple.com> --------- Co-authored-by: Angelos Katharopoulos <a_katharopoulos@apple.com>
23 lines
702 B
C++
23 lines
702 B
C++
// Copyright © 2023-2024 Apple Inc.
|
|
|
|
#include "mlx/array.h"
|
|
#include "mlx/primitives.h"
|
|
|
|
#define DEFAULT(primitive) \
|
|
void primitive::eval_cpu(const std::vector<array>& inputs, array& out) { \
|
|
primitive::eval(inputs, out); \
|
|
}
|
|
|
|
#define DEFAULT_MULTI(primitive) \
|
|
void primitive::eval_cpu( \
|
|
const std::vector<array>& inputs, std::vector<array>& outputs) { \
|
|
primitive::eval(inputs, outputs); \
|
|
}
|
|
|
|
namespace mlx::core {
|
|
|
|
DEFAULT(Reduce)
|
|
DEFAULT(Scan)
|
|
|
|
} // namespace mlx::core
|