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
cugraph-branch-23.08/cpp/tests/c_api/mg_leiden_test.c
cugraph-branch-23.08/cpp/tests/c_api/mg_leiden_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
5,732
35.515924
100
c
cugraph-branch-23.08/cpp/tests/c_api/mg_louvain_test.c
cugraph-branch-23.08/cpp/tests/c_api/mg_louvain_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
4,905
34.810219
100
c
cugraph-branch-23.08/cpp/tests/c_api/mg_random_walks_test.c
cugraph-branch-23.08/cpp/tests/c_api/mg_random_walks_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
15,771
37.374696
100
c
cugraph-branch-23.08/cpp/tests/c_api/mg_similarity_test.c
cugraph-branch-23.08/cpp/tests/c_api/mg_similarity_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
12,594
38.359375
100
c
cugraph-branch-23.08/cpp/tests/c_api/mg_sssp_test.c
cugraph-branch-23.08/cpp/tests/c_api/mg_sssp_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
10,487
37.844444
97
c
cugraph-branch-23.08/cpp/tests/c_api/mg_strongly_connected_components_test.c
cugraph-branch-23.08/cpp/tests/c_api/mg_strongly_connected_components_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
4,944
34.57554
100
c
cugraph-branch-23.08/cpp/tests/c_api/mg_test_utils.h
cugraph-branch-23.08/cpp/tests/c_api/mg_test_utils.h
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * 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 applicable...
4,937
43.089286
83
h
cugraph-branch-23.08/cpp/tests/c_api/mg_triangle_count_test.c
cugraph-branch-23.08/cpp/tests/c_api/mg_triangle_count_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
10,550
47.847222
100
c
cugraph-branch-23.08/cpp/tests/c_api/mg_two_hop_neighbors_test.c
cugraph-branch-23.08/cpp/tests/c_api/mg_two_hop_neighbors_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
7,587
37.517766
97
c
cugraph-branch-23.08/cpp/tests/c_api/mg_weakly_connected_components_test.c
cugraph-branch-23.08/cpp/tests/c_api/mg_weakly_connected_components_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
5,030
36.266667
98
c
cugraph-branch-23.08/cpp/tests/c_api/pagerank_test.c
cugraph-branch-23.08/cpp/tests/c_api/pagerank_test.c
/* * Copyright (c) 2021-2022, NVIDIA CORPORATION. * * 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 applicable...
24,571
41.958042
100
c
cugraph-branch-23.08/cpp/tests/c_api/sg_random_walks_test.c
cugraph-branch-23.08/cpp/tests/c_api/sg_random_walks_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
16,722
36.749436
100
c
cugraph-branch-23.08/cpp/tests/c_api/similarity_test.c
cugraph-branch-23.08/cpp/tests/c_api/similarity_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
11,902
37.521036
100
c
cugraph-branch-23.08/cpp/tests/c_api/sssp_test.c
cugraph-branch-23.08/cpp/tests/c_api/sssp_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
9,322
36.898374
100
c
cugraph-branch-23.08/cpp/tests/c_api/strongly_connected_components_test.c
cugraph-branch-23.08/cpp/tests/c_api/strongly_connected_components_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
4,478
34.267717
114
c
cugraph-branch-23.08/cpp/tests/c_api/triangle_count_test.c
cugraph-branch-23.08/cpp/tests/c_api/triangle_count_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
10,334
48.6875
100
c
cugraph-branch-23.08/cpp/tests/c_api/two_hop_neighbors_test.c
cugraph-branch-23.08/cpp/tests/c_api/two_hop_neighbors_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
7,528
37.413265
98
c
cugraph-branch-23.08/cpp/tests/c_api/uniform_neighbor_sample_test.c
cugraph-branch-23.08/cpp/tests/c_api/uniform_neighbor_sample_test.c
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * 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 applicable...
21,761
42.178571
100
c
cugraph-branch-23.08/cpp/tests/c_api/weakly_connected_components_test.c
cugraph-branch-23.08/cpp/tests/c_api/weakly_connected_components_test.c
/* * Copyright (c) 2022, NVIDIA CORPORATION. * * 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 applicable law ...
5,588
37.280822
126
c
cugraph-branch-23.08/cpp/tests/layout/legacy/knn.h
cugraph-branch-23.08/cpp/tests/layout/legacy/knn.h
/* * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * 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 applicable...
1,935
26.267606
87
h
cugraph-branch-23.08/cpp/tests/layout/legacy/trust_worthiness.h
cugraph-branch-23.08/cpp/tests/layout/legacy/trust_worthiness.h
/* * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * 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 applicable...
4,363
27.154839
95
h
cugraph-branch-23.08/cpp/tests/traversal/legacy/bfs_ref.h
cugraph-branch-23.08/cpp/tests/traversal/legacy/bfs_ref.h
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * 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 applicable...
2,166
28.283784
83
h
cugraph-branch-23.08/thirdparty/mmio/mmio.c
cugraph-branch-23.08/thirdparty/mmio/mmio.c
/* * Matrix Market I/O library for ANSI C * * See http://math.nist.gov/MatrixMarket for details. * * */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> #include "mmio.h" int mm_read_unsymmetric_sparse(const char *fname, int *M_, int *N_, int *nz_, double **val_, in...
12,903
24.203125
85
c
cugraph-branch-23.08/thirdparty/mmio/mmio.h
cugraph-branch-23.08/thirdparty/mmio/mmio.h
/* * Matrix Market I/O library for ANSI C * * See http://math.nist.gov/MatrixMarket for details. * * */ #ifndef MM_IO_H #define MM_IO_H #define MM_MAX_LINE_LENGTH 1025 #define MatrixMarketBanner "%%MatrixMarket" #define MM_MAX_TOKEN_LENGTH 64 typedef char MM_typecode[4]; char *mm_typecode_to_str(MM_typecode ma...
4,206
30.395522
80
h
finmag
finmag-master/dev/sandbox/cvode_parallel/llg/llg.c
#include "llg.h" int llg_rhs(Vec M, Vec H, Vec dM_dt, Vec alpha_v, double gamma, int do_precession, double char_freq) { PetscReal *m, *h, *dm_dt, *alpha; PetscReal mth0, mth1, mth2, a1, mm; int i,j,nlocal=0; VecGetArray(M, &m); VecGetArray(H, &h); VecGetArray(dM_dt, &dm_dt); VecGetArray(...
2,188
30.724638
103
c
finmag
finmag-master/dev/sandbox/timeintegration/c-dolfin-compare/dmdt.c
int dmdt(double alpha, double gamma, double c, int Mn, double* M, int Hn, double* H, int dMdtn, double* dMdt, int Pn, double* P); #define DEBUG 1 #ifdef DEBUG #define DLOG(...) printf(__VA_ARGS__) #else #define DLOG(...) /* nothing */ #endif int dmdt(double alpha, double gamma, double c, int ...
2,638
32.405063
78
c
finmag
finmag-master/dev/sandbox/treecode/fast_sum.h
#ifndef FAST_SUM_H #define FAST_SUM_H typedef struct { double x,y,z; } Cartesian_xyz; struct octree_node { int num_children; int num_particle; int have_moment; int need_upadte_moment; int begin; int end; double x,y,z;//node x,y,z double rx,ry,rz; double radi...
1,939
25.216216
100
h
finmag
finmag-master/dev/sandbox/treecode_bem/fast_sum.h
#ifndef FAST_SUM_H #define FAST_SUM_H typedef struct { double x,y,z; } Cartesian_xyz; struct octree_node { int num_children; int num_particle; int have_moment; int need_upadte_moment; int begin; int end; double x,y,z;//node x,y,z double rx,ry,rz; double radi...
2,266
25.057471
105
h
finmag
finmag-master/examples/cubic_anisotropy/oommf_reference/cubicanisotropy8.h
/* FILE: cubicanisotropy8.h -*-Mode: c++-*- * * Cubic Anisotropy, derived from Oxs_Energy class. * * This interface is a modification of the interface * /oommf/app/oxs/ext/cubicanisotropy.h * It is designed for handling higher orders of the * power series of the cubic anisotropy * * The required va...
2,332
30.106667
75
h
finmag
finmag-master/native/src/finmag_includes.h
/** * FinMag - a thin layer on top of FEniCS to enable micromagnetic multi-physics simulations * Copyright (C) 2012 University of Southampton * Do not distribute * * CONTACT: h.fangohr@soton.ac.uk * * AUTHOR(S) OF THIS FILE: Dmitri Chernyshenko (d.chernyshenko@soton.ac.uk) */ #ifndef __FINMAG_INCLUDES_H #define...
802
20.131579
91
h
finmag
finmag-master/native/src/cvode/llg.c
#include "llg.h" int llg_rhs(Vec M, Vec H, Vec dM_dt, Vec alpha_v, double gamma, int do_precession, double char_freq) { PetscReal *m, *h, *dm_dt, *alpha; PetscReal mth0, mth1, mth2, a1, mm; int i,j,nlocal=0; VecGetArray(M, &m); VecGetArray(H, &h); VecGetArray(dM_dt, &dm_dt); VecGetArray(...
2,188
30.724638
103
c
finmag
finmag-master/native/src/fast_sum_lib/fast_sum.h
#ifndef FAST_SUM_H #define FAST_SUM_H typedef struct { double x,y,z; } Cartesian_xyz; struct octree_node { int num_children; int num_particle; int have_moment; int need_upadte_moment; int begin; int end; double x,y,z;//node x,y,z double rx,ry,rz; double radi...
2,231
26.9
100
h
finmag
finmag-master/native/src/llb/mt19937.h
//#include <boost/random.hpp> //#include <boost/random/normal_distribution.hpp> #include "util/np_array.h" namespace finmag { namespace llb { /* class RandomMT19937 { private: boost::random::mt19937 engine; boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > generator; publi...
1,199
20.428571
89
h
finmag
finmag-master/native/src/sundials/numpy_malloc.h
/** * FinMag - a thin layer on top of FEniCS to enable micromagnetic multi-physics simulations * Copyright (C) 2012 University of Southampton * Do not distribute * * CONTACT: h.fangohr@soton.ac.uk * * AUTHOR(S) OF THIS FILE: Dmitri Chernyshenko (d.chernyshenko@soton.ac.uk) */ #ifndef __FINMAG_UTIL_SUNDIALS_NUM...
1,450
26.377358
91
h
finmag
finmag-master/native/src/sundials/nvector_custom_malloc.h
/** * FinMag - a thin layer on top of FEniCS to enable micromagnetic multi-physics simulations * Copyright (C) 2012 University of Southampton * Do not distribute * * CONTACT: h.fangohr@soton.ac.uk * * AUTHOR(S) OF THIS FILE: Dmitri Chernyshenko (d.chernyshenko@soton.ac.uk) */ #ifndef __FINMAG_UTIL_SUNDIALS_NVE...
784
22.088235
91
h
finmag
finmag-master/native/src/sundials/nvec_serial/nvector_custom_malloc_impl.h
/** * FinMag - a thin layer on top of FEniCS to enable micromagnetic multi-physics simulations * Copyright (C) 2012 University of Southampton * Do not distribute * * CONTACT: h.fangohr@soton.ac.uk * * AUTHOR(S) OF THIS FILE: Dmitri Chernyshenko (d.chernyshenko@soton.ac.uk) */ #ifndef __FINMAG_UTIL_SUNDIALS_NVE...
1,343
27.595745
91
h
finmag
finmag-master/native/src/sundials/nvec_serial/sundials_math.c
/* * ----------------------------------------------------------------- * $Revision: 1.1 $ * $Date: 2006/07/05 15:32:38 $ * ----------------------------------------------------------------- * Programmer(s): Scott D. Cohen, Alan C. Hindmarsh and * Aaron Collier @ LLNL * -----------------------------...
2,474
25.052632
68
c
finmag
finmag-master/native/src/treecode_bem/common.h
#include <math.h> #include <string.h> #include <stdlib.h> #include <stdio.h> typedef struct { double x,y,z; } Cartesian_xyz; struct octree_node { int num_children; int num_particle; int have_moment; int need_upadte_moment; int begin; int end; double x,y,z;//node x,y,z double rx,...
3,108
27.787037
127
h
finmag
finmag-master/native/src/treecode_bem/test.c
#include "common.h" #include <assert.h> //gcc test.c common.c -lm static int ccc[35]={ 1, 1, 2, 6, 24, 1, 1, 2, 6, 2, 2, 4, 6, 6, 24, 1, 1, 2, 6, 1, 1, 2, 2, 2, 6, 2, 2, 4, 2, 2, 4, 6, 6, 6, 24 }; void test_compute_coefficient_directly(){ double a[35]; //computed using Mathematica double expected[35]={ 0.4...
6,494
22.031915
110
c
finmag
finmag-master/native/src/treecode_bem/treecode_bem_I.c
#include "common.h" void bulid_indices_single_I(fastsum_plan *plan, struct octree_node *tree, int index, int *in, double *value, int compute_bm) { double R; int i, j; double *p0, *p1, *p2, *p3; double omega[3]; int k1, k2, k3; double T[3]={0,0,0}; R = pow2(plan->x_t[3 * index] - ...
5,724
20.934866
103
c
finmag
finmag-master/native/src/treecode_bem/treecode_bem_II.c
#include "common.h" void bulid_indices_single_II(fastsum_plan *plan, struct octree_node *tree, int index, int *in, double *value, int compute_bm) { int i, j; double r,dx, dy, dz; double *p0, *p1, *p2, *p3; double omega[3]; int k1, k2, k3; double T[3]={0,0,0}; r = pow2(plan->x_t[3...
7,463
21.618182
113
c
finmag
finmag-master/src/finmag/physics/native/derivatives.h
#pragma once namespace dolfin { namespace finmag { void dm_damping(double const& alpha, double const& gamma, double const& m_x, double const& m_y, double const& m_z, double const& mp_x, double const& mp_y, double const& mp_z, double const& H_x, doub...
1,293
55.26087
83
h
finmag
finmag-master/src/finmag/physics/native/equation.h
#include <memory> #include <vector> #include <dolfin/la/GenericVector.h> #include <dolfin/la/PETScVector.h> #include "terms.h" /* compile_extension_module needs code to be wrapped in the dolfin namespace */ namespace dolfin { namespace finmag { class Equation { public: Equation(GenericVector co...
2,735
41.75
113
h
finmag
finmag-master/src/finmag/physics/native/terms.h
#pragma once #include <dolfin/function/Function.h> namespace dolfin { namespace finmag { void damping(double const& alpha, double const& gamma, double const& m_x, double const& m_y, double const& m_z, double const& H_x, double const& H_y, double const& H_z, double...
2,063
42.914894
81
h
null
pytorch-main/android/pytorch_android/src/main/cpp/pytorch_jni_common.h
#pragma once #include <c10/util/FunctionRef.h> #include <fbjni/fbjni.h> #include <torch/csrc/api/include/torch/types.h> #include "caffe2/serialize/read_adapter_interface.h" #include "cmake_macros.h" #ifdef __ANDROID__ #include <android/log.h> #define ALOGI(...) \ __android_log_print(ANDROID_LOG_INFO, "pytorch-jni"...
3,585
24.985507
80
h
null
pytorch-main/aten/src/ATen/ATen.h
#pragma once #if !defined(_MSC_VER) && __cplusplus < 201703L #error C++17 or later compatible compiler is required to use ATen. #endif #include <ATen/Context.h> #include <ATen/Device.h> #include <ATen/DeviceGuard.h> #include <ATen/DimVector.h> #include <ATen/Dispatch.h> #include <ATen/Formatting.h> #include <ATen/Fun...
1,107
28.157895
80
h
null
pytorch-main/aten/src/ATen/AccumulateType.h
#pragma once #include <ATen/Config.h> #include <c10/core/ScalarType.h> #include <c10/util/BFloat16.h> #include <c10/util/Half.h> // Defines the accumulation type for a scalar type. // Example: // using accscalar_t = acc_type<scalar_t, /*is_cuda*/true>; // // Accumulation types are an important concept in numeric com...
4,697
25.1
79
h
null
pytorch-main/aten/src/ATen/CPUApplyUtils.h
#pragma once #include <ATen/CollapseDims.h> #include <ATen/Parallel.h> #include <ATen/TensorUtils.h> #include <c10/util/irange.h> #include <cstring> #include <limits> #include <utility> namespace at { /* * The basic strategy for apply is as follows: * * 1. Starting with the outermost index, loop until we reach a ...
10,258
28.822674
80
h
null
pytorch-main/aten/src/ATen/CPUFixedAllocator.h
#pragma once #include <c10/core/Allocator.h> #include <c10/util/Exception.h> // This file creates a fake allocator that just throws exceptions if // it is actually used. // state passed to the allocator is the std::function<void(void*)> called // when the blob is release by ATen namespace at { static cpu_fixed_mal...
845
23.882353
73
h
null
pytorch-main/aten/src/ATen/CPUGeneratorImpl.h
#pragma once #include <ATen/core/Generator.h> #include <ATen/core/MT19937RNGEngine.h> #include <c10/core/GeneratorImpl.h> #include <c10/util/Optional.h> namespace at { struct TORCH_API CPUGeneratorImpl : public c10::GeneratorImpl { // Constructors CPUGeneratorImpl(uint64_t seed_in = default_rng_seed_val); ~CPU...
1,538
29.78
66
h
null
pytorch-main/aten/src/ATen/CachedTensorUtils.h
#pragma once #include <ATen/ATen.h> namespace at { namespace caching { // Some systems (just cudagraphs currently) will persist a static tensor output // whose TensorImpl does not change across iterations. For these tensors caching // dtype conversions is invalid. Additionally, there will be an extra reference // co...
1,032
37.259259
80
h
null
pytorch-main/aten/src/ATen/CollapseDims.h
#include <c10/util/Exception.h> #include <utility> namespace at { /* [collapse dims] Updates sizes, and strides to reflect a "collapse" of the info, possibly excluding the optional excludeDim. A "collapsed" version of the info is the fewest dims that order the tensor's elements in the same way as the original info. I...
2,560
25.957895
77
h
null
pytorch-main/aten/src/ATen/Context.h
#pragma once #include <ATen/CPUGeneratorImpl.h> #include <ATen/LinalgBackend.h> #include <ATen/core/ATenGeneral.h> #include <ATen/core/DeprecatedTypeProperties.h> #include <ATen/core/Generator.h> #include <ATen/core/LegacyTypeDispatch.h> #include <ATen/detail/CUDAHooksInterface.h> #include <ATen/detail/HIPHooksInterfa...
16,327
32.390593
85
h
null
pytorch-main/aten/src/ATen/DLConvertor.h
#pragma once #include <ATen/ATen.h> #include <ATen/Tensor.h> #include <ATen/dlpack.h> // this convertor will: // 1) take a Tensor object and wrap it in the DLPack tensor // 2) take a dlpack tensor and convert it to the ATen Tensor namespace at { TORCH_API ScalarType toScalarType(const DLDataType& dtype); TORCH_API ...
669
29.454545
80
h
null
pytorch-main/aten/src/ATen/DeviceGuard.h
#pragma once #include <ATen/core/IListRef.h> #include <ATen/core/Tensor.h> #include <c10/core/DeviceGuard.h> #include <c10/core/ScalarType.h> // TensorList whyyyyy namespace at { // Are you here because you're wondering why DeviceGuard(tensor) no // longer works? For code organization reasons, we have temporarily(?...
1,185
27.238095
72
h
null
pytorch-main/aten/src/ATen/EmptyTensor.h
#pragma once #include <ATen/core/TensorBase.h> namespace at { namespace detail { template <class ArrayRefType> inline void check_size_nonnegative(ArrayRefType size) { for (const auto& x : size) { TORCH_CHECK( x >= 0, "Trying to create tensor with negative dimension ", x, ": ", ...
4,324
27.267974
80
h
null
pytorch-main/aten/src/ATen/ExpandBase.h
#include <ATen/core/TensorBase.h> // Broadcasting utilities for working with TensorBase namespace at { namespace internal { TORCH_API TensorBase expand_slow_path(const TensorBase& self, IntArrayRef size); } // namespace internal inline c10::MaybeOwned<TensorBase> expand_size( const TensorBase& self, IntArrayR...
914
28.516129
80
h
null
pytorch-main/aten/src/ATen/ExpandUtils.h
#pragma once #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #else #include <ATen/ops/view.h> #include <ATen/ops/view_copy.h> #endif #include <ATen/Tensor.h> #include <ATen/core/DimVector.h> #include <c10/util/Exception.h> #include <c10/util/MaybeOwned.h> #include <c10/util/irange.h> #include <functional...
16,222
29.783681
80
h
null
pytorch-main/aten/src/ATen/FuncTorchTLS.h
#pragma once #include <c10/macros/Macros.h> #include <memory> namespace at { namespace functorch { // NOTE [functorch TLS in pytorch/pytorch] // // functorch lives out-of-tree. However, it has some TLS that needs to be // propagated. The solution for that is we store a pointer to the TLS // inside pytorch/pytorch an...
1,841
36.591837
80
h
null
pytorch-main/aten/src/ATen/FunctionalStorageImpl.h
#pragma once #include <ATen/Tensor.h> namespace at { namespace functionalization { // See Note [Functionalization Pass In Core] // ViewMeta is a class used by the functionalization pass to navigate between // a base tensor and a view tensor. // For example, if I call `b = a.view1(...)` // the functionalization pass...
4,303
34.278689
80
h
null
pytorch-main/aten/src/ATen/FunctionalTensorWrapper.h
#pragma once #include <ATen/ArrayRef.h> #include <ATen/FunctionalStorageImpl.h> #include <ATen/core/IListRef.h> #include <ATen/core/List.h> #include <ATen/core/boxing/BoxedKernel.h> #include <ATen/core/boxing/impl/boxing.h> #include <ATen/core/dispatch/Dispatcher.h> #include <c10/core/DispatchKey.h> namespace at { ...
13,196
39.234756
80
h
null
pytorch-main/aten/src/ATen/InferSize.h
#pragma once #include <ATen/DimVector.h> #include <c10/core/ScalarType.h> #include <c10/core/SymIntArrayRef.h> #include <c10/util/DimVector.h> #include <c10/util/Optional.h> #include <sstream> #include <vector> namespace at { // Infers the size of a dim with size -1, if it exists. Also checks that new // shape is co...
2,613
28.704545
80
h
null
pytorch-main/aten/src/ATen/LegacyBatchedFallback.h
#pragma once #include <ATen/ATen.h> #include <ATen/core/op_registration/op_registration.h> #include <torch/library.h> namespace at { // If an operator doesn't have a batching rule implemented then we fallback // to this implementation. The fallback only works on out-of-place operators // that return only tensors with...
974
36.5
78
h
null
pytorch-main/aten/src/ATen/LegacyBatchedTensorImpl.h
#pragma once #include <bitset> #include <utility> #include <ATen/ArrayRef.h> #include <ATen/SmallVector.h> #include <ATen/Tensor.h> namespace at { // We assume this in a few other places in the codebase, // but there isn't a centralized definition. constexpr int64_t kVmapMaxTensorDims = 64; // The valid vmap level...
5,575
33.419753
80
h
null
pytorch-main/aten/src/ATen/LegacyVmapMode.h
#pragma once #include <c10/core/impl/LocalDispatchKeySet.h> namespace at { namespace impl { // VmapMode contains a thread local count of how many nested vmaps // we are currently inside. That number is known as the `vmap level`. // VmapMode is used in the implementation of the Python `torch.vmap` API. // // NOTE: th...
952
31.862069
78
h
null
pytorch-main/aten/src/ATen/LegacyVmapTransforms.h
#pragma once #include <ATen/LegacyBatchedTensorImpl.h> #include <ATen/core/IListRef.h> namespace at { // This file contains abstractions used for transforming *logical* vmap // arguments into *physical* arguments. (Keep reading for definitions of these // terms). // NOTE: [Logical vs physical args] // Consider the ...
7,803
41.413043
80
h
null
pytorch-main/aten/src/ATen/LinalgBackend.h
#pragma once #include <c10/util/Exception.h> #include <ostream> #include <string> namespace at { enum class LinalgBackend : int8_t { Default, Cusolver, Magma }; inline std::string LinalgBackendToString(at::LinalgBackend backend) { switch (backend) { case LinalgBackend::Default: return "at::LinalgBacken...
719
21.5
69
h
null
pytorch-main/aten/src/ATen/MapAllocator.h
#pragma once #include <c10/core/Allocator.h> namespace at { enum MappedAllocatorModes { ALLOCATOR_MAPPED_SHARED = 1, ALLOCATOR_MAPPED_SHAREDMEM = 2, ALLOCATOR_MAPPED_EXCLUSIVE = 4, ALLOCATOR_MAPPED_NOCREATE = 8, ALLOCATOR_MAPPED_KEEPFD = 16, ALLOCATOR_MAPPED_FROMFD = 32, ALLOCATOR_MAPPED_UNLINK = 64 };...
3,211
22.970149
80
h
null
pytorch-main/aten/src/ATen/MatrixRef.h
#pragma once #include <ATen/Utils.h> #include <c10/util/ArrayRef.h> #include <vector> namespace at { /// MatrixRef - Like an ArrayRef, but with an extra recorded strides so that /// we can easily view it as a multidimensional array. /// /// Like ArrayRef, this class does not own the underlying data, it is expected //...
2,929
25.636364
78
h
null
pytorch-main/aten/src/ATen/MemoryOverlap.h
#pragma once #include <c10/macros/Export.h> namespace c10 { struct TensorImpl; } namespace at { class TensorBase; // MemOverlap: Whether or not there is memory overlap // // No: Absolutely no memory overlap // Yes: Absolutely yes memory overlap // TooHard: There might be memory overlap, but it was too expensive to ...
1,287
28.953488
79
h
null
pytorch-main/aten/src/ATen/NamedTensorUtils.h
#pragma once #include <ATen/NamedTensor.h> #include <ATen/TensorNames.h> #include <ATen/WrapDimUtilsMulti.h> #include <ATen/core/DimVector.h> #include <ATen/core/Tensor.h> #include <functional> namespace at { using NameVector = SmallVector<Dimname, kDimVectorStaticSize>; inline bool has_names(ITensorListRef tensors...
6,809
30.527778
81
h
null
pytorch-main/aten/src/ATen/NestedTensorImpl.h
#pragma once #include <ATen/MemoryOverlap.h> #include <ATen/Tensor.h> #include <c10/core/DispatchKey.h> #include <c10/core/DispatchKeySet.h> #include <c10/core/MemoryFormat.h> #include <c10/core/TensorImpl.h> #include <c10/util/ArrayRef.h> #include <c10/util/Exception.h> #include <c10/util/Metaprogramming.h> #include <...
9,870
34.128114
80
h
null
pytorch-main/aten/src/ATen/NumericUtils.h
#pragma once #ifdef __HIPCC__ #include <hip/hip_runtime.h> #endif #include <c10/macros/Macros.h> #include <c10/util/BFloat16.h> #include <c10/util/Half.h> #include <c10/util/complex.h> #include <cmath> #include <type_traits> namespace at { // std::isnan isn't performant to use on integral types; it will // (useles...
4,157
23.60355
78
h
null
pytorch-main/aten/src/ATen/OpMathType.h
#pragma once #include <c10/core/ScalarType.h> #include <c10/util/BFloat16.h> #include <c10/util/Exception.h> #include <c10/util/Half.h> namespace at { // For FP16 or BFloat16 inputs, ops should perform internal math in FP32. template <typename scalar_t> struct OpMathType { using type = scalar_t; }; template <> str...
1,052
20.06
73
h
null
pytorch-main/aten/src/ATen/OpaqueTensorImpl.h
#pragma once #include <c10/core/MemoryFormat.h> #include <c10/core/SymIntArrayRef.h> #include <c10/core/TensorImpl.h> #include <c10/util/Exception.h> namespace at { // An "Opaque" TensorImpl -- there are no strides and (for now) // even data() is not supported (thus no pointer arithmetic). // NOTE: We could allow d...
6,096
31.604278
80
h
null
pytorch-main/aten/src/ATen/Parallel-inl.h
#pragma once #include <c10/util/Exception.h> #include <c10/util/SmallVector.h> namespace at { template <class F> inline void parallel_for( const int64_t begin, const int64_t end, const int64_t grain_size, const F& f) { TORCH_INTERNAL_ASSERT_DEBUG_ONLY(grain_size >= 0); if (begin >= end) { ret...
1,967
22.428571
74
h
null
pytorch-main/aten/src/ATen/Parallel.h
#pragma once #include <ATen/Config.h> #include <c10/macros/Macros.h> #include <functional> #include <string> namespace at { inline int64_t divup(int64_t x, int64_t y) { return (x + y - 1) / y; } // Called during new thread initialization TORCH_API void init_num_threads(); // Sets the number of threads to be used ...
4,829
29
80
h
null
pytorch-main/aten/src/ATen/ParallelNativeTBB.h
#pragma once #include <atomic> #include <cstddef> #include <exception> #include <c10/util/Exception.h> #ifdef _WIN32 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #endif #include <tbb/tbb.h> #define INTRA_OP_PARALLEL namespace at { namespace internal { template <typename F> inline void invoke_par...
1,311
22.854545
70
h
null
pytorch-main/aten/src/ATen/ParallelOpenMP.h
#pragma once #include <atomic> #include <cstddef> #include <exception> #ifdef _OPENMP #define INTRA_OP_PARALLEL #include <omp.h> #endif namespace at { #ifdef _OPENMP namespace internal { template <typename F> inline void invoke_parallel( int64_t begin, int64_t end, int64_t grain_size, const F& f) {...
1,289
21.241379
76
h
null
pytorch-main/aten/src/ATen/PythonTorchFunctionTLS.h
#pragma once #include <c10/core/SafePyObject.h> #include <c10/macros/Macros.h> namespace at { namespace impl { enum TorchFunctionDisabledState { ENABLED, SUBCLASSES_DISABLED, ALL_DISABLED }; struct TORCH_API PythonTorchFunctionTLS { static void set_disabled_state(TorchFunctionDisabledState disabled_state_); sta...
1,171
30.675676
79
h
null
pytorch-main/aten/src/ATen/SavedTensorHooks.h
#pragma once #include <c10/macros/Export.h> #include <c10/util/Optional.h> #include <c10/util/python_stub.h> #include <stack> #include <string> #include <utility> namespace at { namespace impl { struct TORCH_API SavedTensorDefaultHooksTLS { // PyObject is defined in c10/util/python_stub.h std::stack<std::pair<...
1,772
32.45283
78
h
null
pytorch-main/aten/src/ATen/ScalarOps.h
#pragma once #include <ATen/Tensor.h> #include <c10/core/Scalar.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #else #include <ATen/ops/scalar_tensor.h> #endif namespace at { namespace detail { // When filling a number to 1-element CPU tensor, we want to skip // everything but manipulate data ptr dir...
2,388
30.434211
80
h
null
pytorch-main/aten/src/ATen/SparseCsrTensorImpl.h
#pragma once #include <ATen/Tensor.h> #include <c10/core/TensorImpl.h> #include <c10/util/Exception.h> namespace at { // Struct implementing a sparse CSR tensor. It uses three 1-D tensors for // denoting the data: `crow_indices_`, `col_indices_` and `values_`. // The `crow_indices_` tensor is a integer tensor of shap...
5,927
31.393443
80
h
null
pytorch-main/aten/src/ATen/SparseCsrTensorUtils.h
#pragma once #include <ATen/SparseCsrTensorImpl.h> #include <ATen/SparseTensorImpl.h> #include <ATen/core/Tensor.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #include <ATen/Operators.h> #else #include <ATen/ops/resize_as_sparse_native.h> #endif #define AT_DISPATCH_...
14,733
38.714286
80
h
null
pytorch-main/aten/src/ATen/StorageUtils.h
#pragma once #include <c10/core/Storage.h> #include <c10/core/StorageImpl.h> #include <c10/util/intrusive_ptr.h> namespace at { class TensorBase; // Here we define a series of utils to create/manipulate ATen backed // c10 storage implementations. /** * Create a new shared memory storage impl managed by file descr...
1,308
25.18
80
h
null
pytorch-main/aten/src/ATen/TensorGeometry.h
#pragma once #include <ATen/core/TensorBase.h> #include <c10/core/WrapDimMinimal.h> namespace at { // Return if the tensor geometry represented by `sizes` and `strides` is // contiguous Although we cache is_contiguous in tensor now, this is till useful // because it allows checking if a particular geometry is contig...
4,229
28.172414
80
h
null
pytorch-main/aten/src/ATen/TensorIndexing.h
#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/Optional.h> #include <c10/util/irange.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> ...
23,337
31.013717
108
h
null
pytorch-main/aten/src/ATen/TensorIteratorInternal.h
#pragma once #include <ATen/native/TensorIterator.h> #include <c10/util/SmallBuffer.h> #include <c10/util/irange.h> namespace at { struct DimCounter { DimCounter(IntArrayRef shape, Range range); void increment(const std::array<int64_t, 2>& step); bool is_done() const; std::array<int64_t, 2> max_2d_step() con...
1,937
25.547945
80
h
null
pytorch-main/aten/src/ATen/TensorMeta.h
#pragma once #include <ATen/DimVector.h> #include <ATen/core/Dimname.h> #include <c10/core/TensorOptions.h> #include <c10/util/strides.h> C10_CLANG_DIAGNOSTIC_PUSH() #if C10_CLANG_HAS_WARNING("-Wdeprecated-copy-dtor") C10_CLANG_DIAGNOSTIC_IGNORE("-Wdeprecated-copy-dtor") #endif namespace at { class Tensor; namespa...
4,824
33.464286
80
h
null
pytorch-main/aten/src/ATen/TensorNames.h
#pragma once #include <ATen/WrapDimUtils.h> namespace at { namespace namedinference { // TensorName and TensorNames are wrappers around Dimname and DimnameList // that contain helper functions to make writing name inference rules easier. // // A TensorName represents a Dimname associated with some DimnameList (from ...
2,540
32.434211
80
h
null
pytorch-main/aten/src/ATen/TensorOperators.h
#pragma once #include <ATen/core/Tensor.h> #include <c10/core/Scalar.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #else #include <ATen/ops/empty_like.h> #endif #include <stdexcept> #include <string> namespace at { #define AT_FORALL_BINARY_OPS(_) \ _(+...
2,594
46.181818
77
h
null
pytorch-main/aten/src/ATen/TensorSubclassLikeUtils.h
#pragma once #include <ATen/core/List.h> #include <ATen/core/Tensor.h> #include <c10/core/impl/TorchDispatchModeTLS.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #else #include <ATen/ops/equal.h> #endif namespace at { // Note [Tensor-subclass-like Tensors] // Tensor-subclass-like is defined as: // -...
3,252
35.965909
80
h
null
pytorch-main/aten/src/ATen/TensorUtils.h
#pragma once #include <ATen/DimVector.h> #include <ATen/EmptyTensor.h> #include <ATen/Tensor.h> #include <ATen/TensorGeometry.h> #include <ATen/Utils.h> #include <utility> // These functions are NOT in Utils.h, because this file has a dep on Tensor.h #define TORCH_CHECK_TENSOR_ALL(cond, ...) \ TORCH_CHECK((cond)....
5,792
29.97861
80
h
null
pytorch-main/aten/src/ATen/ThreadLocalPythonObjects.h
#pragma once #include <c10/core/SafePyObject.h> #include <c10/macros/Macros.h> #include <unordered_map> namespace at { namespace impl { struct TORCH_API ThreadLocalPythonObjects { static void set(const std::string& key, std::shared_ptr<SafePyObject> value); static const std::shared_ptr<SafePyObject>& get(const s...
632
25.375
80
h
null
pytorch-main/aten/src/ATen/TracerMode.h
#pragma once #include <c10/core/impl/LocalDispatchKeySet.h> #include <c10/macros/Export.h> #include <c10/macros/Macros.h> // NOTE [Tracing Mode Switches] // // Historically, tracing function was controlled by two switches: // // - `AutoDispatchBelowADInplaceOrView` guard // // Tracing function used to be script-ge...
5,572
39.678832
80
h
null
pytorch-main/aten/src/ATen/ThreadLocalState.h
#pragma once #include <stack> #include <c10/core/InferenceMode.h> #include <c10/core/impl/LocalDispatchKeySet.h> #include <c10/util/Exception.h> #include <c10/util/ThreadLocalDebugInfo.h> #include <ATen/FuncTorchTLS.h> #include <ATen/PythonTorchFunctionTLS.h> #include <ATen/SavedTensorHooks.h> #include <ATen/ThreadL...
3,753
31.643478
77
h
null
pytorch-main/aten/src/ATen/TypeDefault.h
#pragma once #include <ATen/Dimname.h> #include <c10/core/MemoryFormat.h> #include <c10/core/QScheme.h> #include <c10/core/Scalar.h> #include <c10/core/TensorOptions.h> #include <c10/macros/Export.h> #include <c10/util/ArrayRef.h> #include <c10/util/intrusive_ptr.h> namespace c10 { struct Storage; } namespace at { ...
666
20.516129
76
h
null
pytorch-main/aten/src/ATen/Utils.h
#pragma once #include <ATen/EmptyTensor.h> #include <ATen/Formatting.h> #include <ATen/core/ATenGeneral.h> #include <ATen/core/Generator.h> #include <c10/core/ScalarType.h> #include <c10/core/StorageImpl.h> #include <c10/core/UndefinedTensorImpl.h> #include <c10/util/ArrayRef.h> #include <c10/util/Exception.h> #includ...
3,569
24.683453
78
h
null
pytorch-main/aten/src/ATen/WrapDimUtils.h
#pragma once #include <ATen/core/IListRef.h> #include <ATen/core/Tensor.h> #include <c10/core/TensorImpl.h> #include <c10/core/WrapDimMinimal.h> #include <c10/util/irange.h> namespace at { // if dim_post_expr is 0 and wrap_scalar is true, then dim must be in the // range [-1, 0]. This is a special case for scalar te...
4,778
30.032468
80
h
null
pytorch-main/aten/src/ATen/WrapDimUtilsMulti.h
#pragma once #include <ATen/WrapDimUtils.h> #include <c10/core/TensorImpl.h> #include <c10/util/irange.h> #include <bitset> #include <sstream> namespace at { // This is in an extra file to work around strange interaction of // bitset on Windows with operator overloading constexpr size_t dim_bitset_size = 64; stati...
1,071
22.822222
65
h