text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <cuda.h> #include "bondsStructs.h" #include "bondsKernelsGpu.cu" #include "bondsKernelsCpu.cu" #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define MAX(a, b) (((a) > (b)) ? (a) : (b)) int monthLengthCpu(int month, bool leapYear) { ...
the_stack
#include <algorithm> #include <fstream> #include <memory> #include <string> #include <future> #include <condition_variable> #include <mutex> #include <thread> #include <queue> #include <functional> #if defined(_WIN32) # include <Windows.h> # include <wingdi.h> # include <Shlwapi.h> # pragma comment(lib, "shlwapi.lib...
the_stack
\brief Defines a math function */ #include <algorithm> #include <stdexcept> #include <iomanip> #include <cstring> #include <fstream> #include <sstream> #ifdef __unix__ #include <unistd.h> #elif defined(_WIN32) || defined(WIN32) #include <windows.h> #else // sleep not supported #endif #include "options.h" #include "o...
the_stack
//////////////////////////////////////////////////////////////////////////// // B spline smoothing kernel //////////////////////////////////////////////////////////////////////////// __device__ double W(double3 p_pos, double3 q_pos, double h) { double r = sqrt((p_pos.x-q_pos.x)*(p_pos.x-q_pos.x) ...
the_stack
//#include "util.h" #include "util.cuh" #include "util_type.h" #include "util_type_internal.h" #include "util_func.h" #include "update_ops_cuda.h" #include "update_ops_cuda_device_functions.h" #include <assert.h> __constant__ GTYPE matrix_const_gpu[4]; __constant__ UINT insert_index_list_gpu[30]; __host__ void singl...
the_stack
#include <raft/random/rng.cuh> #include <rmm/exec_policy.hpp> #include <tuple> namespace cugraph { namespace detail { template <typename vertex_t, typename weight_t> std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, std::optional<rmm::device_uvector<weight_t>>> shuffle_e...
the_stack
#define CUDA_1D_KERNEL_LOOP(i, n) \ for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < n; \ i += blockDim.x * gridDim.x) #define THREADS_PER_BLOCK 1024 inline int GET_BLOCKS(const int N) { int optimal_block_num = (N + THREADS_PER_BLOCK - 1) / THREADS_PER_BLOCK; int max_blo...
the_stack
/** * Copyright (c) 2021 Darius Rückert * Licensed under the MIT License. * See LICENSE file for more information. */ #include "saiga/cuda/device_helper.h" #include "saiga/cuda/imageProcessing/imageProcessing.h" #include "saiga/cuda/shfl_helper.h" namespace Saiga { namespace CUDA { //todo maybe change static __...
the_stack
#define restrict __restrict #define max(a,b) ((a<b)?b:a) #define min(a,b) ((a<b)?a:b) const int WSIZE = 12000; // Walker const int NSIZE = 2003; // Values const int MSIZE = NSIZE*3+3; // Gradient vectors const int OSIZE = NSIZE*9+9; // Hessian Matrices const int NSIZE_round = NSIZE%16 ...
the_stack
// configuration //#include <portinfo> // STL #include <complex> // pyre #include <pyre/journal.h> // cuda #include <cuda_runtime.h> #include <cooperative_groups.h> // pull the declarations #include "kernels.h" // the correlation kernel template <std::size_t T, typename value_t = float> __global__ void _correlate(con...
the_stack
extern "C" { __device__ __inline__ unsigned int AsUint(float *sourceImage, int pixelId) { return *(((unsigned int*)sourceImage) + pixelId); } __device__ __inline__ unsigned int GetComponent(unsigned int pixel, int comp) { return (pixel >> (comp * 8)) & 0xFF; } /* Draws a background color into a 3-componen...
the_stack
#include "solve.h" #include <cuda.h> #include <cuda_runtime_api.h> #include <iostream> #ifdef _WIN32 typedef unsigned int uint32_t; //typedef unsigned short uint32_t; #endif using namespace std; #define PROFILE 0 #define USE_GRID 1 #define USE_BOX_PRUNING 0 #define kRadius 0.1f #define kMaxRadius (kRadius) #defin...
the_stack
namespace lightseq { namespace cuda { /** @brief: ker_split_multilg_request the format of request in multilingual: e.g. <en> <de> <hello> <world> <.> request shape: [batch_size, src_seq_len + 2] request = numpy.concatenate((src_lang_id, trg_lang_id, src_token_id), axis=1) @thread gridDim.x = (nele + MAX_THREADS ...
the_stack
#include <algorithm> #include <limits> #include <nppdefs.h> #include "cuda_runtime.h" #include "device_launch_parameters.h" #include "bbcu/bbcu.h" #include "bbcu/bbcu_util.h" #include "Common.cuh" // --------------------------------- // IsNan // --------------------------------- template<typename T> __global__ ...
the_stack
#include "dali/kernels/normalize/normalize_gpu.h" // NOLINT #include "dali/kernels/normalize/normalize_gpu_impl.cuh" // NOLINT #include <gtest/gtest.h> #include <cmath> #include <initializer_list> #include <iostream> #include <random> #include <utility> #include "dali/core/cuda_event.h" #include "dali/kernels/kernel_...
the_stack
#include "matrix_common.hpp" #include "matrix_fine.hpp" namespace arb { namespace gpu { namespace kernels { // // gather and scatter kernels // // to[i] = from[p[i]] template <typename T, typename I> __global__ void gather(const T* __restrict__ const from, T* __restrict__ const to, const I* ...
the_stack
struct is_even { __host__ __device__ bool operator()(const int &x) { return (x % 2) == 0; } }; using namespace mgpu; using namespace std; using namespace thrust::placeholders; size_t int_size = sizeof(int_type); size_t float_size = sizeof(float_type); queue<string> namevars; queue<s...
the_stack
#include <cudf/column/column_device_view.cuh> #include <cudf/copying.hpp> #include <cudf/detail/gather.cuh> #include <cudf/detail/indexalator.cuh> #include <cudf/detail/nvtx/ranges.hpp> #include <cudf/dictionary/detail/update_keys.hpp> #include <cudf/dictionary/dictionary_column_view.hpp> #include <cudf/dictionary/dict...
the_stack
namespace fastertransformer { template <typename T> __global__ void self_attention_kernel(const int* memory_sequence_length, T* key_buf, T* value_buf, T* query_buf, co...
the_stack
extern "C" { #include "sph/sph_blake.h" #include "sph/sph_bmw.h" #include "sph/sph_groestl.h" #include "sph/sph_skein.h" #include "sph/sph_jh.h" #include "sph/sph_keccak.h" } #include "miner.h" #include "cuda_helper.h" static uint32_t *d_hash[MAX_GPUS]; // Speicher zur Generierung der Noncevektoren für die bedingte...
the_stack
#include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <ATen/cuda/ApplyGridUtils.cuh> #include <ATen/cuda/detail/OffsetCalculator.cuh> #include <ATen/native/cuda/Loops.cuh> #include <c10/cud...
the_stack
#include <ATen/ATen.h> #include <cuda.h> #include <cuda_runtime.h> #include <thrust/device_vector.h> #include <vector> #define CUDA_1D_KERNEL_LOOP(i, n) \ for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < n; \ i += blockDim.x * gridDim.x) #define POSE_CHANNELS 4 template <...
the_stack
#include <stddef.h> #include <stdio.h> #include <string.h> #include "scalar.h" static __constant__ DEEPWAVE_TYPE fd1[2 * DEEPWAVE_DIM]; static __constant__ DEEPWAVE_TYPE fd2[2 * DEEPWAVE_DIM + 1]; #define gpuErrchk(ans) \ { gpuAssert((ans), __FILE__, __LINE__); } static inline void gpuAssert(cudaError_t code, cons...
the_stack
#include <thrust/functional.h> template<typename MatrixType> class block_matrix : public cusp::linear_operator<typename MatrixType::value_type, typename MatrixType::memory_space> { private: typedef typename MatrixType::index_type IndexType; typedef typename MatrixType::value_type ValueType; typedef typ...
the_stack
#include <iostream> #include <cstdlib> #include <vector> // for each state // start_weight // end_weight // Transition: float weight, int input_label, int state // alpha_transition_index // beta_transition_index #define CHECK_CUDA(call) \ { \ const cudaError_t error = call; \ if (error != cudaSuccess) \ ...
the_stack
#include <SDL.h> #include <cstdio> #include <cfloat> #include <cuda.h> #include <cuda_runtime.h> #include <cuda_gl_interop.h> #include <vector_types.h> #include "Types.h" #include "Base3d.h" #include "Camera.h" #include "cudarenderer.h" ///////////////////////////////// // Raytracing configuration #define THREADS_...
the_stack
#if ( MODEL == HYDRO && defined GRAVITY ) // include c_ExtAcc_AuxArray[] #ifdef __CUDACC__ #include "CUDA_ConstMemory.h" #endif //----------------------------------------------------------------------------------------- // Function : CPU/CUPOT_HydroGravitySolver // Description : Advances the momentum and ...
the_stack
#pragma once #include <gunrock/app/problem_base.cuh> namespace gunrock { namespace app { namespace lp { /** * @brief Speciflying parameters for LP Problem * @param parameters The util::Parameter<...> structure holding all parameter * info \return cudaError_t error message(s), if any */ cudaError_t UseParamete...
the_stack
#include "gpu/image/imgInsert.hpp" #include "../deviceBuffer.hpp" #include "../deviceStream.hpp" #include "backend/common/imageOps.hpp" #include "cuda/util.hpp" #include <cuda_runtime.h> #include <cassert> const unsigned int CudaBlockSize = 16; namespace VideoStitch { namespace Image { /** * This kernel inserts...
the_stack
#include "cuda/Complex.cuh" #include "cuda/ComputeCapabilities.cuh" #include "cuda/CudaUtils.cuh" #include "cuda/DeviceTensor.cuh" #include <algorithm> #include <cuda_runtime.h> #include <glog/logging.h> namespace facebook { namespace cuda { namespace detail { __device__ __forceinline__ constexpr int max(int i, int...
the_stack
#include "generalized_projection.h" // clang-format on #include <ATen/Functions.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include "common.cuh" #include "utils.cuh" #include "vec_utils.cuh" namespace geomlib { namespace { const float kEps = 1e-8; template <int dim, typ...
the_stack
#include "WorkAndObjectMatch.h" // Host 全局常量:_scalModulus(扩缩系数) // 对 TEST 图像进行扩缩时使用的扩缩系数 // 暂时未实现扩缩操作,先注释掉 //static const float _scalModulus[] = { 0.80f, 0.85f, 0.90f, 0.95f, 1.0f, // 1.05f, 1.10f, 1.15f, 1.20f }; // Host 全局常量:_scalModulusCount(扩缩系数的数量) // 对 TEST 图像进行扩缩的扩缩系数的数量 s...
the_stack
#pragma once #include <gunrock/util/array_utils.cuh> #include <gunrock/graph/graph_base.cuh> #include <gunrock/graph/coo.cuh> #include <gunrock/util/binary_search.cuh> namespace gunrock { namespace graph { /** * @brief CSC data structure which uses Compressed Sparse Column * format to store a graph. It is a compre...
the_stack
#include <torch/types.h> #include <ATen/ATen.h> #include <ATen/AccumulateType.h> #include <ATen/cuda/CUDAApplyUtils.cuh> #include <ATen/cuda/CUDAContext.h> #include <cuda.h> #include <cuda_runtime.h> static __device__ __forceinline__ int floor_div(int a, int b) { int t = 1 - a / b; return (a + t * b)...
the_stack
__device__ float ApplyDarkMatterToFrame( const float* beadParamCube, const float* regionFrameCube, const float darkness, const int frame, const int num_frames, const int frameStride, const int regionFrameStride) { if( !ConfigP.UseDarkMatterPCA() ) return ((*(regionFrameCube + (RfDarkM...
the_stack
#include <thrust/extrema.h> #include <logger.h> #undef DEBUG_CHEBYSHEV_OUTPUT using namespace std; namespace amgx { namespace chebyshev_poly_smoother { template <typename ValueTypeA, typename ValueTypeB> struct jacobi_presmooth_functor { ValueTypeB omega; jacobi_presmooth_functor( ValueTypeB omega ) : omega...
the_stack
#include <iostream> #include <iterator> #include <type_traits> #include <cassert> #include <gdf/gdf.h> #include <thrust/pair.h> #include "managed_allocator.cuh" #include "managed.cuh" #include "hash_functions.cuh" // TODO: replace this with CUDA_TRY and propagate the error #ifndef CUDA_RT_CALL #define CUDA_RT_CALL( ...
the_stack
extern "C" { #include <ccv.h> #include <ccv_internal.h> #include <nnc/ccv_nnc.h> #include <nnc/ccv_nnc_easy.h> #include <nnc/ccv_nnc_internal.h> } #include <nnc/gpu/ccv_nnc_compat.h> #ifdef HAVE_CUDA template<typename NUM> __global__ void _ccv_nnc_upsample_bilinear_forw_nchw(const int hw, const float rwidth, const fl...
the_stack
#define MOD_NAMESPACE #define MOD_NAMESPACE_NAME fmitest #define MOD_NAMESPACE_BEGIN namespace fmitest { #define MOD_NAMESPACE_END } //#define NVBIO_CUDA_DEBUG //#define NVBIO_CUDA_ASSERTS #include <nvbio/basic/omp.h> #include <stdio.h> #include <stdlib.h> #include <vector> #include <algorithm> #include <nvbio/basi...
the_stack
#include <stdint.h> namespace cufhe { /** * @class FFP * @brief Wraps a uint64_t integer as an element in the field FF(P). And defines * arithmetic operations (operations). P = 2^64-2^32+1. * @details Do not use function Pow(...) in performance-critical code. * @details All function members are inline. *...
the_stack
#include <string.h> #include <stdint.h> #include "sph/blake2s.h" #include "sph/sph_types.h" #include "cuda_helper.h" #include "cuda_vectors.h" #ifdef __INTELLISENSE__ #define __byte_perm(x, y, b) x #endif static const uint32_t blake2s_IV[8] = { 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, 0x510E527FUL,...
the_stack
// This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #include <THC/THC.h> #include <iostream> #include <cstdint> #include <cuda_runtime.h> #include <cuda_runtime_api.h> #include <stdio.h> #define THREADS 128 #define idx(X, Y) ((px * 2 + ...
the_stack
// Adopted from caffe2 depthwise conv at // pytorch/caffe2/caffe2/operators/depthwise_3x3_conv_op_cudnn.cu namespace caffe2 { struct DepthwiseArgs { // Input layer dimensions int batch{0}; int in_rows{0}; int in_cols{0}; int in_length{0}; int in_depth{0}; // filter size int filter_rows{0}; int filt...
the_stack
// #include "lrbn.cuh" using namespace at; using namespace at::native; // The maximum number of threads in a block #if defined(__HIP_PLATFORM_HCC__) constexpr int MAX_BLOCK_SIZE = 256; #else constexpr int MAX_BLOCK_SIZE = 512; #endif // Number of threads in a block given an input size up to MAX_BLOCK_SIZE static int...
the_stack
#include <cuda_runtime.h> #include <cuda_runtime_api.h> #include <device_launch_parameters.h> #include "ssids/gpu/kernels/datatypes.h" #include "cuda/cuda_check.h" #define min(x,y) ((x) < (y) ? (x) : (y)) #define FAVOUR2x2 100 #define CBLOCKS 3 #define MCBLOCKS 8 #define BLOCKS 7 #define MBLOCKS 11 #define BLOCK_SIZ...
the_stack
using namespace std; #include <stdio.h> #include <time.h> #include <assert.h> #include <stdlib.h> #include <iomanip> #include <cstdlib> #include <vector> // cuda #include <cuda_runtime.h> #include <cublas_v2.h> #include <cublasLt.h> #define Value 127 #define checkCudaAPIErrors(F) if ((F) != cudaSuccess) \ { printf...
the_stack
#include<ops/declarable/helpers/transforms.h> #include <array/ResultSet.h> #include <helpers/ShapeUtils.h> #include <numeric> #include <array/NDArrayFactory.h> #include <helpers/TAD.h> #include <exceptions/cuda_exception.h> #include <helpers/PointersManager.h> #include <helpers/ConstantTadHelper.h> namespace sd { n...
the_stack
#include "cuda_error.h" #include "cuda_runtime.h" #include "StreamingKernels.h" #include "SingleFitStream.h" #include "JobWrapper.h" #include "GpuMultiFlowFitControl.h" #include "SignalProcessingFitterQueue.h" #include "LayoutTranslator.h" #define REGIONAL_DUMP 0 //#define MIN_MEMORY_FOR_ONE_STREAM (450*1024*1024) #...
the_stack
__constant__ uint32_t c_PaddedMessage80[20]; // padded message (80 bytes + padding?) static uint32_t *d_found[MAX_GPUS]; #define sM 16 #define O1 13 #define O2 9 #define O3 6 #define INPUT_BLOCK_ADD \ B0 = B0 + M0; \ B1 = B1 + M1; \ B2 = B2 + M2; \ B3 = B3 + M3; \ B4 = B4 + M4; \ B5 = B5 + M5...
the_stack
const int CUDA_NUM_THREADS = 128; const int BLOCK_SIZE_LIMIT = 32768; // CUDA: number of blocks for threads. inline int GET_BLOCKS(const int N) { int ret = (N + CUDA_NUM_THREADS - 1) / CUDA_NUM_THREADS; return (ret > BLOCK_SIZE_LIMIT) ? BLOCK_SIZE_LIMIT : ret; } __global__ void cf_kernel(V_ID rowLeft, ...
the_stack
#include <cublas_v2.h> #include <cuda_runtime.h> #include "buffalo/cuda/utils.cuh" #include "buffalo/cuda/bpr/bpr.hpp" namespace cuda_bpr{ using std::invalid_argument; using namespace cuda_buffalo; using namespace thrust; static const float MAX_EXP = 6; __global__ void init_rngs_kernel(default_random_engine* rngs...
the_stack
//#include "cuda_runtime.h" #include "cuda_error.h" #include "Mask.h" #include "Image.h" #include "TimeCompression.h" #include "Region.h" #include "BeadTracker.h" #include "BkgTrace.h" #include "EnumDefines.h" #include "SingleFlowFitKernels.h" #include "UtilKernels.h" #include "ConstantSymbolDeclare.h" using namespace...
the_stack
#include <opencv2/cudafeatures2d.hpp> #include "cuda_runtime.h" #include "device_launch_parameters.h" #include "labeling_algorithms.h" #include "register.h" // Stava and Benes #define TILE_SIZE 16 #define TILE_GRID_SIZE 4 #define THREAD_PER_TILE 16 using namespace cv; namespace { // Returns the root index o...
the_stack
__constant__ unsigned char c_E8_bitslice_roundconstant[42][32] = { { 0x72, 0xd5, 0xde, 0xa2, 0xdf, 0x15, 0xf8, 0x67, 0x7b, 0x84, 0x15, 0xa, 0xb7, 0x23, 0x15, 0x57, 0x81, 0xab, 0xd6, 0x90, 0x4d, 0x5a, 0x87, 0xf6, 0x4e, 0x9f, 0x4f, 0xc5, 0xc3, 0xd1, 0x2b, 0x40 }, { 0xea, 0x98, 0x3a, 0xe0, 0x5c, 0x45, 0xfa, 0x9c, 0x3, 0...
the_stack
__global__ void kernel(){ //====================================================================================================================================================== // COMMON VARIABLES //===================================================================================================================...
the_stack
#define LBANN_SLICE_LAYER_INSTANTIATE #include "lbann/layers/transform/slice.hpp" #include "lbann/utils/gpu/helpers.hpp" namespace lbann { namespace { using dim4 = gpu_lib::array<size_t, 4>; /** * Block dimensions: bsize x 1 x 1 * * Grid dimensions: (max_input_dims[3] / bsize) x max_input_dims[2] x max_input_d...
the_stack
#pragma once #include "PerWarpPatchGeometryStage.cuh" #include "BinTileSpace.cuh" #include "BinTileRasterizationStage.cuh" #include "framebuffer.cuh" #include "shader.cuh" #include <meta_utils.h> #include <ptx_primitives.cuh> #include <cub/cub.cuh> extern "C" { __device__ int geometryProducingBlocks...
the_stack
#include "nvblox/integrators/esdf_integrator.h" namespace nvblox { EsdfIntegrator::~EsdfIntegrator() { if (cuda_stream_ != nullptr) { cudaStreamDestroy(cuda_stream_); } } void EsdfIntegrator::integrateBlocksOnGPU( const TsdfLayer& tsdf_layer, const std::vector<Index3D>& block_indices, EsdfLayer* esdf...
the_stack
#include <common/types.h> #include <iterator> #include <algorithm> namespace sqaod_cuda { namespace sq = sqaod; template<template<class> class OpType, class real> struct OpOutPtr { typedef real value_type; typedef OpType<real> Op; explicit OpOutPtr(real *_d_data, sq::SizeType _stride, Op _op) : d_da...
the_stack
#include <cuda.h> #include <cusparse.h> #include "cusparse_error.cuh" namespace BCL { namespace cuda { template <typename T> struct cusparse_type_t; template <> struct cusparse_type_t<int32_t> { using type = int32_t; static auto cusparse_type() { return CUSPARSE_INDEX_32I; } }; template <> struct cuspars...
the_stack
#include "ew_op_gpu.h" #include "gpu_hmma.h" #include <stdio.h> #if __CUDA_ARCH__ >= 700 template <uint OP_A, bool GATED> __global__ void __launch_bounds__(128) hgemm_blocksparse_32x64x32_xn_sdd( const uint2* __restrict__ Lut, const float* __restrict__ Gate, const ehalf* __restrict__ A, const ehalf* _...
the_stack
// Another possibility: // #include <torch/all.h> #include <assert.h> #include "type_shim.h" #include "multi_tensor_apply.cuh" #define BLOCK_SIZE 512 #define ILP 4 template<typename T> __device__ __forceinline__ bool is_aligned(T* p){ return ((uint64_t)p) % (ILP*sizeof(T)) == 0; } template<typename T> __device__...
the_stack
using namespace std; #include <cuda.h> struct Struct_fp_fp_f_f { float *p1; float *p2; float f1; float f2; }; struct Struct_fp { float *p1; }; struct Struct_1float { float f1; }; struct Struct_2floats { float f1; float f2; }; __global__ void struct_byvalue(struct Struct_fp_fp_f_f m...
the_stack
// Avoid warnings in Eigen includes with CUDA compiler #pragma diag_suppress code_is_unreachable #include "camera_calibration/feature_detection/cuda_refinement_by_matching.cuh" #include <cub/cub.cuh> #include <libvis/cuda/cuda_auto_tuner.h> #include <libvis/cuda/cuda_util.h> #include <libvis/logging.h> #include <math...
the_stack
#pragma once #include "chrono_gpu/ChGpuDefines.h" #include "chrono_gpu/physics/ChSystemGpu_impl.h" #include "chrono_gpu/physics/ChGpuBoundaryConditions.h" #include "chrono_gpu/cuda/ChCudaMathUtils.cuh" #include "chrono_gpu/cuda/ChGpuHelpers.cuh" //#include "chrono/core/ChMathematics.h" #include <math_constants.h> usin...
the_stack
#include <cuda.h> /** * @file * @section Description * * This file contains the virg_vm_gpu() function and virginia_gpu(), the cuda * kernel virtual machine. This is the only file that is compiled with nvcc, * rather than gcc or icc. */ extern "C" { #include "virginian.h" } // defining VIRG_NOTWOSTEP disable...
the_stack
#include <algorithm> // Pseudo-random number generator namespace amgx { static __host__ __device__ unsigned int hash_function(unsigned int a, unsigned int seed) { a ^= seed; a = (a + 0x7ed55d16) + (a << 12); a = (a ^ 0xc761c23c) + (a >> 19); a = (a + 0x165667b1) + (a << 5); a = (a ^ 0xd3a2646c) +...
the_stack
// CurveTopology // 曲线间的相位关系 #include "CurveTopology.h" #include <stdio.h> #include <iostream> using namespace std; // 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y // 定义了默认的线程块尺寸。 #define DEF_BLOCK_X 32 #define DEF_BLOCK_Y 8 // 宏:IN_LABEL 和 OUT_LABEL // 定义了曲线内的点和曲线外的点标记值 #define IN_LABEL 255 #define OUT_LABEL 0 // Kern...
the_stack
#include <numeric> #include <vector> #include "k2/csrc/fsa.h" #include "k2/csrc/fsa_utils.h" namespace k2 { // clang-format off bool operator==(const Arc &a, const Arc &b) { return a.src_state == b.src_state && \ a.dest_state == b.dest_state && \ a.symbol == b.symbol && \ fabs(a.score - ...
the_stack
#pragma once /** * @brief Graph slice structure which contains common graph structural data. * * @tparam SizeT Type of unsigned integer to use for array indexing. (e.g., * uint32) * @tparam VertexId Type of signed integer to use as vertex id (e.g., uint32) * @tparam Value Type to use as vertex / edge assoc...
the_stack
#include <curand.h> #include <curand_kernel.h> #include <curand_philox4x32_x.h> namespace at { namespace native { namespace { template <typename T> inline __device__ bool _isinf(T x) { return ::isinf(x); } inline __device__ bool _isinf(c10::Half x) { return ::isinf(static_cast<float>(x)); } inline __device__ bool...
the_stack
#include "open3d/core/Tensor.h" #include "open3d/core/nns/FixedRadiusIndex.h" #include "open3d/core/nns/FixedRadiusSearchImpl.cuh" #include "open3d/core/nns/NeighborSearchAllocator.h" #include "open3d/core/nns/NeighborSearchCommon.h" namespace open3d { namespace core { namespace nns { template <class T> void BuildSpa...
the_stack
__device__ int Quantities_scalefactor_space_acceldir(int ix_g, int iy_g, int iz_g) { int result = 0; #ifndef RELAXED_TESTING const int im = 134456; const int ia = 8121; const int ic = 28411; result = ( (result+(ix_g+2))*ia + ic ) % im; result = ( (result+(iy_g+2))*ia + ic ) % im; result = ( (result+(iz_...
the_stack
#include <assert.h> #include <pthread.h> #include <stdint.h> #include <stdio.h> /* every tool needs to include this once */ #include "nvbit_tool.h" /* nvbit interface file */ #include "nvbit.h" /* provide some __device__ functions */ #include "utils/utils.h" // Used for tracking pointers for checkpointing #include ...
the_stack
#include <chrono> #include <iostream> #include <unistd.h> #include <vector> __device__ half float_to_sto_half_direct(float w) { curandState_t state; curand_init((unsigned long long)(w * 100), 0, 0, &state); half up = __float2half_ru(w); half down = __float2half_rd(w); const float up_f32 = __half2float(up); ...
the_stack
#include <gtest/gtest.h> #include <random> #include <utility> #include "dali/kernels/reduce/mean_stddev_gpu_impl.cuh" #include "dali/kernels/scratch.h" #include "dali/test/test_tensors.h" #include "dali/test/tensor_test_utils.h" #include "dali/core/tensor_shape_print.h" #include "dali/kernels/reduce/reduce_test.h" #inc...
the_stack
#define DEGREE 6 #include <types.h> #include <cutil.h> #include <error.h> #include <cusp/print.h> __device__ __constant__ CGType c_z_x[DEGREE]; __device__ __constant__ CGType c_z_y[DEGREE]; __device__ __constant__ CGType c_w_x[DEGREE]; __device__ __constant__ CGType c_w_y[DEGREE]; template<typename ValueType> __devi...
the_stack
namespace RPU { /******************************************************************************************/ /* PulsedRPUDeviceCuda Base class which maintains the basic hard bounds and dw_min up/down and decays etc for the pulsed updates. Note that it is still Abstract. Need to implement the getUpdateKernels...
the_stack
using isce3::core::Vec3; namespace isce3 { namespace cuda { namespace core { //Helper for the host side function - used only for testing __global__ void forward_g(int code, ProjectionBase** base, const double *inpts, double *outpts, ...
the_stack
// sum reduction within a block // the following implementation is compatible for sm_20 and above // newer architectures may support faster implementations, such as warp shuffle, cooperative groups template <const int Nthreads> __device__ float sumReduceBlock(float sum, volatile float *shmem) { const int tid = th...
the_stack
#include "kernels/k_fixed_point.cuh" #define AVOGADRO 6.0221367e23 #define BOLTZ 0.008314462618 namespace timemachine { MonteCarloBarostat::MonteCarloBarostat( const int N, const double pressure, // Expected in Bar const double temperature, // Kelvin const std::vector<std::vector<int>> group_idxs,...
the_stack
#pragma once #include <gunrock/app/enactor_base.cuh> #include <gunrock/app/enactor_iteration.cuh> #include <gunrock/app/enactor_loop.cuh> #include <gunrock/app/sage/sage_problem.cuh> #include <gunrock/oprtr/oprtr.cuh> namespace gunrock { namespace app { namespace sage { /** * @brief Speciflying parameters for SSSP ...
the_stack
#include <algorithm> #include "cupoch/geometry/image.h" #include "cupoch/utility/platform.h" #include "cupoch/utility/range.h" #include "cupoch/visualization/shader/image_shader.h" #include "cupoch/visualization/shader/shader.h" #include "cupoch/visualization/utility/color_map.h" using namespace cupoch; using namespa...
the_stack
#include <stdio.h> #include <stdlib.h> #include <assert.h> // CHECK: #include <hip/hip_runtime.h> #include <cuda_runtime.h> // CHECK: #include <hipsparse.h> #include <cusparse.h> void printCsr( int m, int n, int nnz, // CHECK: const hipsparseMatDescr_t descrA, const cusparseMatDescr_t descrA, const float *...
the_stack
#include <cudf_test/base_fixture.hpp> #include <cudf_test/column_wrapper.hpp> #include <cudf_test/iterator_utilities.hpp> #include <cudf_test/tdigest_utilities.cuh> #include <cudf_test/type_lists.hpp> #include <thrust/copy.h> #include <thrust/fill.h> #include <thrust/iterator/counting_iterator.h> namespace cudf { nam...
the_stack
namespace caffe { static __global__ void kernel_test_forward( const int num, const int channels, const int spatial_dim, const float* scale, const float* bias, const float* mean, const float* var, const float eps, const float* bottom_data, float* top_data) { CUDA_KERNEL_LOOP(index, num * channels * spa...
the_stack
#include <assert.h> #include <cuda_runtime.h> #include "OpenGlCudaHelper.h" // CUDA facts: // // On devices of compute capability 2.x and beyond, 32-bit integer multiplication is natively supported, // but 24-bit integer multiplication is not. __[u]mul24 is therefore implemented using multiple instructions // and sho...
the_stack
* COMPILATION TIP * nvcc cg_eg3.cu -o cg_eg3 * * */ #include <cooperative_groups.h> #include <iostream> #include <algorithm> // std::fill_n #include <memory> // std::unique_ptr /* ********** functions to setup device GPU, test values ********** */ /** @fn getMaxGridSize * @brief get maxGridSize (total number ...
the_stack
#define CUDAGMM_VERSION 5 #if(CUDAGMM_VERSION == 5) #define SWAP(a, b, t) t = (a); a = (b); b = (t) typedef struct CvFastBgGMMData { float4* ucGaussian; float* rWeight; int* rnUsedModes; } CvFastBgGMMData; enum ImageInfo { #if(CUDAGMM_VERSION >= 2) ImageInfoPixelCount = 0, // ImageInfo...
the_stack
#include "./common/errors.h" // Convenience function for checking CUDA runtime API results // can be wrapped around any runtime API call. No-op in release builds. float fx = 1.0f, fy = 1.0f, fz = 1.0f; const int m_x = 64, m_y = 64, m_z = 64; // shared memory tiles will be M*-by-*Pencils // sPencils is used whe...
the_stack
#include <thrust/device_vector.h> #include <thrust/iterator/discard_iterator.h> #include <nvbench/nvbench.cuh> #include <cuco/static_multimap.cuh> #include <key_generator.hpp> namespace { // Custom pair equal template <typename Key, typename Value> struct pair_equal { __device__ bool operator()(const cuco::pair_typ...
the_stack
#include <iostream> #include <fstream> #include <cmath> #include <cstdlib> #include <cstdio> #include <cstring> #include <mpi.h> #define CUDA #ifdef OMP #error Sorry, OpenMP is currently disabled. #define THRUST_DEVICE_SYSTEM THRUST_DEVICE_BACKEND_OMP #undef CUDA #define PARALLEL_GET_TID omp_get_threa...
the_stack
#include "common.cuh" #include "util/woodruff_int128_t.hpp" #include "util/woodruff_uint128_t.hpp" #include "util/cpu_builtin_equivalents.hpp" #include <kat/on_device/builtins.cuh> #include <kat/on_device/non-builtins.cuh> #include <kat/on_device/collaboration/block.cuh> using std::size_t; #if __cplusplus < 201701L ...
the_stack
#include <cugraph/legacy/graph.hpp> #include "vertex_binning.cuh" namespace cugraph { namespace mg { namespace detail { template <typename vertex_t, typename edge_t> __device__ void write_to_frontier(vertex_t const* thread_frontier, int thread_frontier_count, ...
the_stack
#ifdef __cplusplus extern "C" { #endif __constant__ int T = 256; __constant__ int acceptTopology[48] = {1, 2, 3, 4, 6, 8, 9, 12, 15, 16, 17, 32, 34, 48, 51, 63, 64, 68, 96, 102, 111, 119, 127, 0, // upper 254, 253, 252, 251, 249, 247, 246, 243, 240, 239, 238, 223, 221, 207, 204, 192, 191, 18...
the_stack
#include <stdio.h> #include "cuda_common.hpp" #include "acc_runtime.hpp" //NOTE: HIP will call the corresponding CUDA function if compiled with CUDA support template <int direction> __global__ void repack_z_buffer_gpu_kernel(int size_z, int num_zcol_loc, ...
the_stack
#include <cuda.h> // Thrust Dependencies #include <thrust/device_ptr.h> #include <thrust/copy.h> #include <thrust/reduce.h> // Octree-SLAM Dependencies #include <octree_slam/sensor/localization_kernels.h> namespace octree_slam { namespace sensor { __device__ const float DIST_THRESH = 0.1f; //Use 10 cm distance thr...
the_stack
using namespace std; typedef uint8_t uint8; typedef unsigned int uint32; typedef unsigned long long int uint64; #define STREAM_BLOCK 16 #define BLOCK_SIZE 32 #define BLOCK_D_SIZE 64 #define INTEGRAL_BLOCK_SIZE 8 #define XDIM_MAX_THREADS 1024 #define XDIM_H_THREADS 512 #define XDIM_Q_THREADS 256 #define SHARED_MEMORY 49...
the_stack
// #include <torch/torch.h> #include <cuda.h> #include <cuda_runtime.h> #include <vector> // for the older gpus atomicAdd with double arguments does not exist #if __CUDA_ARCH__ < 600 and defined(__CUDA_ARCH__) static __inline__ __device__ double atomicAdd(double* address, double val) { unsigned long long int* ...
the_stack
#include "base/memory.h" #include "core/optimizer.h" #include "util/gpu.cuh" #include "util/math.h" namespace graphvite { namespace gpu { namespace knowledge_graph { /** * @brief Train knowledge graph embedding with 0-moment optimizers * @tparam Vector vector type of embeddings * @tparam Index integral type of ind...
the_stack