sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
f72b43b4e7d981d8cd52b12c4ec87a99f634aea1e98f4ae2b32ad0752a39bed1
C/C++
1,903
74
/* Portions of this code are under: Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. */ #ifndef HIP_SHORTCUTS_H_ #define HIP_SHORTCUTS_H_ namespace HipShortcuts { /** * Print hip device memory info */ static void printMemInfo() { size_t free; size_t total; DEBUG_HANDLE_ERROR(hipMemGetInfo(...
03598ad64b22b7b60407ff4ec0bfabb689264d104d64f9afee99f764e521c37c
C/C++
1,914
74
/* * mymodule.h * * This file is part of NEST. * * Copyright (C) 2004 The NEST Initiative * * NEST 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 you...
92d609cebb96261e6ad237d72dfd4d72783f2318ba9fd0d789edada75c93183b
C/C++
1,919
103
#ifndef DYN_SPLINE_H #define DYN_SPLINE_H #include <vector> #include <src/jaz/gravis/t4Vector.h> template <typename T, typename S> class Spline { public: Spline(); Spline(std::vector<T> points); std::vector<T> coeffs_a, coeffs_b, coeffs_c, coeffs_d; T getValue(double t) const...
8e57215b43be540248266b3cb88136fde883cd4c0a0b4e67b63cc03db183db39
C/C++
1,920
73
#ifndef CUDA_BENCHMARK_UTILS_H_ #define CUDA_BENCHMARK_UTILS_H_ //Non-concurrent benchmarking tools (only for Linux) #include <cuda_runtime.h> #include <iostream> #include <fstream> #include <vector> #include <time.h> #include <string> #include <sstream> #ifdef TIMING_FILES #define CTIC(timer,timing) (timer.cuda_cp...
a290b92a01c4af1843aca0a32912dd2ce52c13026357847dbb7ccc56d7c6c83d
C/C++
1,920
62
/****************************************************************************** ** Title: tDeterminants.h ** Description: Templated functions for 2D, 3D and 4D determinants. ** ** Author: Michael Keller, 2005 ** Computer Science Department, University Basel (CH) ** *******************...
b3e2145354d4c4827d7ac8aa483748a13681efdce3bc2265711101e56508e50d
C/C++
1,922
72
#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...
140cc04a6d0d7aadbb16531aa4735aaf6a74cc1fce02d46cd4e6c2994c664bf3
C/C++
1,937
73
#ifndef LATTICE_MOTIF_H #define LATTICE_MOTIF_H #include <src/jaz/gravis/t3Vector.h> #include <src/jaz/gravis/t4Matrix.h> #include "point_cloud.h" #include "motif_detection.h" class Motif { public: static std::vector<std::pair<Motif, double>> discover( const std::vector<PointCloud>& clouds, int neig...
33412bd34798c6277919211c2f67505723ac63d1e26d3697f41a9098945ebb83
C/C++
1,943
73
#ifndef PLOT_SERVER_H #define PLOT_SERVER_H #include "fpga_constants.h" #include "inkube_package.h" #include "helper_functions.h" #include <string> #include <vector> #include <thread> #include <sys/socket.h> #include <sys/un.h> #include <array> #include <cstdint> #include <cstring> #include <iostream> #include <stdex...
3a5a16874b8931cfd1c8df595762148eda768eb89a0fbcab43e378e91f72b1b2
C/C++
1,953
75
#pragma once #include <ATen/Config.h> #include <string> #include <stdexcept> #include <sstream> #include <cufft.h> #include <cufftXt.h> namespace at { namespace native { // This means that max dim is 3 + 2 = 5 with batch dimension and possible // complex dimension constexpr int max_rank = 3; static inline std::str...
ee251bd5a1bb4c982b88f46b9fff1837f495f49f9b9cccdf53fcfa4ebb99311c
C/C++
1,956
44
/*************************************************************************** * * 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...
b5549afe706ba4c1aec85dd240bb057038ae5fade0e01cbe6d704995b22e0cb6
C/C++
1,957
48
#include <ATen/core/Tensor.h> #include <c10/util/Exception.h> namespace at::native { inline void check_pixel_shuffle_shapes(const Tensor& self, int64_t upscale_factor) { TORCH_CHECK(self.dim() >= 3, "pixel_shuffle expects input to have at least 3 dimensions, but got input with ", self.di...
4d165f5e08a96be745a695f6b8d824ae3acf962fb505f26d69d5a301e99b278b
C/C++
1,959
70
#ifndef NUMPY_CORE_INCLUDE_NUMPY_HALFFLOAT_H_ #define NUMPY_CORE_INCLUDE_NUMPY_HALFFLOAT_H_ #include <Python.h> #include <numpy/npy_math.h> #ifdef __cplusplus extern "C" { #endif /* * Half-precision routines */ /* Conversions */ float npy_half_to_float(npy_half h); double npy_half_to_double(npy_half h); npy_half ...
409569b47982b5decf7a0682a7cac45915036923e4097aadcd93cffdae23e588
C/C++
1,969
67
#pragma once #include <c10/core/ScalarType.h> #include <cstdint> namespace at::native::mps { enum class GemvKernel { Standard, T2D, // 2D lane layout, 16-byte loads; vec is implied, kq = k-sublanes }; struct GemvConfig { int nsimd, vec; int kq = 4; // k-sublanes per simdgroup (gemv_t2d only) GemvKernel k...
4026b225d8ee9b1fdbe19312bfce3d46021fb1f182743e0531f9b66ad55971b1
C/C++
1,971
68
#pragma once #include <ATen/Tensor.h> #include <ATen/Config.h> #if AT_MKLDNN_ENABLED() namespace at { namespace native { TORCH_API Tensor mkldnn_convolution_pointwise( const Tensor& input_t, const Tensor& weight_t, const std::optional<Tensor>& bias_opt, IntArrayRef padding, IntArrayRef stride, ...
08283cab49479649f5be155dc5704f57d686cbec349ecbebb1bcb9ce4ae06a27
C/C++
1,981
72
#ifndef DUAL_CONTRAST_WRITER_H #define DUAL_CONTRAST_WRITER_H #include <src/jaz/image/buffered_image.h> #include <src/jaz/image/normalization.h> #include <src/jaz/image/cutting.h> #include <src/jaz/image/raw_image.h> #include <src/jaz/image/raw_image.h> #include <src/jaz/gravis/tRGB.h> #include <src/jaz/gravis/tImage....
d3fa45feb66f66879cda518389d609cd2dedfc49d67254e6b867c4f2a2f14682
C/C++
1,983
58
/* FILE head.h */ /* Header declaration */ struct HEADER { char tag[8]; /* Bytes 0-7 */ char stackname[18]; /* Bytes 8-25 */ int viewing_distance; /* Bytes 26-27 */ int setup; /* Bytes 28-29 */ int touch_count2; /* Bytes 30-31 */ int stacknumber; /* Bytes 32-33 */ i...
5f9fa828d2774bd7871b7bd275a81254234352dd57076fe7e4754aac5fa238a2
C/C++
1,989
29
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2017 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 can o...
ca68e106b1daa6d46f23f839d4f32e96d6bec259b7f69ccc0ca7193e3046c9db
C/C++
1,991
106
#ifndef ACC_PROJECTOR_H_ #define ACC_PROJECTOR_H_ #include "src/complex.h" //#include "src/acc/cuda/cuda_settings.h" //#include "src/acc/cuda/cuda_mem_utils.h" #include "src/acc/acc_ptr.h" //#include <cuda_runtime.h> //#include "src/acc/cuda/cuda_kernels/cuda_device_utils.cuh" #ifdef ALTCPU #include <complex> #elif _S...
53fa66286f81ccabebe650b35eefd5ef4be901d7eb925b0d0b1cc8a92fdcd24a
C/C++
2,002
57
#include <ATen/core/Tensor.h> #include <ATen/native/LinearAlgebraUtils.h> namespace at::native { /* * Given batches of matrices with arbitrary batch dim, * computes the number of batches for Triu and Tril. This ignores stride 0 dimension */ static inline int64_t batchCountTrilTriu(const Tensor& batched_matrices) {...
2f37a3c2ce0e2c7f35e2297fd7561af06006dd8674756d6f4c3b55b3dbdd9336
C/C++
2,008
75
/* Portions of this code are under: Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. */ #ifndef HIP_BENCHMARK_UTILS_H_ #define HIP_BENCHMARK_UTILS_H_ //Non-concurrent benchmarking tools (only for Linux) #include <hip/hip_runtime.h> #include <iostream> #include <fstream> #include <vector> #inclu...
ec3adac95984b126be7032d9b9ba5768da96b92812effd9ccd2aedd815f2fef4
C/C++
2,014
57
#ifndef _NR_UTILS_H_ #define _NR_UTILS_H_ #define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) #if defined(__STDC__) || defined(ANSI) || defined(NRANSI) void nrerror(char error_text[]); double *vector(long nl, long nh); int *ivector(long nl, long nh); unsigned char *cvector(long nl, long nh); unsigned long *lvector(lo...
ff04844eea13d56510135c13c68a9e8d6186660458bc379ed0507f9baa3254a0
C/C++
2,014
60
/* FILE head.h */ /* Header declaration */ #define int short struct HEADER { char tag[8]; /* Bytes 0-7 */ char stackname[18]; /* Bytes 8-25 */ int viewing_distance; /* Bytes 26-27 */ int setup; /* Bytes 28-29 */ int touch_count2; /* Bytes 30-31 */ int stacknumber; /* B...
fa48650eedc731e2c8c7bdd78513e1312ad342da88f8ea5b702df62e750163dd
C/C++
2,024
101
#ifndef ACC_BACKPROJECTOR_H_ #define ACC_BACKPROJECTOR_H_ #ifdef _CUDA_ENABLED # include <cuda_runtime.h> using deviceStream_t = cudaStream_t; #elif _HIP_ENABLED # include <hip/hip_runtime.h> using deviceStream_t = hipStream_t; #elif _SYCL_ENABLED # include "src/acc/sycl/sycl_virtual_dev.h" using deviceStream_t = v...
97f33c8cfe37e29fcdd6fc3e05dd789fd797fa1c7df297521018566ea5d7ce65
C/C++
2,036
45
// 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/. #ifndef EIGEN_MATH_FUNCTIO...
c2ecc365044ff310ebdad8a85074e22f10cd0d9d5af65c2fd2fd49762ff17ff8
C/C++
2,039
40
#pragma once #include <ATen/core/Tensor.h> #include <ATen/native/DispatchStub.h> #include <ATen/native/PoolingChecks.h> #include <c10/util/ArrayRef.h> #include <c10/util/irange.h> #include <cmath> namespace at::native { using adaptive_avg_pooling2d_fn = void(*)(Tensor& output, const Tensor& input, IntArrayRef output...
5077344479cdc7944fc2f0d05f313c94b9816319bf769bd60c93fb8d5cadf06d
C/C++
2,041
75
/*************************************************************************** * * 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...
805f1a80947b2789675e0259f196642ac291b315fbdf06e3ae5fa0332956237f
C/C++
2,044
89
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2015 Benoit Steiner <benoit.steiner.goog@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 ca...
38a9da11640f3c3bad5d57da2085919f7aa5c2d040cfc383fe5a29fd6f32c847
C/C++
2,057
78
/*************************************************************************** * * 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...
7dde1919d94d2ff74c301c70bd457973adc7dab9fbee8880a70466091487e31e
C/C++
2,058
54
//******************************************************************************************************************** // FileDataBucket.h //******************************************************************************************************************** //#pragma once #include "TimeBuf.h" const uintd MaxDataSource...
8048b9d11055be968181910dcf335f9fc440faab8a414906744ad4e3327849da
C/C++
2,060
54
/*************************************************************************** * * 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...
c27ad3170620ca85ee088c508b0b9916104956cd8869574c32fb9a370c8268ad
C/C++
2,071
78
#pragma once #include <ostream> #include <sstream> namespace c10 { template<typename T> inline void FunctionSchema::checkArg( const IValue& value, const Argument& argument, std::optional<size_t> pos) const { if (value.isTensor() && argument.type() == TensorType::get()) { // Fast-path for the common ...
1d4e752316e276e554699caec306d176183a164b99c7f657e365abaff7d61615
C/C++
2,077
90
#pragma once #include <ATen/core/function.h> #include <ATen/core/ivalue.h> #include <c10/util/Exception.h> #include <c10/util/intrusive_ptr.h> #include <functional> #include <utility> namespace torch::jit { struct BuiltinOpFunction : public Function { BuiltinOpFunction( c10::QualifiedName qualname, c10...
abae288f218ab21a04ec6a4e109bb4f6f0f4e7b5cf5b2ed9b5b19a3b2f208618
C/C++
2,079
55
/* * Copyright (C) 1995,1996,2001,2022 Bernd Feige * This file is part of avg_q and released under the GPL v3 (see avg_q/COPYING). */ /* This include file defines the data structures necessary to implement * an architecture- and compiler-independent reading of structures into * memory. -- Bernd Feige 6.08.199...
e4ee7b771f832e6923f650fcf0db70532820f676016f86818c60e3f08fbca61d
C/C++
2,085
77
#ifndef NEW_VTK_HELPER_H #define NEW_VTK_HELPER_H #include <src/jaz/image/buffered_image.h> #include <src/jaz/gravis/t3Vector.h> #include <src/jaz/math/tensor3x3.h> class NewVtkHelper { public: template <class T> static void writeR3(const RawImage<gravis::t3Vector<T>>& img, std::string fn); template <cla...
33ccf7e77b7d874f55ac5d1a8443d7df7f753dbd6c00ad2ec987bf3f37e16c0a
C/C++
2,088
82
#ifndef CPU_BENCHMARK_UTILS_H_ #define CPU_BENCHMARK_UTILS_H_ #define CTIC(timer,timing) #define CTOC(timer,timing) #define GTIC(timer,timing) #define GTOC(timer,timing) #define GATHERGPUTIMINGS(timer) namespace CpuKernels { //Non-concurrent benchmarking tools (only for Linux) /* //#include <cuda_runtime.h> #inc...
73ca08955937759e397fc7927335914401214622e9ade580d483a4357c9bb6a4
C/C++
2,091
52
#pragma once #include <c10/macros/Macros.h> C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wdeprecated-declarations") C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wobjc-property-no-attribute") #include <MetalPerformanceShadersGraph/MetalPerformanceShadersGraph.h> C10_DIAGNOSTIC_POP() C10_DIAGNOSTIC_POP() #if !defined(...
5ad5de5927c099c3bc5740a26540ac43b5a4ad58447a353604473da1f29cbf00
C/C++
2,100
85
#ifndef TOMO_MAG_FIT_H #define TOMO_MAG_FIT_H #include <src/jaz/tomography/tomogram.h> #include <src/jaz/tomography/particle_set.h> #include <src/jaz/tomography/reference_map.h> #include <src/jaz/optics/magnification_helper.h> class TomoMagFit { public: TomoMagFit( const std::vector<ParticleIndex>& particle_...
0f1f6efaaa5b794777b339ab0542b58b2b8f407d940fbd2f367de25605c2a604
C/C++
2,101
71
#pragma once #include <ATen/TensorIndexing.h> #include <ATen/core/Tensor.h> #include <ATen/native/IndexingUtils.h> #include <ATen/native/TensorIterator.h> namespace at::native { namespace { #ifndef STRIP_ERROR_MESSAGES inline std::string shapes_as_str(TensorList tensors) { std::ostringstream os; bool first = true;...
6d6d712fbd6adce85db3bc10577de8d63818966fe43abcc52c5452d65a12135d
C/C++
2,112
54
//******************************************************************************************************************** // FileDataBucket.h //******************************************************************************************************************** //#pragma once #include "TimeBuf.h" const uintd MaxData...
73e73652fcf87b0a07e6a3e4aa82f4bce59733a72c24ee10797d36e886799961
C/C++
2,118
54
// 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...
8cb0d738f454c84b9910b87017748a8d1a961564d94e95b0af80957e0657a177
C/C++
2,135
85
#ifndef BACKPROJECT_PROGRAM_H #define BACKPROJECT_PROGRAM_H #include <string> #include <src/jaz/image/buffered_image.h> #include <src/jaz/tomography/optimisation_set.h> class TomogramSet; class ParticleSet; class AberrationsCache; class ParticleIndex; class ReconstructParticleProgram { public: ReconstructPart...
75eafeb8c39c6bd54cc55988fe0e431b321b0618584cbb061f553bdc4b2c2b35
C/C++
2,137
75
#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/irange.h> namespace at { namespace vec { // See Note [CPU_CAPABILITY namespace] inline namespace CPU_CAPABILITY { inline std::tuple<Vectorized<float>, Vectorized<fl...
e9562f8ec445cb95796a57d52a6032a3c71934326f217ec49b41e24693b94ba0
C/C++
2,163
84
#ifndef __GRAVIS__COLOUR__HSV__ #define __GRAVIS__COLOUR__HSV__ #include "../tRGBA.h" // Author: Reinhard Knothe // Extracted: Brian Schroeder /**********************************************************************/ /* hsv2rgb: */ /***************************...
183955a82a033d1bc420372eb6315b9445520abd8533d704970ecfa3f851e02a
C/C++
2,165
87
/*************************************************************************** * * 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...
4a7b100d1f18f0ede3f008080a19ed9de7f469bc326dfd376e3a4595de904403
C/C++
2,165
86
/* * This file is part of Healpix_cxx. * * Healpix_cxx 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. * * Healpix_cxx is...
ceacdb41e97fba90eba728d0d3e938061580a88f86933db7d5f8a0eaaad4bc2d
C/C++
2,175
73
#ifndef MetalNeuronType_h #define MetalNeuronType_h #include <c10/macros/Macros.h> #import <ATen/native/metal/mpscnn/MPSCNNNeuronOp.h> C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wdeprecated-declarations") #import <MetalPerformanceShaders/MetalPerformanceShaders.h> C10_DIAGNOSTIC_POP() #include <ATen/ATen.h> names...
f8b6914f91c7bdcc757c999289c0b3ac42b0b7d4688d0051614048e1d5d0c244
C/C++
2,179
65
#pragma once #include <string> #include <stdexcept> #include <sstream> #include <mkl_dfti.h> #include <mkl_spblas.h> #include <c10/util/Exception.h> namespace at::native { static inline void MKL_DFTI_CHECK(MKL_INT status) { TORCH_CHECK(!status || DftiErrorClass(status, DFTI_NO_ERROR), "MKL FFT error: ", DftiErrorM...
167fffd68df99cb06185f0c815832d621f0a73d9bab553bc2bbd0db20d2b940f
C/C++
2,181
92
#ifndef BFACTOR_REFINER_H #define BFACTOR_REFINER_H #include <src/image.h> #include <src/jaz/gravis/t2Vector.h> class IOParser; class ReferenceMap; class ObservationModel; class BFactorRefiner { public: BFactorRefiner(); void read(IOParser& parser, int argc, char *argv[]); void init( int verb, i...
938a4d50d35a447f972dac26437174495553e6b67e8a902579877e624ebd4802
C/C++
2,186
69
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2019 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 can ob...
841252065e99831239243eb143185890f527b8bfb58699da7dad78b11c47accc
C/C++
2,195
88
#ifndef CUDA_DEVICE_MEM_UTILS_H_ #define CUDA_DEVICE_MEM_UTILS_H_ #ifdef _CUDA_ENABLED #include <cuda_runtime.h> #include <curand.h> #include "src/acc/cuda/cuda_settings.h" #include "src/acc/cuda/custom_allocator.cuh" #endif #include <signal.h> #include <fstream> #include <iostream> #include <vector> #include <stdio...
93c597dd633a90aacfc1a9f5f22ae6cc7bab1daeec428035d572af58b2c57a35
C/C++
2,195
90
/* * 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 ...
4e751bda540aa23b69e2d37fc44025a9b0458248655212f5b12a570fcd516b6a
C/C++
2,200
54
/* * 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 <stddef.h> #include <stdint.h> #include <qnnpack/common.h> #include <qnnpack/...
16ed38dbdd4c31da0ba61042131dc8706f24b9fdd850fda67cfce1d465b83bd1
C/C++
2,207
65
//******************************************************************************************************************** // Processor.h //******************************************************************************************************************** #include "FileDataBucket.h" #include "GeneralOperations.h" //para...
238b8a5204635df854d58b4c7bf91b1346dec598060676a1c343bc850038b28f
C/C++
2,209
46
/*************************************************************************************************** * 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...
386f11aca992753177dc1df4f40dcd951035e725b1ff81f9318dd1ae7ec743f9
C/C++
2,215
70
// 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...
c0b2c16ec50f588963cface5af64821d5c9cd0335af44781ff6bf3ced648fe65
C/C++
2,230
55
// 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...
3f15fb4483343d97512f82a476b7ff004301a37e62e6bd3ed73b9ef4b24a94dd
C/C++
2,239
81
/*************************************************************************** * * 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...
4c3a94c17e2addf7159980f85cb718130cd503b40c8006152676faff842757eb
C/C++
2,240
62
#pragma once #include <ATen/core/List.h> #include <ATen/native/ConvUtils.h> namespace at::native::quantized { namespace { // MakeConvOutputShape used from both CPU and CUDA libraries // and exporting symbol from torch_cpu would probably take more storage // than duplicating implementation which likely be inlined away ...
ea0679afee475fe0d5807e66ab126d3fb5106ed4861a1ed2263954308d3ce6eb
C/C++
2,246
61
// Stateless Philox-4x32 PRNG implementation for CPU. // // CPU counterpart of ATen/cuda/StatelessPhilox4x32.cuh. Given (seed, offset) // returns 4 pseudo-random uint32 values with no mutable state. // // The Philox-4x32 cipher operates on a 128-bit counter. The full counter // is (offset_lo, offset_hi, subsequence_lo,...
1ce8a936be4e434ede42ca12d738e922ce1e5c3c4e57183515c38b311a6edb02
C/C++
2,251
64
/* * This file is part of Healpix_cxx. * * Healpix_cxx 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. * * Healpix_cxx is...
53c3d754e168bfeb19e84b4481c4e8001b6c57d5c83c24a80cae36fa71bc46f7
C/C++
2,252
59
/*************************************************************************** * * 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...
d55629f73fb737a3dd5c7a4fabc977c2afb1b54bcd83bdabde7458414df60243
C/C++
2,262
112
#ifndef __LIBGRAVIS_STRING_FORMAT_H__ #define __LIBGRAVIS_STRING_FORMAT_H__ #include <sstream> #include <iomanip> #include <stdint.h> namespace gravis { /** * Usage * std::string name = StringFormat("Dies sind ")(12)(" Zahlen."); * std::string name = StringFormat("Dies sind ")(12, 4, '0')(" Zahlen."); ...
61354b5f72fa1f0a1a4b2a897fb646d8962b52032555e70c74a8ece49057b614
C/C++
2,272
65
//******************************************************************************************************************** // Processor.h //******************************************************************************************************************** #include "FileDataBucket.h" #include "GeneralOperations.h" ...
f3b9a3e6d64adcd1204e503baf0bf1d6c18b740a986f72d1a03303cb3c7f7591
C/C++
2,272
71
#pragma once #include <ATen/core/Tensor.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/TensorUtils.h> namespace at::native { inline void multilabel_margin_loss_shape_check( int64_t& nframe, int64_t& dim, const int64_t& ndims, const Tensor& input, const Tensor& targe...
2a6028a0f08d37a64f706478f9338722a3fec00542155690ea0b9f6dec6a39a7
C/C++
2,279
79
#ifndef __LIBGRAVIS_PROGRAM_OPTIONS_H__ #define __LIBGRAVIS_PROGRAM_OPTIONS_H__ /** * \file * This headers includes the boost program options header, disabling the warnings such that we can still have our programs compile with -Werror * Also it defines the MACROS PO_SWITCH and PO_VALUE, which make option definitions...
65a8a8a7b3cf738c22cb8fd5447c4a918135a100f58528f8687a3318f4851cc4
C/C++
2,279
75
/*************************************************************************** * * 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...
62b939a9d79db3be5bebdff401c9dd4d9d0c8a5ba64c4280a2789df7b8535fbc
C/C++
2,284
91
/* Portions of this code are under: Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. */ #ifndef HIP_DEVICE_MEM_UTILS_H_ #define HIP_DEVICE_MEM_UTILS_H_ #ifdef _HIP_ENABLED #include <hip/hip_runtime.h> #include <hiprand/hiprand.h> #include "src/acc/hip/hip_settings.h" #include "src/acc/hip/custom...
98285d85bc7823816bc59ec258914aadf9e31f2d448279121cd1597b5a143ad3
C/C++
2,289
68
#pragma once #include <ATen/core/Tensor.h> #include <ATen/Config.h> #if AT_MKLDNN_ENABLED() #include <ideep.hpp> #include <dnnl.hpp> #ifndef DNNL_PREREQ // oneDNN version check macro // Checks if the current oneDNN version is >= the specified version #if defined(DNNL_VERSION_MAJOR) && defined(DNNL_VERSION_MINOR) && ...
3f5f0b88547cf2a3a5296b3712ae9ba7f2b7b22e9598dbf2d36918b084f7b473
C/C++
2,293
93
#pragma once #include <c10/util/Exception.h> #include <c10/util/ParallelGuard.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 ...
0c9d62d83922e39a251d887be6a9c0fb754d95e5a74699cca6abd0fe5b2fa223
C/C++
2,345
95
#pragma once #include <ATen/core/TensorBody.h> #include <c10/util/Exception.h> namespace at { // NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) class TORCH_API OptionalTensorRef { public: OptionalTensorRef() = default; ~OptionalTensorRef() { ref_.unsafeReleaseTensorImpl(); } OptionalTensorR...
6cd11e91239bd48615ab67ebfe3cba9e6af1f7e2b6fe295dd3dd835bb21fdd5d
C/C++
2,348
92
/****************************************************************************** ** Title: tArrayIO.h ** Description: Input/Output for tArrays. ** ** Author: Michael Keller, 2006 ** Computer Science Department, University Basel (CH) ** **************************************************...
59c1a566a7b34269cf65b7f4f70106d4f2c277d7841c0afa6f96c65bf50151da
C/C++
2,349
62
#pragma once #include <c10/metal/common.h> // N is the maximum allowed number of dimensions in the input and outputs. The // maximum allowed pooling dimensions is N-2, because the input may have up to 2 // leading dimensions that are not pooled. To support up to 3-D pooling, N=5 is // the default. template <unsigned N...
a4a0cdb9c72ff873bb6b6a2754d27487c5340db6b48bee3dc8e7d709926b239c
C/C++
2,359
95
#pragma once #include <ATen/Tensor.h> #include <ATen/core/ivalue.h> #include <ATen/native/mkldnn/Common.h> #if AT_MKLDNN_ENABLED() namespace at::native::mkldnn { const static std::map<std::string, ideep::attr_t> fusion_attr_map = { {"none", ideep::attr_t()}, {"relu", ideep::attr_t::fuse_relu()}, }; using S...
9d2b27d905eaf32f0c9db88d165853be7942461afc65a37d2d09a6d60f584274
C/C++
2,369
64
#pragma once namespace at::native { inline namespace CPU_CAPABILITY { // n: number of function arguments (arity) // traits: function_traits (see FunctionTraits.h) // s: index of scalar argument or -1 template <int n, int stride_index, typename traits, int s=-1> struct IsContiguous { static bool eval(const int64_t* ...
41fe4082a12665e2d34f3ea28e6cbf5cf57bcb931618ee9e7e563b3bcad52d2b
C/C++
2,376
93
#ifndef TOMO_CTF_FIND_H #define TOMO_CTF_FIND_H #include <string> #include <src/jaz/optimization/optimization.h> #include <src/jaz/image/raw_image.h> #include <src/jaz/image/cutting.h> #include <src/jaz/image/resampling.h> #include <src/jaz/gravis/t4Matrix.h> #include <src/jaz/gravis/t2Vector.h> #include <src/error.h...
40c21b1bfe20129d9e1d4bfffeb1c4ade89a3a12243a1ebfdb646734949276e6
C/C++
2,381
86
/*************************************************************************** * * 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...
9fda256c0e83c1e2cbeea54ab64857386522dbba4ba2bc0fe3a1f9208a409e00
C/C++
2,381
92
#pragma once #include <utility> #include <c10/util/ArrayRef.h> #include <ATen/core/List.h> namespace at { // This class allows you to write variadic functions which // call a (possibly overloaded) function on each argument, // in order. This is most commonly used in autogenerated code, // where it is convenient to...
d18d56f5b06b38de00d21c2b7d8488fb3688f2cd51fe48d35a44f289815e8319
C/C++
2,399
71
#include <ATen/Tensor.h> #include <ATen/native/metal/MetalContext.h> #include <ATen/native/metal/MetalCommandBuffer.h> #include <ATen/native/metal/MetalTensorImpl.h> #include <ATen/native/metal/MetalTensorImplStorage.h> #if (defined(__ARM_NEON__) || defined(__ARM_NEON)) typedef float16_t fp16_t; #else typedef uint16_t...
07d71c9be68f25c94d2f5e41e9341faa13534cd40493d88596e9fd2d0dea42a0
C/C++
2,400
105
#pragma once #include <ATen/core/Tensor.h> namespace at::native { // Check the pointer and stride alignment cuDNN requires for varlen tensors. bool has_aligned_varlen_layout(const Tensor& tensor); void run_cudnn_SDP_fprop( int64_t b, int64_t h, int64_t s_q, int64_t s_kv, int64_t d_k, int64_t ...
9c03c3dcae519b8c3095ceec8421d7d7bebb5764af5463bba17188f5ea193d62
C/C++
2,400
90
#pragma once #include <ATen/core/Tensor.h> #include <ATen/Config.h> #include <ATen/native/LinearAlgebraUtils.h> // For TransposeType namespace at::native { // result = beta * result + alpha * gemm(mat1, mat2) TORCH_API void mkldnn_matmul( const Tensor &mat1, const Tensor &mat2, const Tensor ...
4da30e608310e2df385ca137f6fc8ce0805477a14d645d9217b6a0623d62270b
C/C++
2,401
78
#pragma once #include <c10/core/Device.h> #include <c10/util/Exception.h> #include <c10/util/Registry.h> #include <ATen/detail/AcceleratorHooksInterface.h> namespace at { constexpr const char* XLA_HELP = "This error has occurred because you are trying " "to use some XLA functionality, but the XLA library has n...
eaad0325f8dd341540a72c4203b52a5b15846a6e799b5a162eb227aa370b01db
C/C++
2,406
68
#pragma once #include <c10/core/DispatchKeySet.h> #include <c10/macros/Macros.h> #include <c10/util/Metaprogramming.h> #include <c10/util/Type.h> #include <cstring> #include <typeindex> namespace c10::impl { // A CppSignature object holds RTTI information about a C++ function signature // at runtime and can compare ...
fc7e24d6de4c2fb3959f850333e440b7fd3fbd5e214f902fb7cbc06ea834fff1
C/C++
2,410
75
// Copyright © 2022 Apple Inc. #pragma once #include <ATen/Generator.h> #include <ATen/detail/MPSHooksInterface.h> #include <ATen/mps/MPSEvent.h> #include <optional> namespace at::mps { // The real implementation of MPSHooksInterface struct MPSHooks : public at::MPSHooksInterface { MPSHooks() {} void init() co...
6fc81cc54fdf3d3b199f067bdac8e3c3c11fb968e51da507d7d91f5f71383899
C/C++
2,411
57
/* FILE array.h */ /* Definitions/declarations common to array.c and list.c */ #include <stdio.h> #include <ctype.h> #include "defs.h" /* Channel definitions */ /* ******************************************************************** */ #define MAX_REGISTERS 135 /* Accumulator to store trials (162,106,55) */ #defi...
8ce5a28533aeb4ce4576d606454f4188a2601f9a2fb7caa28d380c17020501c2
C/C++
2,413
46
#pragma once #include <ATen/core/ivalue.h> #include <ATen/core/stack.h> #include <ATen/core/boxing/KernelFunction.h> #include <ATen/core/dispatch/Dispatcher.h> #include <c10/util/Metaprogramming.h> #include <torch/library.h> namespace at::native { // This function implements a boxed fallback to CPU. // External back...
c3c25592ef66e97dd7652571279867751b9697f2f776e785698b431d941e6cdc
C/C++
2,417
70
#ifndef UDP_RECEIVER_H #define UDP_RECEIVER_H #include "udp_client.h" #include "inkube_package.h" #include "helper_functions.h" #include <vector> #include <string> #include <thread> #include <atomic> #include <sys/socket.h> #include <sys/un.h> #include <poll.h> #include <array> #include <zmq.hpp> #include <iostream> ...
cce97d92a4d2e61ce4f55a9a21e70e24b47b8ac2cc2bdd25c85fd000eef2f217
C/C++
2,426
86
#pragma once #include <ATen/core/GeneratorForPrivateuseone.h> #include <ATen/detail/AcceleratorHooksInterface.h> #include <c10/core/Allocator.h> #include <c10/core/Device.h> #include <c10/core/Storage.h> #include <c10/util/Exception.h> namespace at { struct TORCH_API PrivateUse1HooksInterface : AcceleratorHooksInt...
a85f1f47dc58e94791a196362c700146daf22313da20fc1eb3c5e83422765811
C/C++
2,435
68
// 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...
dcf2bb1e13bb4b06cfa752486e1a627514b76c8d336262a6d9710c2a0a355a0a
C/C++
2,436
58
/* * 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 <stddef.h> #include <stdint.h> #include <qnnpack/common.h> #include <qnnpack/...
9cd058e38cc96c40e75d32ab86a4adf9d6eea9ca2ceed8f671b9eb517ba961d3
C/C++
2,437
130
#ifndef GP_MOTION_MODEL_H #define GP_MOTION_MODEL_H #include <src/jaz/gravis/t3Vector.h> #include <src/jaz/tomography/particle_set.h> class Tomogram; class GPMotionModel { public: struct Parameters { double sig_vel, sig_div; bool params_scaled_by_dose, sqExpKernel; int maxEDs; }; GPMo...
08e5946b7eec395f1e0f1ee6c44a1b4d7a7dba62743af6bc77def973c1e7afe7
C/C++
2,439
66
/*************************************************************************** * * 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...
21c91dd9219b2fb6d2c4527e0e4968a416ec76be67f93b78190423f887757ce2
C/C++
2,446
61
#pragma once #include <c10/util/complex.h> #include <ATen/NumericUtils.h> namespace at::native { inline namespace CPU_CAPABILITY { // custom min and max to be used in logcumsumexp for complex arguments template <typename scalar_t> std::pair<c10::complex<scalar_t>, c10::complex<scalar_t>> _logcumsumexp_minmax(c10::co...
9284b6ef5cad17e2ac2dedd9ae6017ea7c7f2e3a759c2213cfe6fc913ce268ad
C/C++
2,458
85
// 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 ...
b9e875c35e4e1d901b947cb241bdd9a295d4a0cd1db44ddf36e4471335a380d4
C/C++
2,461
110
#pragma once #include <iterator> #include <list> #include <unordered_map> #include <utility> namespace at::native::onednn { template < class key_t, class value_t, template <typename...> class map_t = std::unordered_map> class lru_cache { public: using value_type = std::pair<key_t, value_t>; using li...
a9324e884bc344cfc997afa83d40fa757c3b7a0795ed9d0bffc4e1f079d83077
C/C++
2,468
92
/*************************************************************************** * * 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...
946281f7a96d4fa6d1a5daf5a4fdba970d770a5c9480c10788dd8d8bcd5e1d6b
C/C++
2,469
67
#include <ATen/AccumulateType.h> #include <c10/core/Scalar.h> #include <limits> namespace at::native { inline void arange_check_bounds( const c10::Scalar& start, const c10::Scalar& end, const c10::Scalar& step) { // use double precision for validation to avoid precision issues double dstart = start....
a6a287f115b7f183548e89d89aa4fd99e7a99b7edcc915aef3de70e16c3ccdbc
C/C++
2,469
86
/*************************************************************************** * * 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...
361725a9899fc9e0521e63e17607488df80a26f017f42af1d00370310b0bd838
C/C++
2,472
50
/*************************************************************************** * * 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...
0e045a6e9a9e959ebf9d947f341d1f68d57b7936aba0a64b70f88102f46a1bb0
C/C++
2,486
68
#pragma once #include <c10/core/SafePyObject.h> #include <c10/macros/Export.h> #include <c10/util/python_stub.h> #include <optional> #include <stack> #include <string> #include <utility> namespace at { namespace impl { struct TORCH_API SavedTensorDefaultHooksTLS { // PyObject is defined in c10/util/python_stub.h...
74c34c9f6e8c5a6f78c08a39df85c10945b750c3c400b1c706eb3ef8c5a1705e
C/C++
2,487
77
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2016 Benoit Steiner <benoit.steiner.goog@gmail.com> // Copyright (C) 2019 Rasmus Munk Larsen <rmlarsen@google.com> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If ...