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/caffe2/utils/threadpool/ThreadPoolCommon.h
#ifndef CAFFE2_UTILS_THREADPOOL_COMMON_H_ #define CAFFE2_UTILS_THREADPOOL_COMMON_H_ #ifdef __APPLE__ #include <TargetConditionals.h> #endif // caffe2 depends upon NNPACK, which depends upon this threadpool, so // unfortunately we can't reference core/common.h here // This is copied from core/common.h's definition of...
677
31.285714
76
h
null
pytorch-main/caffe2/utils/threadpool/WorkersPool.h
#pragma once #include <atomic> #include <condition_variable> #include <thread> #include "c10/util/thread_name.h" #include <c10/util/irange.h> #include "caffe2/core/common.h" #include "caffe2/core/logging.h" #if defined(_MSC_VER) #include <intrin.h> #endif namespace caffe2 { // Uses code derived from gemmlowp, // ht...
11,631
30.101604
112
h
null
pytorch-main/caffe2/utils/threadpool/pthreadpool-cpp.h
#pragma once #ifdef USE_PTHREADPOOL #ifdef USE_INTERNAL_PTHREADPOOL_IMPL #include <caffe2/utils/threadpool/pthreadpool.h> #else #include <pthreadpool.h> #endif #include <functional> #include <memory> #include <mutex> namespace caffe2 { class PThreadPool final { public: explicit PThreadPool(size_t thread_count);...
1,417
24.781818
79
h
null
pytorch-main/caffe2/utils/threadpool/pthreadpool.h
// pthreadpool header from https://github.com/Maratyszcza/pthreadpool // for NNPACK #ifndef CAFFE2_UTILS_PTHREADPOOL_H_ #define CAFFE2_UTILS_PTHREADPOOL_H_ #include "ThreadPoolCommon.h" #include <stddef.h> // for size_t #include <stdint.h> // for uint32_t #if defined(USE_PTHREADPOOL) // This is a hack. // Mainly int...
6,344
31.706186
119
h
null
pytorch-main/caffe2/utils/threadpool/thread_pool_guard.h
#pragma once #include <c10/macros/Macros.h> namespace caffe2 { // A RAII, thread local (!) guard that enables or disables grad mode upon // construction, and sets it back to the original value upon destruction. struct TORCH_API _NoPThreadPoolGuard { static bool is_enabled(); static void set_enabled(bool enabled)...
567
22.666667
73
h
null
pytorch-main/caffe2/video/optical_flow.h
#ifndef CAFFE2_VIDEO_OPTICAL_FLOW_H_ #define CAFFE2_VIDEO_OPTICAL_FLOW_H_ #include <opencv2/core.hpp> #include <opencv2/highgui.hpp> #include <opencv2/opencv.hpp> #include <opencv2/video.hpp> #include <caffe2/core/logging.h> namespace caffe2 { // Four different types of optical flow algorithms supported; // BroxOpt...
1,306
24.627451
68
h
null
pytorch-main/caffe2/video/video_decoder.h
#ifndef CAFFE2_VIDEO_VIDEO_DECODER_H_ #define CAFFE2_VIDEO_VIDEO_DECODER_H_ #include <caffe2/core/logging.h> #include <stdio.h> #include <memory> #include <string> #include <vector> extern "C" { #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libavformat/avio.h> #include <libavutil/log.h> ...
13,882
25.393536
80
h
null
pytorch-main/caffe2/video/video_io.h
#ifndef CAFFE2_VIDEO_VIDEO_IO_H_ #define CAFFE2_VIDEO_VIDEO_IO_H_ #include <caffe2/core/common.h> #include <caffe2/video/optical_flow.h> #include <caffe2/video/video_decoder.h> #include <opencv2/opencv.hpp> #include <random> #include <istream> #include <ostream> namespace caffe2 { TORCH_API void ClipTransformRGB( ...
1,296
23.942308
42
h
null
pytorch-main/functorch/csrc/dim/arena.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 <ATen/ATen.h> #include "minpybind.h" #ifdef _WIN32 #include <intrin.h> // https://sta...
9,186
26.588589
111
h
null
pytorch-main/functorch/csrc/dim/python_variable_simple.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 // note: pytorch's python variable simple includes pybind which conflicts with minpybind // so ...
1,526
29.54
95
h
null
pytorch-main/modules/detectron/group_spatial_softmax_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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,354
29.584416
79
h
null
pytorch-main/modules/detectron/ps_roi_pool_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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,702
27.755319
77
h
null
pytorch-main/modules/detectron/roi_pool_f_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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,470
29.134146
77
h
null
pytorch-main/modules/detectron/sample_as_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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,551
26.714286
75
h
null
pytorch-main/modules/detectron/select_smooth_l1_loss_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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,515
31.25641
80
h
null
pytorch-main/modules/detectron/sigmoid_cross_entropy_loss_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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,402
29.417722
75
h
null
pytorch-main/modules/detectron/sigmoid_focal_loss_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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,624
30.25
79
h
null
pytorch-main/modules/detectron/smooth_l1_loss_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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,372
30.223684
80
h
null
pytorch-main/modules/detectron/softmax_focal_loss_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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,930
30.858696
79
h
null
pytorch-main/modules/detectron/spatial_narrow_as_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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,745
26.28125
75
h
null
pytorch-main/modules/detectron/upsample_nearest_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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,829
25.448598
75
h
null
pytorch-main/modules/observers/net_observer_reporter.h
#pragma once #include <map> #include "caffe2/core/common.h" #include "caffe2/core/net.h" #include "observers/macros.h" namespace caffe2 { struct PerformanceInformation { // Analytic int64_t flops = 0; int64_t bytes_written = 0; int64_t bytes_read = 0; std::vector<TensorShape> tensor_shapes = {}; std::ve...
927
22.794872
70
h
null
pytorch-main/modules/observers/observer_config.h
#pragma once #include "observers/macros.h" #include "observers/net_observer_reporter.h" #include "caffe2/core/common.h" namespace caffe2 { /* netInitSampleRate_ == 1 && operatorNetSampleRatio_ == 1 : Log operator metrics in every iteration netInitSampleRate_ == 1 && operatorNetSampleRatio_ == 0 : Lo...
3,351
32.52
77
h
null
pytorch-main/modules/observers/perf_observer.h
#pragma once #include "caffe2/core/common.h" #include "caffe2/core/net.h" #include "caffe2/core/observer.h" #include "caffe2/core/timer.h" #include "observers/macros.h" #include <unordered_map> namespace caffe2 { double getClockTimeMilliseconds(); class CAFFE2_OBSERVER_API PerfNetObserver : public NetObserver { p...
1,784
25.641791
79
h
null
pytorch-main/test/cpp/api/support.h
#pragma once #include <test/cpp/common/support.h> #include <gtest/gtest.h> #include <ATen/TensorIndexing.h> #include <c10/util/Exception.h> #include <torch/nn/cloneable.h> #include <torch/types.h> #include <torch/utils.h> #include <string> #include <utility> namespace torch { namespace test { // Lets you use a co...
5,772
28.304569
80
h
null
pytorch-main/test/cpp/common/support.h
#pragma once #include <c10/util/Exception.h> #include <gtest/gtest.h> #include <stdexcept> #include <string> namespace torch { namespace test { #define ASSERT_THROWS_WITH(statement, substring) \ { \ std::string assert_t...
1,526
43.911765
73
h
null
pytorch-main/test/cpp/jit/test_custom_class_registrations.h
#include <torch/custom_class.h> #include <torch/script.h> namespace torch { namespace jit { struct ScalarTypeClass : public torch::CustomClassHolder { ScalarTypeClass(at::ScalarType s) : scalar_type_(s) {} at::ScalarType scalar_type_; }; template <class T> struct MyStackClass : torch::CustomClassHolder { std::...
923
21
73
h
null
pytorch-main/test/cpp/jit/test_utils.h
#pragma once #include <torch/csrc/jit/ir/irparser.h> #include <torch/csrc/jit/runtime/autodiff.h> #include <torch/csrc/jit/runtime/interpreter.h> #include <torch/csrc/jit/testing/file_check.h> namespace { static inline void trim(std::string& s) { s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ...
3,586
33.161905
77
h
null
pytorch-main/test/cpp/lazy/test_lazy_ops_util.h
#pragma once #include <gtest/gtest.h> #include <torch/csrc/lazy/backend/backend_device.h> #include <torch/csrc/lazy/core/debug_util.h> #include <torch/csrc/lazy/core/ir.h> #include <torch/csrc/lazy/core/tensor.h> #include <torch/torch.h> #include <cmath> #include <functional> #include <string> #include <unordered_set...
2,306
27.134146
80
h
null
pytorch-main/test/cpp/rpc/e2e_test_base.h
#include <gtest/gtest.h> #include <torch/csrc/distributed/autograd/context/container.h> #include <torch/csrc/distributed/autograd/context/context.h> #include <torch/csrc/distributed/autograd/engine/dist_engine.h> #include <torch/csrc/distributed/autograd/utils.h> #include <torch/csrc/distributed/c10d/TCPStore.hpp> #in...
5,578
31.248555
80
h
null
pytorch-main/test/cpp/tensorexpr/gtest_assert_float_eq.h
#pragma once #include <cmath> // Copyright 2005, 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 // n...
4,741
38.516667
93
h
null
pytorch-main/test/cpp/tensorexpr/padded_buffer.h
#pragma once #include <string> #include <vector> #include <c10/util/irange.h> #include "torch/csrc/jit/tensorexpr/eval.h" namespace torch { namespace jit { namespace tensorexpr { template <typename T> struct DefaultPaddedValue; template <> struct DefaultPaddedValue<int> { static const int kValue = static_cast<in...
7,034
27.950617
82
h
null
pytorch-main/test/cpp/tensorexpr/test_base.h
#pragma once #if defined(USE_GTEST) #include <gtest/gtest.h> #include <test/cpp/common/support.h> #else #include <cmath> #include "c10/util/Exception.h" #include "test/cpp/tensorexpr/gtest_assert_float_eq.h" #define ASSERT_EQ(x, y, ...) TORCH_INTERNAL_ASSERT((x) == (y), __VA_ARGS__) #define ASSERT_FLOAT_EQ(x, y, ...) ...
2,853
31.431818
80
h
null
pytorch-main/test/cpp/tensorexpr/test_utils.h
#pragma once #include <memory> #include <vector> #include <test/cpp/tensorexpr/test_base.h> #include <torch/csrc/jit/tensorexpr/fwd_decls.h> #include <torch/csrc/jit/testing/file_check.h> namespace torch { namespace jit { using namespace torch::jit::tensorexpr; #define IS_NODE(T, node) \ { ...
2,614
32.101266
66
h
null
pytorch-main/test/custom_backend/custom_backend.h
#include <torch/csrc/jit/backends/backend.h> #include <torch/csrc/jit/backends/backend_detail.h> #include <torch/csrc/jit/api/module.h> namespace torch { namespace custom_backend { // This custom JIT backend is intended to do the minimal amount of work // necessary to test that the JIT backend registration endpoints a...
2,927
30.826087
80
h
null
pytorch-main/test/custom_operator/op.h
#include <torch/script.h> #include <cstddef> #include <vector> #include <string> // clang-format off # if defined(_WIN32) # if defined(custom_ops_EXPORTS) # define CUSTOM_OP_API __declspec(dllexport) # else # define CUSTOM_OP_API __declspec(dllimport) # endif # else # define CUSTOM_OP_API # e...
530
20.24
65
h
null
pytorch-main/test/edge/Evalue.h
#pragma once #include <ATen/ATen.h> /** * WARNING: EValue is a class used by Executorch, for its boxed operators. It * contains similar logic as `IValue` in PyTorch, by providing APIs to convert * boxed values to unboxed values. * * It's mirroring a fbcode internal source file * [`EValue.h`](https://www.internal...
13,932
28.027083
96
h
null
pytorch-main/test/edge/kernel_runtime_context.h
#pragma once namespace torch { namespace executor { /** * Bucket type abstraction that contains many elements of runtime state that * a kernel author may want available, but would otherwise be unable to access. * * Forwarded along to all operators when running in lean mode. NOTE: Will not be * forwarded to opera...
757
33.454545
80
h
null
pytorch-main/test/edge/templates/Functions.h
// clang-format off #pragma once #include <ATen/Context.h> #include <ATen/DeviceGuard.h> #include <ATen/TensorUtils.h> #include <ATen/TracerMode.h> #include <ATen/core/Generator.h> #include <ATen/core/Reduction.h> #include <ATen/core/Tensor.h> #include <c10/core/Scalar.h> #include <c10/core/Storage.h> #include <c10/cor...
574
21.115385
35
h
null
pytorch-main/test/edge/templates/NativeFunctions.h
#pragma once // ${generated_comment} #ifdef TORCH_ASSERT_NO_OPERATORS #error This change adds a dependency on native_functions.yaml, \ meaning the file will need to be re-compiled every time an operator \ is changed or added. Consider if your change would be better placed in \ another file, or i...
1,131
34.375
83
h
null
pytorch-main/third_party/miniz-2.1.0/examples/example1.c
// example1.c - Demonstrates miniz.c's compress() and uncompress() functions (same as zlib's). // Public domain, May 15 2011, Rich Geldreich, richgel99@gmail.com. See "unlicense" statement at the end of tinfl.c. #include <stdio.h> #include "miniz.h" typedef unsigned char uint8; typedef unsigned short uint16; typedef un...
3,109
28.339623
116
c
null
pytorch-main/third_party/miniz-2.1.0/examples/example3.c
// example3.c - Demonstrates how to use miniz.c's deflate() and inflate() functions for simple file compression. // Public domain, May 15 2011, Rich Geldreich, richgel99@gmail.com. See "unlicense" statement at the end of tinfl.c. // For simplicity, this example is limited to files smaller than 4GB, but this is not a li...
6,726
23.914815
122
c
null
pytorch-main/third_party/miniz-2.1.0/examples/example4.c
// example4.c - Uses tinfl.c to decompress a zlib stream in memory to an output file // Public domain, May 15 2011, Rich Geldreich, richgel99@gmail.com. See "unlicense" statement at the end of tinfl.c. #include "miniz_tinfl.h" #include <stdio.h> #include <limits.h> typedef unsigned char uint8; typedef unsigned short u...
2,681
25.038835
129
c
null
pytorch-main/third_party/nvfuser/benchmark/utils.h
#pragma once #include <torch/csrc/jit/codegen/cuda/executor.h> #include <torch/csrc/jit/codegen/cuda/fusion.h> #include <torch/csrc/jit/codegen/cuda/ir_all_nodes.h> #include <torch/csrc/jit/codegen/cuda/ir_utils.h> #include <torch/csrc/jit/codegen/cuda/kernel_cache.h> #include <torch/csrc/jit/codegen/cuda/lower2device...
7,615
36.15122
80
h
null
pytorch-main/third_party/nvfuser/csrc/arith.h
#pragma once #include <c10/macros/Export.h> #include <ir_interface_nodes.h> #include <type.h> #include <type_promotion.h> class Val; /* * The operations defined in this header is intended as user facing functions. * Generally users should not directly instantiate temporary TensorViews they * should instead use t...
24,505
35.197932
80
h
null
pytorch-main/third_party/nvfuser/csrc/compute_at.h
#pragma once #include <inlining.h> #include <root_domain_map.h> #include <transform_replay.h> #include <c10/macros/Export.h> #include <c10/util/Exception.h> #include <deque> #include <unordered_map> #include <unordered_set> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { clas...
1,021
21.217391
77
h
null
pytorch-main/third_party/nvfuser/csrc/compute_at_map.h
#pragma once #include <disjoint_set.h> #include <ir_all_nodes.h> #include <kernel_ir.h> #include <lower_trivial_reductions.h> #include <deque> #include <unordered_map> namespace torch { namespace jit { namespace fuser { namespace cuda { // There's three modes of these iter domain mappings all uniquely important in ...
10,018
36.807547
80
h
null
pytorch-main/third_party/nvfuser/csrc/contiguity.h
#pragma once #include <c10/macros/Export.h> #include <compute_at_map.h> #include <disjoint_set.h> #include <ir_all_nodes.h> #include <lower_shift.h> #include <lower_trivial_broadcast.h> namespace torch { namespace jit { namespace fuser { namespace cuda { // Goes through the transformations associated with a series ...
12,057
37.647436
80
h
null
pytorch-main/third_party/nvfuser/csrc/disjoint_set.h
#pragma once #include <c10/util/Exception.h> #include <algorithm> #include <initializer_list> #include <unordered_map> #include <unordered_set> #include <vector> // For printing of the set when using a Statement as the type for the set #include <ir_base_nodes.h> namespace torch { namespace jit { namespace fuser { n...
9,139
26.613293
83
h
null
pytorch-main/third_party/nvfuser/csrc/dispatch.h
#pragma once #include <c10/macros/Export.h> #include <c10/util/Exception.h> #include <utils.h> #include <unordered_map> // dispatch.h prevents the need from adding manual dispatch in every class that // wants to define how to process a series of nodes. dispatch.h provides 4 // classes that can be inherited providin...
12,148
31.055409
80
h
null
pytorch-main/third_party/nvfuser/csrc/dynamic_type.h
#pragma once #include <c10/macros/Export.h> #include <c10/util/Exception.h> #include <c10/util/variant.h> #include <cmath> #include <iostream> namespace torch { namespace jit { namespace fuser { namespace cuda { class TORCH_CUDA_CU_API IntOrDouble { c10::variant<double, int64_t> value_; public: IntOrDouble(int...
10,968
34.044728
81
h
null
pytorch-main/third_party/nvfuser/csrc/evaluator_common.h
#pragma once #include <dynamic_type.h> #include <executor_kernel_arg.h> #include <executor_launch_params.h> #include <fusion.h> #include <ir_all_nodes.h> #include <lower2device.h> #include <c10/core/DeviceType.h> namespace torch { namespace jit { namespace fuser { namespace cuda { //! This is the common space for ex...
10,558
29.694767
79
h
null
pytorch-main/third_party/nvfuser/csrc/executor.h
#pragma once #include <executor_launch_params.h> #include <executor_utils.h> #include <fusion.h> #include <ir_all_nodes.h> #include <ir_cloner.h> #include <ir_printer.h> #include <kernel_expr_evaluator.h> #include <lower2device.h> #include <utils.h> #include <c10/core/DeviceType.h> namespace torch { namespace jit { n...
11,047
32.377644
87
h
null
pytorch-main/third_party/nvfuser/csrc/executor_kernel_arg.h
#pragma once #include <ATen/core/ivalue.h> #include <ATen/cuda/CUDAGeneratorImpl.h> #include <c10/util/Exception.h> #include <type.h> #include <torch/csrc/jit/ir/ir.h> #include <array> namespace torch { namespace jit { namespace fuser { namespace cuda { // This should match the tensor used in the code generation (al...
10,829
26.211055
80
h
null
pytorch-main/third_party/nvfuser/csrc/executor_launch_params.h
#pragma once #include <type.h> namespace torch { namespace jit { namespace fuser { namespace cuda { class TORCH_CUDA_CU_API LaunchParams { public: static constexpr int64_t UNINITIALIZED_VAL = -1; LaunchParams( int64_t gdimx = UNINITIALIZED_VAL, int64_t gdimy = UNINITIALIZED_VAL, int64_t gdimz ...
3,378
23.664234
79
h
null
pytorch-main/third_party/nvfuser/csrc/executor_utils.h
#pragma once #include <ATen/core/ivalue.h> #include <c10/core/DeviceType.h> #include <c10/util/Exception.h> #include <cuda.h> #include <torch/csrc/jit/ir/ir.h> #include <executor_kernel_arg.h> #include <expr_evaluator.h> #include <fusion.h> #include <ir_all_nodes.h> #include <kernel.h> #include <kernel_expr_evalua...
10,456
32.196825
79
h
null
pytorch-main/third_party/nvfuser/csrc/expr_evaluator.h
#pragma once #include <c10/macros/Export.h> #include <dynamic_type.h> #include <ir_interface_nodes.h> #include <iter_visitor.h> #include <c10/util/Optional.h> #include <string> #include <unordered_map> namespace torch { namespace jit { namespace fuser { namespace cuda { class FusionPrecomputedValues; //! Calculat...
1,739
24.217391
75
h
null
pytorch-main/third_party/nvfuser/csrc/fusion.h
#pragma once #include <ATen/core/ivalue.h> #include <c10/macros/Export.h> #include <c10/util/Exception.h> #include <ir_base_nodes.h> #include <ir_container.h> #include <iter_visitor.h> #include <unordered_map> #include <unordered_set> #include <vector> namespace torch { namespace jit { namespace fuser { namespace c...
9,564
32.096886
80
h
null
pytorch-main/third_party/nvfuser/csrc/fusion_segmenter.h
#pragma once #include <fusion.h> #include <ir_base_nodes.h> #include <kernel_cache.h> #include <scheduler/all_schedulers.h> #include <scheduler/registry.h> #include <utils.h> #include <deque> #include <list> #include <unordered_set> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda...
20,721
31.944356
80
h
null
pytorch-main/third_party/nvfuser/csrc/grouped_reduction.h
#pragma once #include <ir_all_nodes.h> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Horizontally fuse multiple reductions. //! //! Given a list of tensors produced by ReductionOp, create a new //! GroupedReductionOp expression that takes the input tensors of the //! original reductions an...
1,389
32.095238
69
h
null
pytorch-main/third_party/nvfuser/csrc/index_compute.h
#pragma once #include <iter_visitor.h> #include <root_domain_map.h> #include <unordered_map> #include <unordered_set> #include <vector> /* * Index compute takes in a list of indices typically generated from the * surrounding for loop nest. The number of indicies are intended to match the * number of dimensions of...
16,388
35.582589
80
h
null
pytorch-main/third_party/nvfuser/csrc/inlining.h
#pragma once #include <ir_interface_nodes.h> #include <maxinfo_propagator.h> #include <transform_replay.h> #include <memory> #include <unordered_set> namespace torch { namespace jit { namespace fuser { namespace cuda { class MaxPosCalculator { // Root domains in producer that's unmappable to any of its consumers ...
3,386
32.534653
80
h
null
pytorch-main/third_party/nvfuser/csrc/instrumentation.h
#pragma once #include <utils.h> #include <nvToolsExt.h> // NOLINTNEXTLINE(modernize-deprecated-headers) #include <stdio.h> #include <chrono> #include <cstdio> namespace torch { namespace jit { namespace fuser { namespace cuda { namespace inst { //! An optional record of selected timestamped operations, events and ...
2,676
24.254717
79
h
null
pytorch-main/third_party/nvfuser/csrc/ir_base_nodes.h
#pragma once #include <c10/core/ScalarType.h> #include <c10/macros/Export.h> #include <c10/util/Exception.h> #include <c10/util/Optional.h> #include <type.h> #include <utils.h> #include <cstdint> #include <iostream> #include <limits> #include <memory> #include <stdexcept> #include <unordered_map> #include <vector> ...
16,319
30.085714
80
h
null
pytorch-main/third_party/nvfuser/csrc/ir_builder.h
#pragma once #include <fusion.h> #include <ir_all_nodes.h> #include <ir_container.h> namespace torch { namespace jit { namespace fuser { namespace cuda { namespace kir { class Kernel; } class IrCloner; // Passkey for builder to register properties with statements, and to call // functions in IrContainer class TORC...
4,495
30.886525
78
h
null
pytorch-main/third_party/nvfuser/csrc/ir_cloner.h
#pragma once #include <c10/macros/Export.h> #include <dispatch.h> #include <ir_builder.h> #include <unordered_map> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { class IrContainer; //! Clones nodes from an exiting Fusion //! //! \warning IrCloner machinery is a specialized h...
3,832
27.819549
80
h
null
pytorch-main/third_party/nvfuser/csrc/ir_container.h
#pragma once #include <c10/macros/Export.h> #include <ir_base_nodes.h> #include <utils.h> #include <deque> #include <unordered_map> #include <unordered_set> namespace torch { namespace jit { namespace fuser { namespace cuda { class IrBuilderPasskey; class ExprPasskey; class OptOutMutator; class Int; class Bool; c...
5,280
29.177143
79
h
null
pytorch-main/third_party/nvfuser/csrc/ir_graphviz.h
#pragma once #include <c10/macros/Export.h> #include <dispatch.h> #include <sstream> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { // Generates a DOT (https://www.graphviz.org) graph // representation of a f...
3,844
28.351145
77
h
null
pytorch-main/third_party/nvfuser/csrc/ir_interface_nodes.h
#pragma once #include <c10/macros/Export.h> #include <fusion.h> #include <ir_base_nodes.h> #include <ir_internal_nodes.h> #include <mma_type.h> #include <torch/csrc/jit/ir/ir.h> //! Nodes in here are intended to be "user facing" users in this sense being //! those that want to be able to generate CUDA code. namesp...
20,123
32.484193
80
h
null
pytorch-main/third_party/nvfuser/csrc/ir_iostream.h
#pragma once #include <c10/macros/Export.h> #include <dispatch.h> #include <c10/util/irange.h> #include <iostream> namespace torch { namespace jit { namespace fuser { namespace cuda { class Fusion; namespace kir { class Kernel; class Scope; } // namespace kir //! Define pretty printing functions for IR nodes //!...
4,421
26.128834
72
h
null
pytorch-main/third_party/nvfuser/csrc/ir_printer.h
#pragma once #include <c10/macros/Export.h> #include <ir_iostream.h> #include <iter_visitor.h> #include <iostream> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Prints computation Fusion IR nodes //! //! IrMathPrinter and IrTransformPrinter allow the splitting up of fusion print //! func...
1,615
25.933333
80
h
null
pytorch-main/third_party/nvfuser/csrc/ir_utils.h
#pragma once #include <ir_all_nodes.h> #include <type.h> #include <iterator> #include <unordered_map> namespace torch { namespace jit { namespace fuser { namespace cuda { namespace ir_utils { // Replace values in fusion using ValReplacementMutator void replaceValue( Fusion*, const std::unordered_map<Val*, ...
11,988
34.055556
80
h
null
pytorch-main/third_party/nvfuser/csrc/iter_visitor.h
#pragma once #include <c10/macros/Export.h> #include <dispatch.h> #include <type.h> #include <deque> #include <unordered_set> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { class Fusion; class Statement; class Expr; class Val; /* * IterVisitor starts from leaf nodes, fusio...
14,030
38.974359
88
h
null
pytorch-main/third_party/nvfuser/csrc/kernel.h
#pragma once #include <c10/macros/Export.h> #include <fusion.h> #include <ir_base_nodes.h> #include <ir_builder.h> #include <lower_sync_information.h> #include <lower_warp_reduce.h> #include <parallel_dimension_map.h> #include <utils.h> #include <vectorization_info.h> #include <memory> #include <unordered_map> #incl...
7,358
27.523256
80
h
null
pytorch-main/third_party/nvfuser/csrc/kernel_cache.h
#pragma once #include <evaluator_common.h> #include <executor.h> #include <fusion.h> #include <fusion_segmenter.h> #include <scheduler/all_schedulers.h> #include <scheduler/registry.h> #include <c10/macros/Export.h> #include <c10/util/ArrayRef.h> #include <mutex> #include <type_traits> #include <unordered_map> name...
16,677
34.409766
97
h
null
pytorch-main/third_party/nvfuser/csrc/kernel_expr_evaluator.h
#pragma once #include <c10/macros/Export.h> #include <dispatch.h> #include <dynamic_type.h> #include <evaluator_common.h> #include <kernel_ir.h> #include <c10/util/Optional.h> #include <unordered_map> namespace torch { namespace jit { namespace fuser { namespace cuda { class GpuLower; namespace kir { //! Calcu...
1,994
23.9375
74
h
null
pytorch-main/third_party/nvfuser/csrc/kernel_ir.h
#pragma once #include <ir_all_nodes.h> #include <ir_base_nodes.h> #include <parallel_type_bitmap.h> #include <type.h> #include <utils.h> #include <c10/macros/Export.h> #include <c10/util/Optional.h> #include <cstdint> #include <string> #include <unordered_map> #include <vector> namespace torch { namespace jit { nam...
24,348
23.324675
80
h
null
pytorch-main/third_party/nvfuser/csrc/kernel_ir_dispatch.h
#pragma once #include <dispatch.h> namespace torch { namespace jit { namespace fuser { namespace cuda { class Expr; namespace kir { class Predicate; class TensorIndex; class ForLoop; class IfThenElse; class Scope; // Base visitor class that visits all nodes in provided vector<Expr*>. // // Includes visiting throug...
4,500
30.041379
80
h
null
pytorch-main/third_party/nvfuser/csrc/lower2device.h
#pragma once #include <c10/macros/Export.h> #include <compute_at_map.h> #include <ir_all_nodes.h> #include <kernel.h> #include <kernel_ir.h> #include <lower_allocation.h> #include <lower_double_buffer.h> #include <lower_fused_reduction.h> #include <lower_index_hoist.h> #include <lower_predicate.h> #include <lower_pre...
6,832
28.076596
80
h
null
pytorch-main/third_party/nvfuser/csrc/lower_alias_memory.h
#pragma once #include <c10/macros/Export.h> #include <dispatch.h> #include <ir_all_nodes.h> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Reuse Allocation nodes via pointer aliasing //! //! First pass finds candidate TensorViews //! A candidate TensorView is anything in...
925
24.027027
75
h
null
pytorch-main/third_party/nvfuser/csrc/lower_allocation.h
#pragma once #include <c10/macros/Export.h> #include <ir_all_nodes.h> #include <kernel_ir.h> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Buffer allocation information to store in GPU lower to avoid //! logic duplication struct LocalAllocationInfo { kir::Allocate* a...
705
20.393939
77
h
null
pytorch-main/third_party/nvfuser/csrc/lower_bank_conflict.h
#pragma once #include <dynamic_type.h> #include <executor_launch_params.h> #include <ir_base_nodes.h> #include <kernel.h> #include <unordered_map> #include <utility> namespace torch { namespace jit { namespace fuser { namespace cuda { // for more info on shared memory access see page 54-72 of: // https://on-demand....
1,723
35.680851
117
h
null
pytorch-main/third_party/nvfuser/csrc/lower_divisible_split.h
#pragma once #include <c10/macros/Export.h> #include <compute_at_map.h> #include <fusion.h> #include <ir_all_nodes.h> namespace torch { namespace jit { namespace fuser { namespace cuda { // Looks through all transformations assocaited with view, or enforced divisible // vectorization splits and gathers all splits t...
827
26.6
80
h
null
pytorch-main/third_party/nvfuser/csrc/lower_double_buffer.h
#pragma once #include <c10/macros/Export.h> #include <ir_all_nodes.h> #include <kernel_ir.h> #include <kernel_ir_dispatch.h> // Double buffering a tensor doubles its allocation size and uses two // buffers to facilitate computation and memory access // overlapping. The basic form of code looks like as follows: // //...
9,456
36.828
80
h
null
pytorch-main/third_party/nvfuser/csrc/lower_fused_reduction.h
#pragma once #include <ir_all_nodes.h> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Keep track of certain patterns of reductions. //! //! - Allreduce IterDomain: reduced and broadcast domain. class FusedReductionInfo { public: void markAsAllreduce(IterDomain* id); bool isAllreduce(I...
863
23.685714
70
h
null
pytorch-main/third_party/nvfuser/csrc/lower_fusion_simplifier.h
#pragma once #include <c10/macros/Export.h> #include <dispatch.h> #include <fusion.h> #include <ir_all_nodes.h> #include <lower_trivial_reductions.h> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { // Replaces trivial reductions with Unary Set Ops void trivialReductionReplace...
580
20.518519
71
h
null
pytorch-main/third_party/nvfuser/csrc/lower_index.h
#pragma once #include <c10/macros/Export.h> #include <instrumentation.h> #include <kernel_ir.h> #include <kernel_ir_dispatch.h> #include <root_domain_map.h> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { // TODO: Replace with mutator as IndexLowering is replacing expr's with...
4,787
32.25
80
h
null
pytorch-main/third_party/nvfuser/csrc/lower_index_compute.h
#pragma once #include <fusion.h> #include <index_compute.h> namespace torch { namespace jit { namespace fuser { namespace cuda { // Struct to hold useful information from an index pass on iterdomain graph. // Used to return the IndexCompute structure back to the indexing calls in // index_compute.cpp. Other structur...
7,821
39.95288
80
h
null
pytorch-main/third_party/nvfuser/csrc/lower_index_hoist.h
#pragma once #include <ir_all_nodes.h> #include <functional> #include <unordered_map> #include <vector> // Hoisting common index subexpressions // // Class CommonIndexMap is updated during the lowering as new indices // are inserted. An index is uniquely identified with CommonIndexKey, // which consists of the concr...
5,270
32.788462
78
h
null
pytorch-main/third_party/nvfuser/csrc/lower_insert_syncs.h
#pragma once #include <c10/macros/Export.h> #include <ir_all_nodes.h> #include <kernel_ir.h> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Insert sync at end of for-loops to prevent write-after-read race condition. //! //! WAR race condition occurs when the next iterati...
882
26.59375
79
h
null
pytorch-main/third_party/nvfuser/csrc/lower_instrument.h
#pragma once #include <ir_all_nodes.h> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Set up KernelPerformanceProfile of GpuLower when enabled, which //! keeps track of expressions to profile. A new TensorView is added //! for storing profiling results. The expression list is prepended //! ...
753
30.416667
70
h
null
pytorch-main/third_party/nvfuser/csrc/lower_loops.h
#pragma once #include <c10/macros/Export.h> #include <compute_at_map.h> #include <instrumentation.h> #include <ir_all_nodes.h> #include <kernel_ir.h> #include <lower_thread_predicate.h> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Loop nest generator pass will get IR that looks somethin...
1,844
26.132353
79
h
null
pytorch-main/third_party/nvfuser/csrc/lower_magic_zero.h
#pragma once #include <ir_all_nodes.h> #include <kernel_ir.h> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { struct IndexFromIdGraph; //! Insert magic zero definition at the begining of the kernel. Insert magic //! zero update after every (outer most) loop nest with a compil...
2,580
31.670886
79
h
null
pytorch-main/third_party/nvfuser/csrc/lower_misaligned_vectorization.h
#pragma once #include <c10/macros/Export.h> #include <ir_all_nodes.h> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Transform for-loop structure to handle misaligned addresses //! //! Sections of misaligned addresses are handled sequentially //! while aligned addresses u...
2,830
22.991525
79
h
null
pytorch-main/third_party/nvfuser/csrc/lower_predicate_elimination.h
#pragma once #include <c10/macros/Export.h> #include <ir_all_nodes.h> #include <kernel_ir.h> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { class TORCH_CUDA_CU_API PredicateElimination : public IterVisitor { public: void build(Fusion* fusion); //! True if expr does not ...
1,888
28.061538
73
h
null
pytorch-main/third_party/nvfuser/csrc/lower_replace_size.h
#pragma once #include <c10/macros/Export.h> #include <dispatch.h> #include <fusion.h> #include <ir_all_nodes.h> namespace torch { namespace jit { namespace fuser { namespace cuda { // TensorViews are all based on symbolic sizes. When we first initialize them // we don't know if they're inputs or outputs which would...
756
28.115385
78
h
null
pytorch-main/third_party/nvfuser/csrc/lower_shift.h
#pragma once #include <c10/macros/Export.h> #include <dispatch.h> #include <ir_all_nodes.h> #include <kernel_ir.h> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { class LoopIndexing; //! Auxiliary class to represent information about halo of an axis class AxisHaloInfo { pub...
8,349
33.937238
75
h
null
pytorch-main/third_party/nvfuser/csrc/lower_sync_information.h
#pragma once #include <ir_all_nodes.h> #include <parallel_type_bitmap.h> #include <unordered_map> namespace torch { namespace jit { namespace fuser { namespace cuda { class SyncMap { public: std::string toString() const; //! Validates all tensors are consistently parallelized. Basically, //! when a producer...
1,195
25
80
h
null
pytorch-main/third_party/nvfuser/csrc/lower_thread_predicate.h
#pragma once #include <c10/macros/Export.h> #include <ir_all_nodes.h> #include <lower_utils.h> #include <parallel_type_bitmap.h> #include <unordered_map> #include <unordered_set> #include <utility> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Maps TensorViews to a { ParallelTypeBitmap,...
5,449
36.328767
78
h
null
pytorch-main/third_party/nvfuser/csrc/lower_trivial_broadcast.h
#pragma once #include <ir_all_nodes.h> #include <root_domain_map.h> #include <c10/macros/Export.h> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Traverse and collect all concretized broadcast domains. //! //! The traversal first initializes the origin map with broadcast //! domains in inp...
2,164
29.928571
75
h