repo
stringlengths
1
152
file
stringlengths
14
221
code
stringlengths
501
25k
file_length
int64
501
25k
avg_line_length
float64
20
99.5
max_line_length
int64
21
134
extension_type
stringclasses
2 values
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/gavgpool-microkernel-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cmath> #include <cstddef> #include <c...
8,830
28.241722
79
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/gemm-block-sparse-microkernel-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cmath> #include <cstddef> #include <c...
15,424
29.009728
101
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/global-average-pooling-operator-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cmath> #include <cstddef> #include <cstdlib> #include <f...
7,107
26.984252
80
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/hardsigmoid-operator-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cmath> #include <cstddef> #include <c...
5,893
26.036697
84
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/hardswish-operator-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cmath> #include <cstddef> #include <c...
6,189
25.913043
82
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/leaky-relu-operator-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cmath> #include <cstddef> #include <c...
6,417
25.630705
80
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/lut-microkernel-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cstddef> #include <cstdlib> #include ...
2,195
23.131868
74
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/lut-norm-microkernel-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cstddef> #include <cstdlib> #include ...
2,580
24.81
75
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/max-pooling-operator-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cstddef> #include <cstdlib> #include ...
23,959
30.609499
80
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/maxpool-microkernel-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cstddef> #include <cstdlib> #include ...
5,852
21.774319
79
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/requantization-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <cstddef> #include <cstdlib> #include <algorithm> #include <cfloat> #include ...
14,479
29.7431
84
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/rmax-microkernel-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cstddef> #include <cstdlib> #include ...
1,549
21.463768
74
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/sigmoid-operator-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cmath> #include <cstddef> #include <c...
5,667
25.362791
80
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/softargmax-operator-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cmath> #include <cstddef> #include <c...
5,428
26.281407
79
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/tanh-operator-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cmath> #include <cstddef> #include <c...
5,581
24.962791
79
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/test_utils.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <gtest/gtest.h> namespace qnnpack { namespace testing { enum class Mode { S...
1,037
27.833333
73
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/vadd-microkernel-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cstddef> #include <cstdlib> #include ...
5,868
25.084444
75
h
null
pytorch-main/aten/src/ATen/native/quantized/cpu/qnnpack/test/zip-microkernel-tester.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <cstddef> #include <cstdlib> #include <algorithm> #include <cfloat> #include ...
2,671
23.513761
74
h
null
pytorch-main/aten/src/ATen/native/sparse/FlattenIndicesCommon.h
#pragma once #include <ATen/Tensor.h> #include <ATen/native/TensorIterator.h> #include <ATen/Dispatch.h> #include <ATen/native/sparse/Macros.h> #include <ATen/ExpandUtils.h> #include <ATen/native/SparseTensorUtils.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #...
3,349
30.308411
101
h
null
pytorch-main/aten/src/ATen/native/sparse/ParamUtils.h
#pragma once #include <ATen/core/Tensor.h> #include <ATen/TensorUtils.h> #include <tuple> namespace at { namespace native { TORCH_API std::tuple<Tensor, Tensor, int64_t> softmax_sparse_input_preprocessing( const Tensor& input_, const int64_t dim_, const bool half_to_float, CheckedFrom function_name);...
590
22.64
98
h
null
pytorch-main/aten/src/ATen/native/sparse/SparseBinaryOpIntersectionCommon.h
#pragma once #include <ATen/Tensor.h> #include <ATen/native/TensorIterator.h> #include <ATen/Dispatch.h> #include <ATen/native/sparse/Macros.h> #include <ATen/ExpandUtils.h> #include <ATen/native/SparseTensorUtils.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #...
19,963
40.333333
123
h
null
pytorch-main/aten/src/ATen/native/sparse/SparseCsrTensorMath.h
#pragma once #include <ATen/Tensor.h> #include <ATen/core/Scalar.h> #include <ATen/TensorUtils.h> #include <ATen/native/ReductionType.h> #include <ATen/native/cpu/SpmmReduceKernel.h> namespace at { namespace native { namespace sparse { namespace impl { // Returns true if all entries of self are zero // TODO: This ha...
2,383
25.197802
87
h
null
pytorch-main/aten/src/ATen/native/sparse/SparseTensorMath.h
#pragma once #include <ATen/native/SparseTensorUtils.h> namespace at { namespace native { TORCH_API sparse::SparseTensor& mul_out_sparse_scalar(sparse::SparseTensor& r, const sparse::SparseTensor& t, const Scalar& value); TORCH_API sparse::SparseTensor& mul_out_sparse_zerodim(sparse::SparseTensor& r, const sparse::S...
690
48.357143
132
h
null
pytorch-main/aten/src/ATen/native/sparse/ValidateCompressedIndicesCommon.h
#pragma once #include <ATen/Dispatch.h> #include <ATen/Tensor.h> #include <ATen/Utils.h> #include <ATen/native/TensorIterator.h> #include <ATen/native/sparse/Macros.h> #include <ATen/native/SparseTensorUtils.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include...
13,542
31.951338
97
h
null
pytorch-main/aten/src/ATen/native/sparse/cuda/SparseBlasImpl.h
#pragma once #include <ATen/SparseCsrTensorUtils.h> #include <ATen/Tensor.h> #include <ATen/core/Scalar.h> namespace at { namespace native { namespace sparse { namespace impl { namespace cuda { void addmm_out_sparse_csr( const at::sparse_csr::SparseCsrTensor& mat1, const Tensor& mat2, const Scalar& beta,...
1,249
22.148148
51
h
null
pytorch-main/aten/src/ATen/native/sparse/cuda/cutlass/default_epilogue_tensor_op_row_broadcast.h
/*************************************************************************************************** * Copyright (c) 2017 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are p...
7,731
39.910053
111
h
null
pytorch-main/aten/src/ATen/native/sparse/cuda/cutlass/default_gemm_sparse_row_broadcast.h
/*************************************************************************************************** * Copyright (c) 2017 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are p...
8,070
41.256545
110
h
null
pytorch-main/aten/src/ATen/native/sparse/cuda/cutlass/gemm_sparse_row_broadcast.h
/*************************************************************************************************** * Copyright (c) 2017 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are p...
17,267
32.530097
102
h
null
pytorch-main/aten/src/ATen/native/sparse/cuda/cutlass/sparse_gemm_row_broadcast.h
/*************************************************************************************************** * Copyright (c) 2017 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are p...
13,632
32.74505
108
h
null
pytorch-main/aten/src/ATen/native/transformers/attention.h
#pragma once #include <ATen/ATen.h> #include <c10/macros/Export.h> #include <ATen/native/DispatchStub.h> #include <ATen/native/transformers/attention.h> #include <c10/util/Optional.h> namespace at { namespace native { using fused_sdp_choice_fn = int64_t (*)(const Tensor& query_, const Tensor& key, const Tensor& value...
1,226
28.214286
112
h
null
pytorch-main/aten/src/ATen/native/transformers/sdp_utils_cpp.h
#pragma once #include <ATen/Context.h> #include <ATen/core/Tensor.h> #include <c10/core/SymFloat.h> #include <cmath> #include <cstdint> namespace sdp { constexpr int32_t num_backends = 3; enum class SDPBackend { error = -1, math = 0, flash_attention = 1, efficient_attention = 2 }; // Note that if this changed...
856
22.805556
79
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/flash_attn/fmha.h
/****************************************************************************** * Copyright (c) 2011-2021, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistrib...
7,298
32.948837
101
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/flash_attn/fmha_api.h
#pragma once #include <cstddef> #include <ATen/ATen.h> #include <c10/util/Exception.h> namespace pytorch_fmha { TORCH_API std::tuple<at::Tensor, at::Tensor, at::Tensor, at::Tensor> mha_fwd(const at::Tensor &q, // total_q x num_heads x head_size, total_q := \sum_{i=0}^{b} s_i const at::Tensor &k, ...
2,218
42.509804
102
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/flash_attn/fmha_fwd_launch_template.h
// Copyright (c) 2022, Tri Dao. #pragma once #include <vector> #include <cuda_fp16.h> #include <cuda_bf16.h> #include <ATen/cuda/CUDAContext.h> #include <ATen/native/transformers/cuda/flash_attn/fmha.h> #include <ATen/native/transformers/cuda/flash_attn/static_switch.h> #include <ATen/native/transformers/cuda/flash...
4,607
46.505155
101
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/flash_attn/fmha_kernel.h
/****************************************************************************** * Copyright (c) 2011-2021, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistrib...
3,399
41.5
100
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/flash_attn/fmha_utils.h
/****************************************************************************** * Copyright (c) 2011-2021, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistrib...
4,921
47.732673
100
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/flash_attn/gemm.h
/****************************************************************************** * Copyright (c) 2011-2021, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistrib...
18,091
38.93819
120
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/flash_attn/gmem_tile.h
/****************************************************************************** * Copyright (c) 2011-2021, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistrib...
22,937
40.32973
119
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/flash_attn/kernel_traits.h
/****************************************************************************** * Copyright (c) 2011-2021, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistrib...
6,155
49.459016
110
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/flash_attn/static_switch.h
// Inspired by https://github.com/NVIDIA/DALI/blob/main/include/dali/core/static_switch.h // and https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/Dispatch.h // and https://github.com/facebookresearch/xformers/blob/main/xformers/csrc/attention/cuda/fmha/gemm_kernel_utils.h#L8 #pragma once /// @param COND ...
1,686
40.146341
118
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/debug_utils.h
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <cfloat> #include <cstdio> #include <cmath> /////////////////////////////////...
10,254
47.601896
108
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/gemm_kernel_utils.h
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <cutlass/arch/mma.h> ///////////////////////////////////////////////////////...
8,608
39.995238
80
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/pytorch_utils.h
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <ATen/core/TensorBody.h> #include <c10/util/Exception.h> #include <cutlass/b...
2,425
25.955556
78
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/epilogue/epilogue_pipelined.h
/*************************************************************************************************** * Copyright (c) 2017 - 2023 NVIDIA CORPORATION & AFFILIATES. All rights *reserved. SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are pe...
22,387
34.256693
100
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/epilogue/epilogue_rescale_output.h
/*! \file \brief Epilogue for threadblock scoped GEMMs using Tensor Ops. The epilogue rearranges the result of a matrix product through shared memory to match canonical tensor layouts in global memory. Epilogues support conversion and reduction operations. This is a copy of cutlass/epilogue/threadblock/epil...
7,426
30.604255
97
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/epilogue/epilogue_thread_apply_logsumexp.h
/*************************************************************************************************** * Copyright (c) 2017 - 2023 NVIDIA CORPORATION & AFFILIATES. All rights *reserved. SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are pe...
6,147
33.539326
100
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/gemm/custom_mma.h
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <ATen/native/transformers/cuda/mem_eff_attention/gemm/custom_mma_multistage.h...
2,491
23.673267
87
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/gemm/custom_mma_base.h
/*************************************************************************************************** * Copyright (c) 2017 - 2023 NVIDIA CORPORATION & AFFILIATES. All rights *reserved. SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are pe...
6,241
32.923913
100
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/gemm/custom_mma_pipelined.h
/*************************************************************************************************** * Copyright (c) 2017 - 2023 NVIDIA CORPORATION & AFFILIATES. All rights *reserved. SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are pe...
14,144
34.099256
100
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/gemm/find_default_mma.h
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ /*! \file \brief Cutlass provides helper template functions to figure out the right data stru...
5,175
29.809524
80
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/gemm/mma_accum_lambda_iterator.h
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <cutlass/functional.h> #include <cutlass/gemm/warp/mma_simt_tile_iterator.h> ...
12,350
33.791549
111
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/iterators/default_warp_iterator_from_smem.h
/*************************************************************************************************** * Copyright (c) 2017 - 2023 NVIDIA CORPORATION & AFFILIATES. All rights *reserved. SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are pe...
5,827
39.472222
100
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/iterators/epilogue_predicated_tile_iterator.h
/*************************************************************************************************** * Copyright (c) 2017 - 2023 NVIDIA CORPORATION & AFFILIATES. All rights *reserved. SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are pe...
23,855
30.681275
100
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/iterators/make_residual_last.h
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <ATen/native/transformers/cuda/mem_eff_attention/iterators/predicated_tile_ac...
1,650
21.013333
116
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/iterators/transpose_warp_iterator.h
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <ATen/native/transformers/cuda/mem_eff_attention/iterators/warp_iterator_from...
961
29.0625
94
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/iterators/warp_iterator_from_smem.h
/*************************************************************************************************** * Copyright (c) 2017 - 2023 NVIDIA CORPORATION & AFFILIATES. All rights *reserved. SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are pe...
10,055
34.284211
123
h
null
pytorch-main/aten/src/ATen/native/transformers/cuda/mem_eff_attention/transform/tile_smem_loader.h
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <cutlass/cutlass.h> #include <cutlass/aligned_buffer.h> #include <cutlass/arr...
2,152
31.134328
80
h
null
pytorch-main/aten/src/ATen/native/ufunc/add.h
#pragma once #include <c10/macros/Macros.h> #if !defined(__CUDACC__) && !defined(__HIPCC__) #include <ATen/cpu/vec/functional.h> #include <ATen/cpu/vec/vec.h> #endif namespace at { namespace native { namespace ufunc { template <typename T> C10_HOST_DEVICE C10_ALWAYS_INLINE T add(T self, T other, T alpha) __ubsan_ig...
680
23.321429
126
h
null
pytorch-main/aten/src/ATen/native/utils/Factory.h
#pragma once #include <ATen/core/Tensor.h> namespace at { namespace native { namespace mobile { Tensor allocate_padded_contiguous_if_needed( const Tensor& input, c10::MemoryFormat memory_format); // TODO: Remove this function when at::native::empty() is modified to accept a // custom memory allocator. at::...
553
21.16
78
h
null
pytorch-main/aten/src/ATen/native/utils/ParamUtils.h
#pragma once #include <c10/util/ArrayRef.h> #include <vector> namespace at { namespace native { template <typename T> inline std::vector<T> _expand_param_if_needed( ArrayRef<T> list_param, const char* param_name, int64_t expected_dim) { if (list_param.size() == 1) { return std::vector<T>(expected_d...
1,188
26.651163
76
h
null
pytorch-main/aten/src/ATen/native/utils/ParamsHash.h
#pragma once #include <memory> #include <mutex> namespace at::native { // Hashing machinery for Params // Fowler–Noll–Vo hash function // see https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function template <typename Params> struct ParamsHash { // Params must be a POD because we read out its mem...
3,013
30.072165
115
h
null
pytorch-main/aten/src/ATen/native/vulkan/VulkanOpaqueTensorImpl.h
#pragma once #include <ATen/OpaqueTensorImpl.h> namespace at { // The only difference from OpaqueTensorImpl is faking strides(), stride(), // is_contiguous(). The main intention for this is to be able to run torchscript // model on Vulkan backend. Strides are not supported on Vulkan side, plan to // support them. tem...
1,405
26.568627
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/Adapter.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Common.h> #include <ATen/native/vulkan/api/Pipeline.h> #include <ATen/native/vulkan/api/Shader.h> #include <ATen/native/vulkan/api/Utils.h> #include <mutex> #include <ostream> namespace at { namespace native { namespace vulkan { namespace api { st...
5,390
23.958333
78
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/Allocator.h
#pragma once // // Do NOT include vk_mem_alloc.h directly. // Always include this file (Allocator.h) instead. // #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Common.h> #define VMA_VULKAN_VERSION 1000000 #ifdef USE_VULKAN_WRAPPER #define VMA_STATIC_VULKAN_FUNCTIONS 0 #else #define VMA_DYNAMIC_VULKAN_FUNCT...
1,338
22.491228
63
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/Command.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Common.h> #include <ATen/native/vulkan/api/Descriptor.h> #include <ATen/native/vulkan/api/Pipeline.h> #include <ATen/native/vulkan/api/Resource.h> #include <ATen/native/vulkan/api/Shader.h> #include <c10/util/ArrayRef.h> namespace at { namespace nat...
4,362
23.931429
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/Common.h
#pragma once #ifdef USE_VULKAN_API #include <c10/util/Exception.h> #include <utility> #include <ATen/native/vulkan/api/vk_api.h> /* * Check that the return code of a Vulkan API call is VK_SUCCESS, throwing an * error with the returned code if not. If STRIP_ERROR_MESSAGES is defined then * only the return code wi...
1,881
42.767442
79
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/Context.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Adapter.h> #include <ATen/native/vulkan/api/Command.h> #include <ATen/native/vulkan/api/Common.h> #include <ATen/native/vulkan/api/Descriptor.h> #include <ATen/native/vulkan/api/Pipeline.h> #include <ATen/native/vulkan/api/QueryPool.h> #include <ATen...
13,068
26.630021
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/Descriptor.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Common.h> #include <ATen/native/vulkan/api/Resource.h> #include <ATen/native/vulkan/api/Shader.h> #include <c10/util/flat_hash_map.h> namespace at { namespace native { namespace vulkan { namespace api { class DescriptorSet final { public: explic...
3,220
23.037313
71
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/Pipeline.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Common.h> #include <ATen/native/vulkan/api/Resource.h> #include <ATen/native/vulkan/api/Shader.h> #include <c10/util/SmallVector.h> #include <c10/util/flat_hash_map.h> #include <mutex> namespace at { namespace native { namespace vulkan { namespace ...
4,899
24.128205
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/QueryPool.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Adapter.h> #include <ATen/native/vulkan/api/Command.h> #include <ATen/native/vulkan/api/Common.h> #include <ATen/native/vulkan/api/Pipeline.h> namespace at { namespace native { namespace vulkan { namespace api { struct QueryPoolConfig final { uin...
3,019
24.166667
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/Resource.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Allocator.h> #include <ATen/native/vulkan/api/Utils.h> #include <c10/core/ScalarType.h> #include <c10/util/flat_hash_map.h> #include <c10/util/typeid.h> #include <stack> namespace at { namespace native { namespace vulkan { namespace api { typedef...
11,427
21.147287
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/Runtime.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Adapter.h> #include <ATen/native/vulkan/api/Common.h> namespace at { namespace native { namespace vulkan { namespace api { // // A Vulkan Runtime initializes a Vulkan instance and decouples the concept of // Vulkan instance initialization from inti...
2,667
25.156863
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/Shader.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Common.h> #include <ATen/native/vulkan/api/Types.h> #include <ATen/native/vulkan/api/Utils.h> #include <c10/util/flat_hash_map.h> #include <c10/util/hash.h> #include <mutex> namespace at { namespace native { namespace vulkan { namespace api { clas...
4,942
23.839196
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/Tensor.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Context.h> #include <c10/core/MemoryFormat.h> #include <c10/util/accumulate.h> namespace at { namespace native { namespace vulkan { struct LastAccess { api::PipelineStageFlags stage; api::MemoryAccessFlags access; LastAccess() : stage{...
8,328
25.525478
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/Utils.h
#pragma once #include <c10/util/ArrayRef.h> #include <c10/util/Half.h> // For c10::overflows #include <ATen/native/vulkan/api/Common.h> #ifdef USE_VULKAN_API namespace at { namespace native { namespace vulkan { namespace api { namespace utils { // // Alignment // template <typename Type> inline constexpr Type ali...
4,745
23.590674
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/api/api.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Common.h> #include <ATen/native/vulkan/api/Adapter.h> #include <ATen/native/vulkan/api/Command.h> #include <ATen/native/vulkan/api/Context.h> #include <ATen/native/vulkan/api/Descriptor.h> #include <ATen/native/vulkan/api/Pipeline.h> #include <ATen/...
551
28.052632
46
h
null
pytorch-main/aten/src/ATen/native/vulkan/glsl/texel_access.h
/* * Texel access utility functions */ // Broadcasting: compute input texel position from broadcasted output position ivec3 map_output_pos_to_input_pos( ivec3 output_pos, ivec4 output_sizes, ivec4 input_sizes) { ivec3 input_pos; // HW: use modulo input_pos.xy = output_pos.xy % input_sizes.xy; if ...
1,029
29.294118
78
h
null
pytorch-main/aten/src/ATen/native/vulkan/graph/Constant.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Context.h> namespace at { namespace native { namespace vulkan { /* * Represents a reference to a tensor that has been serialized with the model, * such as a serialized weight tensor. It contains some metadata as well as a * raw pointer to the da...
870
21.921053
78
h
null
pytorch-main/aten/src/ATen/native/vulkan/graph/Copy.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/graph/Graph.h> namespace at { namespace native { namespace vulkan { void add_copy_node(ComputeGraph& graph, const ValueRef from, const ValueRef to); ValueRef add_copy_node(ComputeGraph& graph, const ValueRef from); class CopyNode : public virtual OpNo...
550
20.192308
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/graph/Exception.h
#pragma once #ifdef USE_VULKAN_API #include <exception> #include <ostream> namespace at { namespace native { namespace vulkan { /* * Same as c10::SourceLocation, represents a location in source code */ struct SourceLocation { const char* func; const char* file; uint32_t line; }; std::ostream& operator<<(st...
1,567
21.4
71
h
null
pytorch-main/aten/src/ATen/native/vulkan/graph/Graph.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/Context.h> #include <ATen/native/vulkan/api/Tensor.h> #include <ATen/native/vulkan/graph/Config.h> #include <ATen/native/vulkan/graph/Exception.h> #include <ATen/native/vulkan/graph/Value.h> namespace at { namespace native { namespace vulkan { typ...
4,142
23.957831
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/graph/Staging.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/graph/Graph.h> namespace at { namespace native { namespace vulkan { // // Functions to memcpy data into staging buffer // void memcpy_to_mapping( const void* src, api::MemoryMap& dst_mapping, const size_t nbytes, const c10::ScalarType ...
1,901
20.370787
74
h
null
pytorch-main/aten/src/ATen/native/vulkan/impl/Common.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/api/api.h> #include <ATen/native/vulkan/impl/Registry.h> #define VK_KERNEL(shader_name) \ ::at::native::vulkan::get_shader_info(#shader_name) #define VK_LOOKUP_KERNEL(op_name) \ ::at::native::vulkan::look_up_shader_info(#op_name) namespace at { nam...
2,341
26.232558
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/impl/Packing.h
#include <ATen/native/vulkan/api/api.h> namespace at { namespace native { namespace vulkan { namespace packing { api::ShaderInfo get_nchw_to_image_shader(const vTensor& v_dst); api::ShaderInfo get_image_to_nchw_shader(const vTensor& v_src); void record_nchw_to_image_op( api::Context* const context, api::Shad...
1,185
25.355556
63
h
null
pytorch-main/aten/src/ATen/native/vulkan/ops/Batchnorm.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/ops/Common.h> #include <ATen/native/vulkan/ops/VulkanPackedContext.h> #include <torch/library.h> namespace at { namespace native { namespace vulkan { namespace ops { class BatchNormPackedContext final : virtual public VulkanPackedContext, ...
1,867
26.072464
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/ops/Common.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/core/List.h> #include <ATen/core/Tensor.h> #include <ATen/native/vulkan/api/api.h> #include <ATen/native/vulkan/impl/Common.h> #include <ATen/native/vulkan/ops/Convert.h> #define VK_KERNEL(shader_name) \ ::at::native::vulkan::get_shader_info(#shader_name) #define V...
2,620
26.589474
77
h
null
pytorch-main/aten/src/ATen/native/vulkan/ops/Convert.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/VulkanOpaqueTensorImpl.h> #include <ATen/native/vulkan/api/Tensor.h> #include <c10/util/accumulate.h> namespace at { namespace native { namespace vulkan { namespace ops { using vTensorImpl = VulkanOpaqueTensorImpl<vTensor>; inline Tensor convert(const...
1,294
23.903846
71
h
null
pytorch-main/aten/src/ATen/native/vulkan/ops/Convolution.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/ops/Common.h> #include <ATen/native/vulkan/ops/VulkanPackedContext.h> namespace at { namespace native { namespace vulkan { namespace ops { enum Conv2dMethod { Conv2dDepthwise, Conv2dPointwise, Conv2dSlidingWindow, }; namespace conv2d { Tensor r...
6,555
28.00885
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/ops/Copy.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/ops/Common.h> namespace at { namespace native { namespace vulkan { namespace ops { void transfer_cpu_to_vulkan(const Tensor&, vTensor&); void transfer_vulkan_to_cpu(vTensor&, Tensor&); void pack_cpu_to_vulkan(const Tensor& src, vTensor& dst); void p...
2,068
24.8625
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/ops/Factory.h
#include <ATen/native/vulkan/ops/Common.h> namespace at { namespace native { namespace vulkan { namespace ops { Tensor _empty_affine_quantized( const IntArrayRef sizes, const c10::optional<ScalarType> dtype, const c10::optional<c10::Layout> layout, const c10::optional<Device> device, const c10::op...
530
23.136364
48
h
null
pytorch-main/aten/src/ATen/native/vulkan/ops/Gru.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/ops/Common.h> #include <ATen/native/vulkan/ops/VulkanPackedContext.h> #include <torch/library.h> namespace at { namespace native { namespace vulkan { namespace ops { class GruPackedContext final : virtual public VulkanPackedContext, ...
2,176
25.876543
69
h
null
pytorch-main/aten/src/ATen/native/vulkan/ops/Lstm.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/ops/Common.h> #include <ATen/native/vulkan/ops/VulkanPackedContext.h> #include <torch/library.h> namespace at { namespace native { namespace vulkan { namespace ops { class LstmPackedContext final : virtual public VulkanPackedContext, ...
2,308
27.158537
70
h
null
pytorch-main/aten/src/ATen/native/vulkan/ops/Mm.h
#pragma once #ifdef USE_VULKAN_API #include <ATen/native/vulkan/ops/Common.h> #include <ATen/native/vulkan/ops/VulkanPackedContext.h> #include <torch/library.h> namespace at { namespace native { namespace vulkan { namespace ops { class LinearPackedContext final : virtual public VulkanPackedContext, ...
1,635
23.41791
80
h
null
pytorch-main/aten/src/ATen/native/vulkan/ops/QuantizedFunctions.h
#include <ATen/native/vulkan/ops/Common.h> namespace at { namespace native { namespace vulkan { namespace ops { Tensor quantize_per_tensor( const at::Tensor& input_arg, const double scale, const int64_t zero_point, const c10::ScalarType dtype); Tensor dequantize_helper( const at::Tensor& input_ar...
1,528
21.820896
42
h
null
pytorch-main/aten/src/ATen/native/xnnpack/Common.h
#pragma once #ifdef USE_XNNPACK #include <xnnpack.h> #include <caffe2/utils/threadpool/pthreadpool-cpp.h> #include <c10/util/ArrayRef.h> #include <limits> #include <memory> namespace at::native::xnnpack { struct Deleter final { void operator()(const xnn_operator_t op) const { xnn_delete_operator(op); } }; ...
3,436
25.643411
100
h
null
pytorch-main/aten/src/ATen/native/xnnpack/Convolution.h
#pragma once #ifdef USE_XNNPACK #include <ATen/Tensor.h> #include <ATen/native/xnnpack/Common.h> #include <ATen/native/xnnpack/OpContext.h> namespace at::native::xnnpack { namespace internal::convolution2d { c10::intrusive_ptr<xnnpack::Conv2dOpContext> createConv2dClampPrePackOpContext( Tensor weight, ...
2,062
27.260274
77
h
null
pytorch-main/aten/src/ATen/native/xnnpack/Linear.h
#pragma once #ifdef USE_XNNPACK #include <ATen/Tensor.h> #include <ATen/native/xnnpack/Common.h> #include <ATen/native/xnnpack/OpContext.h> namespace at::native::xnnpack { namespace internal::linear { c10::intrusive_ptr<xnnpack::LinearOpContext> createLinearClampPrePackOpContext( Tensor weight, c10::optiona...
1,088
23.2
109
h
null
pytorch-main/aten/src/ATen/native/xnnpack/OpContext.h
#pragma once #ifdef USE_XNNPACK #include <ATen/core/ivalue.h> #include <ATen/native/xnnpack/Common.h> #include <ATen/Tensor.h> namespace at::native::xnnpack { using SerializationTypeLinearPrePack = std::tuple< Tensor, c10::optional<Tensor>, c10::optional<Scalar>, c10::optional<Scalar>>; using Serial...
7,270
28.200803
90
h
null
pytorch-main/aten/src/ATen/native/xnnpack/Pooling.h
#pragma once #ifdef USE_XNNPACK #include <ATen/Tensor.h> namespace at::native::xnnpack::internal::pooling { struct Parameters final { std::array<int64_t, 2> kernel; std::array<int64_t, 2> padding; std::array<int64_t, 2> stride; std::array<int64_t, 2> dilation; explicit Parameters( const IntArrayRe...
1,004
22.372093
81
h
null
pytorch-main/aten/src/ATen/nnapi/NeuralNetworks.h
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
2,757
31.447059
75
h