mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
* faster general unary op * faster general ops + reorg * fix + comment * binary two * copy general
22 lines
556 B
Plaintext
22 lines
556 B
Plaintext
// Copyright © 2025 Apple Inc.
|
|
|
|
#include "mlx/backend/cuda/unary/unary.cuh"
|
|
|
|
namespace mlx::core {
|
|
void Log::eval_gpu(const std::vector<array>& inputs, array& out) {
|
|
nvtx3::scoped_range r("Log::eval_gpu");
|
|
auto& s = out.primitive().stream();
|
|
switch (base_) {
|
|
case Base::e:
|
|
unary_op_gpu<cu::Log>(inputs, out, name(), s);
|
|
break;
|
|
case Base::two:
|
|
unary_op_gpu<cu::Log2>(inputs, out, name(), s);
|
|
break;
|
|
case Base::ten:
|
|
unary_op_gpu<cu::Log10>(inputs, out, name(), s);
|
|
break;
|
|
}
|
|
}
|
|
} // namespace mlx::core
|