MLX
Loading...
Searching...
No Matches
softmax.h
Go to the documentation of this file.
1
// Copyright © 2024 Apple Inc.
2
3
constexpr
std::string_view
softmax_kernels
= R
"(
4
template [[host_name("block_{0}")]] [[kernel]] void
5
softmax_single_row<{1}, {2}>(
6
const device {1}* in,
7
device {1}* out,
8
constant int& axis_size,
9
uint gid [[thread_position_in_grid]],
10
uint _lid [[thread_position_in_threadgroup]],
11
uint simd_lane_id [[thread_index_in_simdgroup]],
12
uint simd_group_id [[simdgroup_index_in_threadgroup]]);
13
template [[host_name("looped_{0}")]] [[kernel]] void
14
softmax_looped<{1}, {2}>(
15
const device {1}* in,
16
device {1}* out,
17
constant int& axis_size,
18
uint gid [[threadgroup_position_in_grid]],
19
uint lid [[thread_position_in_threadgroup]],
20
uint lsize [[threads_per_threadgroup]],
21
uint simd_lane_id [[thread_index_in_simdgroup]],
22
uint simd_group_id [[simdgroup_index_in_threadgroup]]);
23
)";
softmax_kernels
constexpr std::string_view softmax_kernels
Definition
softmax.h:3
mlx
backend
metal
jit
softmax.h
Generated by
1.13.2