sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
a58a8fecf101c8c7bac670bae43a90a81c1e9948666e6eebe43c3acd277c9618
C/C++
21,847
467
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com> // Copyright (C) 2008-2011 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0...
9540431329afe04f05815d6b183f42ca533566f41f555007224f6a3c84ebf949
C/C++
21,856
619
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2006-2009 Benoit Jacob <jacob.benoit.1@gmail.com> // Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If ...
2e8a5d5c0331c3edd1484bf83f99fa11a8884e647e8c1f6c23268167fa2b843d
C/C++
22,123
510
/*************************************************************************************************** * 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...
2cfa6060e85a25039a696d214b9705a77a9f43f508e4f4295018bb024e5e7723
C/C++
22,241
486
// Rank-1 GEMV kernels (M==1 xor N==1): gemv_t (output along matrix columns, // simdgroups split K), gemv_t2d (gemv_t with a 2D lane layout and 16-byte // loads) and gemv_nt (one simdgroup per output row), each instantiated over // the MB_GEMV_* config matrix for float/half/bfloat. #pragma once template <typename DT, ...
a795c35b2c8bd150c332fa659eabbea5c89345593c4daa6ba0da99c0a5a9ed05
C/C++
22,323
502
// Copyright © 2022 Apple Inc. #pragma once #include <ATen/mps/MPSAllocatorInterface.h> #include <ATen/mps/MPSEvent.h> #include <ATen/mps/MPSStream.h> #include <c10/util/flat_hash_map.h> #include <mach/vm_page_size.h> #include <cstdio> #include <functional> #include <mutex> #include <set> #include <unordered_set> ...
741d7983ad14dd91cce75fccc489c7bfbdd3f4517316d3b030fbeb1019c5bfdd
C/C++
22,369
715
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #include <ATen/cuda/CUDAContext.h> #include <ATen/cuda/CUDADataType.h> #include <ATen/cuda/tunable/TunableOp.h> #include <ATen/cuda/tunable/GemmCommon.h> #include <c10/cuda/CUDACachingAllocator.h> #include <c1...
cfc43687020305553475aafa44461c8599d5f8386c2e3a4c60e16509ad75f771
C/C++
22,395
590
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2006-2009 Benoit Jacob <jacob.benoit.1@gmail.com> // Copyright (C) 2010-2013 Hauke Heibel <hauke.heibel@gmail.com> // // This Source Code Form is ...
722a98419e8c81a5ccbd4a1e4f2e2318dc90e833abb0f3a84b205e5eeeb8b263
C/C++
22,398
492
// topk / kthvalue kernels: reuse the sort load/sort/scatter bodies // (SortMerge.h, SortRadix.h) and only change the writeback to emit sorted ranks // [offset, offset+count) as out[row*count + (rank-offset)]. topk = {0, k}; // kthvalue = the count==1 case {k-1, 1}. #pragma once #include <ATen/native/mps/kernels/SortMe...
7b3cf8a21c2d4adfa06d97831a468f20cb2a276614303814639bd2d2ef82badc
C/C++
22,502
576
#pragma once #include <ATen/cpu/vec/intrinsics.h> #include <ATen/cpu/vec/vec_base.h> #include <c10/macros/Macros.h> #include <cstdint> #if defined(__clang__) typedef __vector __bool char vbool8; typedef __vector __bool short vbool16; typedef __vector __bool int vbool32; typedef __vector __bool long long vbool64; using...
cf587cfe8119f0e0a494c9590a9286c0af86deccf9e2b29da490ed25204f5f16
C/C++
22,513
942
/*************************************************************************** * * Author: "Jasenko Zivanov" * C-CINA Basel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version ...
89ed17c66d3a6c636d292bbb5adf637fdfb092622f4d0a9e1c0a610093b1b6e1
C/C++
22,538
561
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2010 Jitse Niesen <jitse@maths.leeds.ac.uk> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy...
7134912f1397a90e451787b3c3bdfff126737b059b8c9a60927ef1b566ac6770
C/C++
22,615
559
#pragma once #if defined(__METAL_VERSION__) #include <c10/metal/special_math.h> #include <c10/metal/utils.h> #include <metal_stdlib> #else #include <array> #include <ATen/native/Math.h> #include <c10/macros/Macros.h> #include <c10/util/MathConstants.h> #endif // ROCm hip compiler doesn't work well with using std:: in...
5c3030bb154af6bcfad9adfa185f17863bc9306809fed7a28f947604bf8b416e
C/C++
22,619
488
// SDPA decode kernels (short Q sequence). Three variants: // sdpa_vector - one-pass, for short qL with moderate kL // sdpa_vector_2pass_1 - two-pass pass 1, splits the K loop across blocks // sdpa_vector_2pass_2 - two-pass pass 2, aggregates per-block partials // // Adapted from MLX: // https:...
7a40235dcc3d2a4d4c6ee260ef9a1dda3d4e65375f9d817d5d6a0a553c96c787
C/C++
22,798
828
/* Portions of this code are under: Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. */ #ifndef HIP_BP_KERNELS_H_ #define HIP_BP_KERNELS_H_ #include <hip/hip_runtime.h> #include <vector> #include <iostream> #include <fstream> #include "src/acc/acc_projector.h" #include "src/acc/acc_backprojector...
d4bbd5bb3fcc6280ab5033edeece4d10c88813333f88d5128c635f5b5d7d28c9
C/C++
22,883
488
// This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // This program is distributed in the hope that it will be use...
a29d6c453c76023b502c92d00dda49712f7cdfbaff159f2ba39dff7902b2c220
C/C++
23,262
641
/*! * Copyright (c) 2017 - by Contributors * \file dlpack.h * \brief The common header of DLPack. */ #ifndef DLPACK_DLPACK_H_ #define DLPACK_DLPACK_H_ /** * \brief Compatibility with C++ */ #ifdef __cplusplus #define DLPACK_EXTERN_C extern "C" #else #define DLPACK_EXTERN_C #endif /*! \brief The current major ...
f85f043e8e6e1997de8de87ad38299caacd227ba7d62c8848ff32a031de501ef
C/C++
23,569
545
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2010 Benoit Jacob <jacob.benoit.1@gmail.com> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a cop...
3395df0d6e2d9bc016adc67e86f33ddc80047f9bdf49954889dffdd1d6a83824
C/C++
23,573
683
#pragma once #include <ATen/cpu/vec/intrinsics.h> #include <ATen/cpu/vec/sve/sve_helper.h> #include <ATen/cpu/vec/sve/vec_common_sve.h> #include <ATen/cpu/vec/sve/vec_float.h> #include <ATen/cpu/vec/vec_base.h> #include <c10/util/bit_cast.h> #include <algorithm> #include <cmath> namespace at { namespace vec { // Note...
99b224e6e250ac1739e0bd19901af606545d51328b7801df98dcc413d0485981
C/C++
23,843
654
#pragma once // DO NOT DEFINE STATIC DATA IN THIS HEADER! // See Note [Do not compile initializers with AVX] #include <ATen/cpu/vec/intrinsics.h> #include <ATen/cpu/vec/vec_base.h> #include <c10/util/complex.h> #include <c10/util/irange.h> #include <torch/headeronly/util/Exception.h> #if defined(CPU_CAPABILITY_AVX512...
2fda351afd76824cb80716a101bebe1110e265686735b472c041e6406304da5b
C/C++
23,959
757
/* * 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 ...
70fad59780019d76cccf7e3c00d0d17795b3af6b5769de9a671c07115b7732b7
C/C++
24,079
688
#pragma once #include <c10/util/StringUtil.h> #include <c10/util/irange.h> #include <ATen/core/jit_type.h> #include <ATen/core/symbol.h> #include <ATen/core/ivalue.h> #include <ATen/core/alias_info.h> #include <ATen/core/operator_name.h> #include <ATen/core/dispatch/OperatorOptions.h> #include <string_view> #include <...
7b451c3bd47c06e0f8b0f1a2ced1b5fa7f206d71a2de0d7669317bbccf504b2b
C/C++
24,118
567
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2014 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You c...
054777e01d32977ee6348ab9e56b141336db7ebb13e6a39f75e29764ff230ea1
C/C++
24,184
697
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2012 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You c...
d5d0a71a3bd2079229090127d8f2030bcaa0d5a43a2bb10f930e1d712f878f1a
C/C++
24,191
619
// Copyright 2008 Google Inc. // All Rights Reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions a...
128f8d879d3f48b573b035a8d81c381eb699895a7785c2d933e62e74d3b04746
C/C++
24,220
685
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can ...
0acba3cbd3b4b5898beac248e081592875d8a73283e6111cff1d5a736100140c
C/C++
24,280
563
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com> // Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0...
8a3519fb3b99bb3e06655d8618a04b5ba66fe1b9b9ea571805ff555ae52b896a
C/C++
24,292
655
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2007 Julien Pommier // Copyright (C) 2014 Pedro Gonnet (pedro.gonnet@gmail.com) // Copyright (C) 2009-2019 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mo...
7e420baf2989be79b3e6c939796cda55e34ee6ffcaa09c17e33bb0a7525f0d7f
C/C++
24,379
771
#pragma once #include <ATen/cpu/vec/intrinsics.h> #include <ATen/cpu/vec/vec256/vsx/vsx_helpers.h> #include <ATen/cpu/vec/vec_base.h> #include <c10/util/complex.h> #include <c10/util/irange.h> namespace at { namespace vec { // See Note [CPU_CAPABILITY namespace] inline namespace CPU_CAPABILITY { using ComplexFlt = c1...
f903241cbb246436cc2b4c8273d4c8c18708614081d4ea39f5d899e894afe3dc
C/C++
24,405
689
// LSD radix sort kernels for MPS (Path 3 in Sort.mm). // // One full pass over an RBITS-bit digit = three kernels: // radix_count : per-block digit histograms (rows x digits x n_blocks). // radix_scan : exclusive scan over the histogram to get global offsets. // May be skipped if radix_scatt...
8d08017dac220c0c2120f37b613ab3774d482bb3928eeaeaab0f1c6bc6f8725c
C/C++
24,638
568
// Merge-sort kernels for MPS. Two paths: // Path 1 - single-block: one threadgroup per row, used when the segment // fits in threadgroup memory. // Path 2 - multi-block: segment split into ELEMS_PER_TG-sized blocks, // each block sorted independently, then log2(n_blocks) passes // ...
c36f50cac400cf2d60c986baee10b5acac7bdf80553e83db51b1ab107d5a7463
C/C++
24,720
760
// This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // This program is distributed in the hope that it will be use...
b62f1b965956580dda17c7ae7904dbe74157f68a096da16f4d618d0527575bb9
C/C++
24,837
688
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2011 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2009 Keir Mierle <mierle@gmail.com> // Copyright (C) 2009 Benoit Jacob <jacob.benoit.1@gmail.com> // Copyright (C) 2011 Timothy E. Holy <tim....
c1dbf1dd31e02eb7d6820a3a8ac4ecf8552bd85c54391f3455deef7d7674f50b
C/C++
24,874
378
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2018 Rasmus Munk Larsen <rmlarsen@google.com> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obta...
ab175281f9aece23987ee057eccc99b68d26898773565e4d4ca40ff382c9a50f
C/C++
25,154
694
#pragma once // DO NOT DEFINE STATIC DATA IN THIS HEADER! // See Note [Do not compile initializers with AVX] #include <ATen/cpu/vec/intrinsics.h> #include <ATen/cpu/vec/vec_base.h> #if (defined(CPU_CAPABILITY_AVX512)) #define SLEEF_STATIC_LIBS #include <sleef.h> #endif namespace at::vec { // See Note [CPU_CAPABILITY...
57e69d5dc1fd543983a55fe17dda7cac21cf6d212eb58620690be37f5ffb1702
C/C++
25,411
647
#pragma once // DO NOT DEFINE STATIC DATA IN THIS HEADER! // See Note [Do not compile initializers with AVX] #include <ATen/cpu/vec/vec.h> namespace at::vec { // BFloat16 specification template <typename scalar_t> struct VecScalarType { using type = scalar_t; }; template <> struct VecScalarType<BFloat16> { using...
0639fb62ca7354511e985cab7270ca7d3aab79131f11e745522b28f643d1d2d4
C/C++
25,434
722
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2014 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You c...
bad7155bd03d7aca5b5bcd22c65b4ebbe68022b3bff131a1058dde9fac4c8b5d
C/C++
25,504
599
/*************************************************************************************************** * 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...
c152a2ed07e510ac5b29aad82f7eb719a58dbfcfe3884170bc934d6982d2af5b
C/C++
25,578
728
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2015 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0...
a5682db9db68d90127941d4f2dcf2ee5acdd8ca14c096be611432b13e3091fe7
C/C++
25,715
656
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2009-2014 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You c...
51d8b433aa972dbe66e6e03e49a4012e329faba860874a617b016a1243949831
C/C++
26,175
679
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2010 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2010 Konstantinos Margaritis <markos@freevec.org> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If ...
12e78dd12fe753767ceb6fb01d770e07c20c10b19e1f5c367c012ad67296ca0b
C/C++
26,606
757
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. // // The conversion routin...
0f3d8825cb1cc3cd08e7cec4a03e05a92bb62ebf7daec5c216020396ec3c56ef
C/C++
26,679
717
#pragma once // DO NOT DEFINE STATIC DATA IN THIS HEADER! // See Note [Do not compile initializers with AVX] #include <ATen/cpu/vec/vec128/vec128_float_neon.h> #include <ATen/cpu/vec/vec128/vec128_reduced_precision_common_neon.h> #include <ATen/cpu/vec/vec_base.h> #include <c10/util/BFloat16.h> #include <c10/util/bit_...
76a70960a8431fc7191466ecf01ec0b553dd5929bbc0b1edac43fa429345a033
C/C++
26,980
503
/*****************************************************************************/ /* module: NEUROHDR written by: Henning Nordholz */ /* date: 16-Aug-93 last update: */ /* project: */ ...
23b339db77f8aa0ce23221d22ce479d4efbdcad92884125c2c641d5c69a2e530
C/C++
27,133
831
/* * 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...
c24e49d3dc99139212c95ae4fe1aa463690cf9b6565f3c7e2681204245790fe0
C/C++
27,174
656
#pragma once #include <c10/core/ScalarType.h> #include <c10/util/irange.h> #include <c10/util/Exception.h> #include <c10/util/strides.h> #include <ATen/core/Tensor.h> #include <ATen/ExpandUtils.h> #include <ATen/TensorUtils.h> #include <ATen/native/TensorIterator.h> #include <ATen/native/TransposeType.h> #include <lim...
2d9957ba8a734c0b6c787cf8331991ba0c462a37898ebf850a51655060e2e5f8
C/C++
27,485
533
#pragma once #include "imgui.h" // Handy function that handles negative values as in Python int64_t modulus_int64(int64_t a, int64_t b) { return ((a % b) + b) % b; } // ==================================================================================================================== // Procedure to sample vox...
154f102497a49e964842312bb4cffe83e64b278af59eec799789a6ff53a1c154
C/C++
27,497
771
#pragma once #include <ATen/BlasBackend.h> #include <ATen/CPUGeneratorImpl.h> #include <ATen/DeviceAccelerator.h> #include <ATen/LinalgBackend.h> #include <ATen/ROCmFABackend.h> #include <ATen/SDPBackend.h> #include <ATen/core/ATenGeneral.h> #include <ATen/core/DeprecatedTypeProperties.h> #include <ATen/core/Generator...
5b20251d7d399135d4bf32bbb3cdbe7ecbfb9da2f5b1cc34e0fb6f05f4316232
C/C++
27,601
822
/* * 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...
6c90ef81cbc77d1b75a6fc417a6d57e6c9f783e48350488f2b1e139fcbf6fe02
C/C++
27,769
670
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Mehdi Goli Codeplay Software Ltd. // Ralph Potter Codeplay Software Ltd. // Luke Iwanski Codeplay Software Ltd. // Contact: <eigen@codeplay.com> // // This Source Code Form is subject to the terms of the Mozilla // Publi...
e92314d33e8a2221afca9f548b06912eac0f8450a250d9ae782c5d77eecb7294
C/C++
27,817
869
#pragma once // DO NOT DEFINE STATIC DATA IN THIS HEADER! // See Note [Do not compile initializers with AVX] #include <ATen/cpu/vec/intrinsics.h> #include <ATen/cpu/vec/vec_base.h> #include <c10/util/irange.h> #if defined(__aarch64__) && defined(AT_BUILD_ARM_VEC256_WITH_SLEEF) #include <sleef.h> #endif #if defined(...
f752bcbe40e331290dac6db22b6bae99ac29472a5784256942324b0a0626f4fb
C/C++
27,954
773
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2012 Désiré Nuentsa-Wakam <desire.nuentsa_wakam@inria.fr> // Copyright (C) 2012-2014 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public Licens...
d65e965cb41eba3335e07766d84c85aa87ebc8dd592be80ec2ce6ae7beaacae5
C/C++
28,043
998
#ifndef ACC_UTILITIES_IMPL_H_ #define ACC_UTILITIES_IMPL_H_ #include "src/acc/acc_ptr.h" #include "src/acc/data_types.h" #include "src/acc/acc_helper_functions.h" #ifdef _CUDA_ENABLED #include "src/acc/cuda/cuda_kernels/helper.cuh" #include "src/acc/cuda/cuda_kernels/wavg.cuh" #include "src/acc/cuda/cuda_kernels/diff2...
378d8942feee5fc8549f1a9bee19b3615c994da85029e6730c08729c3993bf02
C/C++
28,223
1,012
// This file was GENERATED by command: // pump.py gtest-tuple.h.pump // DO NOT EDIT BY HAND!!! // Copyright 2009 Google Inc. // All Rights Reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // *...
aac49f9d12a19e4153f0625c08eb30fdef685ac416bfff56146d57584d054c4d
C/C++
28,283
776
/* * 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 <qnnpack/math.h> #include <stdint.h> // Legend: // dq: Design-time Quantizati...
6ed47f6ae08c914f76ff437a2ea181a01f66559b5323ba3f8ac12693d5af1b7e
C/C++
28,822
515
#pragma once #include <ATen/cpu/vec/intrinsics.h> #include <ATen/cpu/vec/sve/sve_helper.h> #include <ATen/cpu/vec/vec_base.h> namespace at::vec { // Note [CPU_CAPABILITY namespace] // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // This header, and all of its subheaders, will be compiled with // different a...
4c86d0c592d09d5ff7aec80f033ae46eba921c59cb5104f551845f72943593c8
C/C++
28,840
837
#pragma once // DO NOT DEFINE STATIC DATA IN THIS HEADER! // See Note [Do not compile initializers with AVX] // Used for shared functions and classes for vec256_bfloat16.h and // vec256_half.h. Any functions/classes that are common between those two files // should be defined here. Any non-shared functions/classes sh...
03222bf99772f02aa2fb8dd346923880b9b5d561faaa3ef40e3490d092e33de7
C/C++
28,846
598
#pragma once /** * Include this file if you want to register operators. It includes all * functionality needed to do so for you. */ #include <c10/core/DispatchKey.h> #include <c10/core/DispatchKeySet.h> #include <c10/core/CompileTimeFunctionPointer.h> #include <ATen/core/boxing/KernelFunction.h> #include <ATen/cor...
587e449acbffac9d696f5fd82e8f47753b4f066f384f67c0c6d289291207926e
C/C++
29,328
697
#pragma once #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/Dispatch_v2.h> #include <ATen/ExpandBase.h> #include <ATen/OpMathType.h> #include <ATen/native/TensorIterator.h> #include <ATen/native/cuda/Loops.cuh> #include <c10/util/Half.h> #include <ATen/cuda/CUDAApplyUtils.cuh> #include <ATe...
ad93d6d82b1bcb5e86d55863eef13b90007571046c2b038be524ff3026a57b85
C/C++
29,331
904
#pragma once #include <ATen/ExpandUtils.h> #include <ATen/ScalarOps.h> #include <ATen/core/Tensor.h> #include <ATen/core/TensorBody.h> #include <c10/core/SymInt.h> #include <c10/util/irange.h> #include <optional> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #incl...
db34495b37341c87ae874bdded2946a68234b86ee5ffc9fd782216500088d094
C/C++
29,568
1,038
/* Portions of this code are under: Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. */ #ifndef HIP_HELPER_KERNELS_H_ #define HIP_HELPER_KERNELS_H_ #include <hip/hip_runtime.h> #include <hiprand/hiprand.h> #include <hiprand/hiprand_kernel.h> #include <vector> #include <iostream> #include <fstrea...
cbb3e06a833ad6cbd6a63b2c8358b9a7b59bc4866278596a9956e65c02634131
C/C++
29,839
915
#pragma once // DO NOT DEFINE STATIC DATA IN THIS HEADER! // See Note [Do not compile initializers with AVX] #include <ATen/cpu/vec/intrinsics.h> #include <ATen/cpu/vec/vec_base.h> #include <c10/util/irange.h> #include <limits> #if defined(CPU_CAPABILITY_AVX2) #define SLEEF_STATIC_LIBS #include <sleef.h> #endif name...
531e9a140391dcec7a487e0f31c74d0c787729d8025a676371c9038cdd9390e0
C/C++
29,919
661
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2007-2010 Benoit Jacob <jacob.benoit.1@gmail.com> // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0...
67b8c63398c9a14ad26af7ddfb1078d8417a8c5be727ac1585623b8702429f8c
C/C++
30,235
884
// Original TunableOp is from onnxruntime. // https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/core/framework/tunable.h // https://github.com/microsoft/onnxruntime/tree/main/onnxruntime/core/providers/cuda/tunable // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. // // Adapting Tu...
fea544743b83a48eb3dea9f717dab96af95218e85211f7646d86bdfc587ae773
C/C++
30,236
778
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If ...
7ab1797690b2aaa86f1433a051258c3adf7db67bd1469cd1bb0037af8473d1fc
C/C++
30,291
902
#pragma once #include <ATen/cpu/vec/intrinsics.h> #include <ATen/cpu/vec/sve/sve_helper.h> #include <ATen/cpu/vec/vec_base.h> #include <cmath> #if defined(__aarch64__) && defined(AT_BUILD_ARM_VEC256_WITH_SLEEF) #include <sleef.h> #define USE_SLEEF(sleef_code, non_sleef_code) sleef_code #else #define USE_SLEEF(sleef_co...
3c52f33d13f4d39d30adea35d4a35be390163fcb08e34c8590ea066430cd066e
C/C++
31,058
1,093
#ifndef HELPER_GPU_KERNELS_H_ #define HELPER_GPU_KERNELS_H_ #include <vector> #include <iostream> #include <fstream> #include <iomanip> #include <cmath> #include <tuple> #include <cassert> #include <sycl/sycl.hpp> #ifdef USE_ONEDPL // Needs oneDPL (https://github.com/oneapi-src/oneDPL) #include <oneapi/dpl/algorithm>...
983ad443e47ac99744a586804acd0635e4e2fdfee1304234df35a8b3a3f74cb4
C/C++
31,609
855
// Copyright 2007, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions ...
5484d865c52497fbc7e74f72a9607a9a25f850b0481d6a6b9e38f422ed1b1ce9
C/C++
31,709
1,317
/*************************************************************************** * * Author: "Sjors H.W. Scheres" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...
b7d81c61d04db2e9bf6d5d093270000c5b67be554c12fcb6a08a43c7c5e1587e
C/C++
31,719
1,024
#pragma once #ifndef USE_ROCM #include <ATen/cuda/CUDAContextLight.h> #include <ATen/cuda/CUDADataType.h> #include <ATen/cuda/detail/BLASConstants.h> #include <ATen/cuda/detail/CublasLtUtils.h> #include <ATen/cuda/Exceptions.h> #include <ATen/cuda/tunable/GemmCommon.h> #include <ATen/cuda/tunable/TunableOp.h> #includ...
9acc65db0ffbeae8f6834ba8fe5730017f52022e09452d749cbfedb45e291bee
C/C++
32,135
794
#pragma once #include <ATen/cpu/vec/intrinsics.h> #include <ATen/cpu/vec/vec_base.h> #include <c10/macros/Macros.h> #include <c10/util/irange.h> namespace at::vec { // Note [CPU_CAPABILITY namespace] // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // This header, and all of its subheaders, will be compiled ...
875e95e540088684e120d6e6432cf13ce906c145c95db751047837de001b41a5
C/C++
32,306
802
#pragma once #include <ATen/core/IListRef.h> #include <ATen/core/boxing/OperatorKernel.h> #include <ATen/core/ivalue.h> #include <ATen/core/stack.h> #include <c10/util/Metaprogramming.h> #include <c10/util/TypeList.h> #include <c10/util/intrusive_ptr.h> #include <utility> namespace c10 { using Stack = torch::jit::S...
4fc5a6cba73b61327de880937bc88769e91507ea78f04d535f742013457ddbaa
C/C++
32,313
875
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2006-2009 Benoit Jacob <jacob.benoit.1@gmail.com> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can ...
54488d819eeb3fa553c66e2826268e8630b22c54b837157c8c7561dc348ff35a
C/C++
32,400
745
/* * C library of Limited memory BFGS (L-BFGS). * * Copyright (c) 1990, Jorge Nocedal * Copyright (c) 2007-2010 Naoaki Okazaki * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to d...
643960800e998342f8574da43895eade1b8157f6f5045879fa224be771041850
C/C++
32,620
1,015
#pragma once // DO NOT DEFINE STATIC DATA IN THIS HEADER! // See Note [Do not compile initializers with AVX] #include <ATen/cpu/vec/intrinsics.h> #include <ATen/cpu/vec/vec_base.h> #include <c10/util/irange.h> #include <limits> #if defined(CPU_CAPABILITY_AVX512) #define SLEEF_STATIC_LIBS #include <sleef.h> #endif n...
901c59d63ec08289f38afc15476ba455024c362936d325d1043243c90e9f61b6
C/C++
32,993
805
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2009-2010 Benoit Jacob <jacob.benoit.1@gmail.com> // Copyright (C) 2013-2014 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0...
b4a63dcbeec441a7224c1ecd7e3cc77acb320a09729a6ec57333daad66575127
C/C++
33,010
922
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You c...
7f2111f3e461a53182c10b17e93a3324f162e9030deb0b7b5bc483213b52c989
C/C++
33,312
847
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2009 Mathieu Gautier <mathieu.gautier@cea.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If...
1a4a601e94a65c8e2b1e20c85ff4db8b2e8ec5257923a1d5efc0609176b730dc
C/C++
33,327
793
#pragma once #include <ATen/cuda/CUDAContext.h> #if (defined(CUDART_VERSION) && defined(CUSOLVER_VERSION) && CUSOLVER_VERSION >= 11000) || \ (defined(USE_ROCM) && ROCM_VERSION >= 71400) // cuSOLVER version >= 11000 / ROCm >= 7.14 includes 64-bit API #define USE_CUSOLVER_64_BIT #endif #if (defined(CUDART_VERSION)...
3d287a37c043b0fa5caa0130978a506705ac14a9e0c440379c3e7f189c2ff245
C/C++
33,594
1,349
#ifndef MODULAR_ALIGNMENT_H #define MODULAR_ALIGNMENT_H #include <src/jaz/optimization/optimization.h> #include <src/jaz/image/buffered_image.h> #include <src/jaz/tomography/particle_set.h> #include <src/jaz/mesh/mesh_builder.h> #include <src/jaz/util/log.h> #include <src/jaz/tomography/motion/trajectory.h> #include <...
68d40441b9164f592ff3f765016fcbfe7f5fab0ebcbe2bd1334a7ef6329958e0
C/C++
33,635
764
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2019 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0...
c22550a849ca0a0604cf2e1659a41e711589753efd6fbefb4b5ab83db61da186
C/C++
33,949
879
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2010 Jitse Niesen <jitse@maths.leeds.ac.uk> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a...
b54d92727ad610ffdac1bd14e22ae81990470999853f32c3947dca02a6062627
C/C++
34,163
1,031
// Flash-attention prefill kernel for MPS. // Adapted from kernels-community/metal-flash-sdpa, which is itself // adapted from MLX. // Uses simdgroup-matrix MMA for high throughput; supports causal mask, // optional additive/bool mask, GQA/MQA and softcapping. // Operates on PyTorch's dense [B, H, L, D] layout via per-...
cd4b0f2a6ff0da4e7d568ad373834c56019c701c89d9456654c998533a72c097
C/C++
34,346
1,027
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2015 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You c...
b5fb2f11a3b6b0e481d733f84acf713b8c88e0264ccacf7ea6a6782db266f923
C/C++
34,484
1,125
/*************************************************************************** * * Author: "Sjors H.W. Scheres" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...
db79049d4a9932c30a5505e9fb08ce89d1d8850a1f3fd4294257d36993e78131
C/C++
34,648
1,061
// MPP cooperative-tensor flash-attention prefill for MPS, on // mpp::tensor_ops::matmul2d. Adapted from MLX. Emitted only with the // Metal 4 SDK; runtime dispatch gates on macOS 26.2+. #pragma once #include <ATen/native/mps/kernels/PrefillAttention.h> #if __METAL_VERSION__ >= 400 && \ __has_include(<MetalPerfor...
6f36ba19ce6c31182ed183863172c2c2236f1ddac79c3dabacb874bf343c0625
C/C++
34,932
890
// Copyright © 2022 Apple Inc. #pragma once #include <initializer_list> #define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/Tensor.h> #include <ATen/TensorIterator.h> #include <ATen/Utils.h> #include <ATen/mps/MPSProfiler.h> #include <ATen/mps/MPSStream.h> #include <ATen/native/CanUse32BitIndexMath.h> #include...
ba331474be017bb3f9ded44999239328db0d480e8f9435d810a17e436a8a8689
C/C++
34,985
958
#pragma once #include <ATen/SequenceNumber.h> #include <ATen/core/boxing/KernelFunction.h> #include <ATen/core/boxing/impl/boxing.h> #include <ATen/core/dispatch/CppSignature.h> #include <ATen/core/dispatch/OperatorEntry.h> #include <ATen/core/dispatch/RegistrationHandleRAII.h> #include <ATen/record_function.h> #inclu...
69eceb3994101519d6846d98fc540e83644448ae429fd1fda931b597f641ee15
C/C++
35,037
969
/*************************************************************************** * * Author: "Sjors H.W. Scheres" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...
735b542fc2a221841a858384952a37474313e5d970294bf5a986b01c2b89323d
C/C++
35,599
744
/** \file nifti2_io.h \brief Data structures for using nifti2_io API. - Written by Bob Cox, SSCC NIMH - Revisions by Rick Reynolds, SSCC NIMH */ #ifndef _NIFTI2_IO_HEADER_ #define _NIFTI2_IO_HEADER_ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <limits...
54591961d95cf1887f9a9e3c6daf799dbf5b2d5f48fc2dadf60d8132d84b7d02
C/C++
35,825
864
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If ...
63d456c69c8aa4e9ac54a7f636bd390ea9b83b2dc80b492578643040eb83d9b8
C/C++
36,185
810
//----------------------------------------------------------------------------- // About imgui_impl_opengl3_loader.h: // // We embed our own OpenGL loader to not require user to provide their own or to have to use ours, // which proved to be endless problems for users. // Our loader is custom-generated, based on gl3w b...
c1b57567a9b7c35878a9570ec5f177f2cdc7d7751f14712e04645f0e14de50a1
C/C++
36,551
1,070
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_COMMON_H_ #define NUMPY_CORE_INCLUDE_NUMPY_NPY_COMMON_H_ /* need Python.h for npy_intp, npy_uintp */ #include <Python.h> /* numpconfig.h is auto-generated */ #include "numpyconfig.h" #ifdef HAVE_NPY_CONFIG_H #include <npy_config.h> #endif /* * using static inline modifiers when ...
0e7dda9b64c37cd3225a8d2dae6259d9470ed8d1a04fca1ac3184bd169ec8196
C/C++
36,597
868
#ifndef MPSCNNShaders_h #define MPSCNNShaders_h static const char* PT_METAL_SHADERS = R"PT_METAL_SHADERS( #include <metal_stdlib> using namespace metal; constant ushort ushort_arg_0[[function_constant(0)]]; constant ushort ushort_arg_1[[function_constant(1)]]; constant ushort ushort_arg_2[[function_constant(2)]]; con...
f3e141482f09110f33ec7ce7806b95a9140ade857a7e903b6061ceb62b0283a3
C/C++
37,050
1,318
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2018 Wave Computing, Inc. // Written by: // Chris Larsen // Alexey Frunze (afrunze@wavecomp.com) // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the ...
851ec0728e72bd8f88bd39c49ce17fc2f225e7ad793e978a15740cd3524eb49f
C/C++
37,496
1,597
/*************************************************************************** * * Author: "Jasenko Zivanov" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foun...
10eb0ee33a6107ee04bee90bf906a2fa5414c2b87f29630c69e8c643afed85a4
C/C++
37,501
1,269
#include <stdlib.h> #include <string.h> #include <signal.h> #include <cassert> #include "src/acc/acc_backprojector.h" #include "src/acc/cpu/cpu_kernels/helper.h" namespace CpuKernels { template < bool CTF_PREMULTIPLIED > inline void backproject2D( unsigned long imageCount, int block_size, XFLOAT *g_img_real...
e530661d7423721e641f278f1d3ec08900a6c47a0f4cdeaf125e7f0ee75fb2bf
C/C++
37,529
1,233
#ifndef DIFF2_KERNELS_H_ #define DIFF2_KERNELS_H_ #include <vector> #include <iostream> #include <fstream> #include <string.h> #include "src/acc/cpu/cpu_settings.h" #include "src/acc/acc_projector.h" #include "src/acc/cpu/cpu_kernels/cpu_utils.h" #include "src/acc/cpu/cpu_kernels/helper.h" namespace CpuKernels { /*...
e99533a527e4b10dda88330fde84fa6b46b7ae853cf5697a149db99315fd034b
C/C++
37,824
1,074
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2016 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You c...
778d353d376df8574a3bfc5f5ab7d4269b301842dc0555cad39dffe855907c17
C/C++
37,948
983
#ifndef _extcode_H #define _extcode_H /** © Copyright 1990-2006 by National Instruments Corp. All rights reserved. @file extcode.h @brief This document reflects what is published in the CIN manual. DO NOT CHANGE */ #define rcsid_extcode "$Id: //lvdist/branches/Europa/dev/plat/win/cintools/extcode.h#3 $" /* de...
097a5536e7c939e1648fae07cc4164c2f5bf1378bd14ad49934fa20d38f40073
C/C++
37,983
1,438
/*************************************************************************** * * Author: "Sjors H.W. Scheres" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...