mirror of
https://github.com/ml-explore/mlx.git
synced 2025-11-03 18:18:15 +08:00
rebase
This commit is contained in:
@@ -137,14 +137,14 @@ $(function(){ initResizable(false); });
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span> U></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span> U, <span class="keyword">typename</span> IdxT = <span class="keywordtype">int</span>64_t></div>
|
||||
<div class="foldopen" id="foldopen00040" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="metal_2kernels_2copy_8h.html#aba4530a7db6a61ca36f50e4f5e58fb77"> 40</a></span>[[kernel]] <span class="keywordtype">void</span> <a class="code hl_function" href="metal_2kernels_2copy_8h.html#aba4530a7db6a61ca36f50e4f5e58fb77">copy_g_nd1</a>(</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="metal_2kernels_2copy_8h.html#a232c5c6b8386cf8ecbf4cdadb6e4176e"> 40</a></span>[[kernel]] <span class="keywordtype">void</span> <a class="code hl_function" href="metal_2kernels_2copy_8h.html#a232c5c6b8386cf8ecbf4cdadb6e4176e">copy_g_nd1</a>(</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> device <span class="keyword">const</span> T* src [[buffer(0)]],</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> device U* dst [[buffer(1)]],</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> constant <span class="keyword">const</span> int64_t& src_stride [[buffer(3)]],</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> uint index [[thread_position_in_grid]]) {</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keyword">auto</span> src_idx = <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#ac612d0ae30b8257198339debe04916a3">elem_to_loc_1<int64_t, int></a>(index, src_stride);</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keyword">auto</span> src_idx = <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#ac612d0ae30b8257198339debe04916a3">elem_to_loc_1<int64_t, IdxT></a>(index, src_stride);</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> dst[index] = <span class="keyword">static_cast<</span>U<span class="keyword">></span>(src[src_idx]);</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span>}</div>
|
||||
</div>
|
||||
@@ -206,16 +206,16 @@ $(function(){ initResizable(false); });
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> </div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span> U></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span> U, <span class="keyword">typename</span> IdxT = <span class="keywordtype">int</span>64_t></div>
|
||||
<div class="foldopen" id="foldopen00101" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="metal_2kernels_2copy_8h.html#a3278d9c999718bee3ccbe2922f501bf1"> 101</a></span>[[kernel]] <span class="keywordtype">void</span> <a class="code hl_function" href="metal_2kernels_2copy_8h.html#a3278d9c999718bee3ccbe2922f501bf1">copy_gg_nd1</a>(</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="metal_2kernels_2copy_8h.html#a370d7bbba1a4b0d64da873bafd29a78b"> 101</a></span>[[kernel]] <span class="keywordtype">void</span> <a class="code hl_function" href="metal_2kernels_2copy_8h.html#a370d7bbba1a4b0d64da873bafd29a78b">copy_gg_nd1</a>(</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> device <span class="keyword">const</span> T* src [[buffer(0)]],</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> device U* dst [[buffer(1)]],</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> constant <span class="keyword">const</span> int64_t& src_stride [[buffer(3)]],</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> constant <span class="keyword">const</span> int64_t& dst_stride [[buffer(4)]],</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> uint index [[thread_position_in_grid]]) {</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keyword">auto</span> src_idx = <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#ac612d0ae30b8257198339debe04916a3">elem_to_loc_1<int64_t, int></a>(index, src_stride);</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keyword">auto</span> dst_idx = <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#ac612d0ae30b8257198339debe04916a3">elem_to_loc_1<int64_t, int></a>(index, dst_stride);</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keyword">auto</span> src_idx = <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#ac612d0ae30b8257198339debe04916a3">elem_to_loc_1<int64_t, IdxT></a>(index, src_stride);</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keyword">auto</span> dst_idx = <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#ac612d0ae30b8257198339debe04916a3">elem_to_loc_1<int64_t, IdxT></a>(index, dst_stride);</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> dst[dst_idx] = <span class="keyword">static_cast<</span>U<span class="keyword">></span>(src[src_idx]);</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span>}</div>
|
||||
</div>
|
||||
@@ -283,13 +283,13 @@ $(function(){ initResizable(false); });
|
||||
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_a650f8ea8cf9f9519da9e301aad0308dc"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#a650f8ea8cf9f9519da9e301aad0308dc">elem_to_loc_3</a></div><div class="ttdeci">METAL_FUNC IdxT elem_to_loc_3(uint3 elem, constant const StrideT strides[3])</div><div class="ttdef"><b>Definition</b> utils.h:150</div></div>
|
||||
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_a66a2d7eec0262b12db16cd6c781ccf9a"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#a66a2d7eec0262b12db16cd6c781ccf9a">elem_to_loc_2_nd</a></div><div class="ttdeci">METAL_FUNC vec< IdxT, 2 > elem_to_loc_2_nd(uint3 elem, constant const int *shape, constant const StrideT *a_strides, constant const StrideT *b_strides, int ndim)</div><div class="ttdef"><b>Definition</b> utils.h:159</div></div>
|
||||
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_ac612d0ae30b8257198339debe04916a3"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#ac612d0ae30b8257198339debe04916a3">elem_to_loc_1</a></div><div class="ttdeci">METAL_FUNC IdxT elem_to_loc_1(uint elem, constant const StrideT &stride)</div><div class="ttdef"><b>Definition</b> utils.h:140</div></div>
|
||||
<div class="ttc" id="ametal_2kernels_2copy_8h_html_a3278d9c999718bee3ccbe2922f501bf1"><div class="ttname"><a href="metal_2kernels_2copy_8h.html#a3278d9c999718bee3ccbe2922f501bf1">copy_gg_nd1</a></div><div class="ttdeci">void copy_gg_nd1(device const T *src, device U *dst, constant const int64_t &src_stride, constant const int64_t &dst_stride, uint index)</div><div class="ttdef"><b>Definition</b> copy.h:101</div></div>
|
||||
<div class="ttc" id="ametal_2kernels_2copy_8h_html_a232c5c6b8386cf8ecbf4cdadb6e4176e"><div class="ttname"><a href="metal_2kernels_2copy_8h.html#a232c5c6b8386cf8ecbf4cdadb6e4176e">copy_g_nd1</a></div><div class="ttdeci">void copy_g_nd1(device const T *src, device U *dst, constant const int64_t &src_stride, uint index)</div><div class="ttdef"><b>Definition</b> copy.h:40</div></div>
|
||||
<div class="ttc" id="ametal_2kernels_2copy_8h_html_a370d7bbba1a4b0d64da873bafd29a78b"><div class="ttname"><a href="metal_2kernels_2copy_8h.html#a370d7bbba1a4b0d64da873bafd29a78b">copy_gg_nd1</a></div><div class="ttdeci">void copy_gg_nd1(device const T *src, device U *dst, constant const int64_t &src_stride, constant const int64_t &dst_stride, uint index)</div><div class="ttdef"><b>Definition</b> copy.h:101</div></div>
|
||||
<div class="ttc" id="ametal_2kernels_2copy_8h_html_a39ec5b7b8351e4332b842982a2ee6260"><div class="ttname"><a href="metal_2kernels_2copy_8h.html#a39ec5b7b8351e4332b842982a2ee6260">copy_g_nd2</a></div><div class="ttdeci">void copy_g_nd2(device const T *src, device U *dst, constant const int64_t *src_strides, uint2 index, uint2 grid_dim)</div><div class="ttdef"><b>Definition</b> copy.h:50</div></div>
|
||||
<div class="ttc" id="ametal_2kernels_2copy_8h_html_a3f3836ad0b6545ec9b9e1864224f7a13"><div class="ttname"><a href="metal_2kernels_2copy_8h.html#a3f3836ad0b6545ec9b9e1864224f7a13">copy_gg_nd3</a></div><div class="ttdeci">void copy_gg_nd3(device const T *src, device U *dst, constant const int64_t *src_strides, constant const int64_t *dst_strides, uint3 index)</div><div class="ttdef"><b>Definition</b> copy.h:125</div></div>
|
||||
<div class="ttc" id="ametal_2kernels_2copy_8h_html_a71e4103db4689d90ef6f9d5ba93604cf"><div class="ttname"><a href="metal_2kernels_2copy_8h.html#a71e4103db4689d90ef6f9d5ba93604cf">copy_g</a></div><div class="ttdeci">void copy_g(device const T *src, device U *dst, constant const int *src_shape, constant const int64_t *src_strides, constant const int &ndim, uint3 index, uint3 grid_dim)</div><div class="ttdef"><b>Definition</b> copy.h:75</div></div>
|
||||
<div class="ttc" id="ametal_2kernels_2copy_8h_html_a8023e9335cc5334847a8d315042be3a3"><div class="ttname"><a href="metal_2kernels_2copy_8h.html#a8023e9335cc5334847a8d315042be3a3">copy_s2</a></div><div class="ttdeci">void copy_s2(device const T *src, device U *dst, uint2 index, uint2 grid_dim)</div><div class="ttdef"><b>Definition</b> copy.h:20</div></div>
|
||||
<div class="ttc" id="ametal_2kernels_2copy_8h_html_aab82689380897ff4716b5eafd6ef3ecc"><div class="ttname"><a href="metal_2kernels_2copy_8h.html#aab82689380897ff4716b5eafd6ef3ecc">copy_g_nd3</a></div><div class="ttdeci">void copy_g_nd3(device const T *src, device U *dst, constant const int64_t *src_strides, uint3 index, uint3 grid_dim)</div><div class="ttdef"><b>Definition</b> copy.h:62</div></div>
|
||||
<div class="ttc" id="ametal_2kernels_2copy_8h_html_aba4530a7db6a61ca36f50e4f5e58fb77"><div class="ttname"><a href="metal_2kernels_2copy_8h.html#aba4530a7db6a61ca36f50e4f5e58fb77">copy_g_nd1</a></div><div class="ttdeci">void copy_g_nd1(device const T *src, device U *dst, constant const int64_t &src_stride, uint index)</div><div class="ttdef"><b>Definition</b> copy.h:40</div></div>
|
||||
<div class="ttc" id="ametal_2kernels_2copy_8h_html_ade9a9eea9b8262a854a11721fe2bb9fa"><div class="ttname"><a href="metal_2kernels_2copy_8h.html#ade9a9eea9b8262a854a11721fe2bb9fa">copy_gg</a></div><div class="ttdeci">void copy_gg(device const T *src, device U *dst, constant const int *src_shape, constant const int64_t *src_strides, constant const int64_t *dst_strides, constant const int &ndim, uint3 index)</div><div class="ttdef"><b>Definition</b> copy.h:137</div></div>
|
||||
<div class="ttc" id="ametal_2kernels_2copy_8h_html_ae26a13e0c8e6c15f7b10078e65970659"><div class="ttname"><a href="metal_2kernels_2copy_8h.html#ae26a13e0c8e6c15f7b10078e65970659">copy_v</a></div><div class="ttdeci">void copy_v(device const T *src, device U *dst, uint index)</div><div class="ttdef"><b>Definition</b> copy.h:12</div></div>
|
||||
<div class="ttc" id="ametal_2kernels_2copy_8h_html_aee14a5326f53d9b30b0b38e27d180ef3"><div class="ttname"><a href="metal_2kernels_2copy_8h.html#aee14a5326f53d9b30b0b38e27d180ef3">copy_v2</a></div><div class="ttdeci">void copy_v2(device const T *src, device U *dst, uint2 index, uint2 grid_dim)</div><div class="ttdef"><b>Definition</b> copy.h:30</div></div>
|
||||
|
||||
Reference in New Issue
Block a user