text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
namespace xlib { namespace detail { __device__ __forceinline__ constexpr int min_max_lane(int STEP) { const int MASK_WARP = (1 << (STEP + 1)) - 1; return ((31 - MASK_WARP) << 8) | MASK_WARP; } //============================================================================== template<unsigned WARP_SZ, typename...
the_stack
#ifndef HAVE_OPENCV_CUDEV #error "opencv_cudev is required" #else #include "opencv2/cudev.hpp" using namespace cv::cudev; void divScalar(const GpuMat& src, cv::Scalar val, bool inv, GpuMat& dst, const GpuMat& mask, double scale, Stream& stream, int); namespace { template <typename T, int cn> struct SafeDiv; ...
the_stack
#pragma once #include <math/vector.h> #include <math/matrix.h> struct NoBlending { __device__ math::float4 operator ()(const math::float4& src) const { return src; } }; struct AlphaBlending { __device__ math::float4 operator ()(const math::float4& src, const math::float4& dest) const { ...
the_stack
DEV static int_t terminal_U_penalty(const fbase_t *s, const int i, const int j, fparam_t p) { return s[i] == U || s[j] == U ? p->terminal_AU_penalty : 0; } DEV static int_t dangle_3p_energy(const fbase_t *s, const int i, const int j, const int ip1, fparam_t p) { return p->dangle_3p[s[i]][s[j]][s[ip...
the_stack
#include "k2/csrc/device_guard.h" #include "k2/csrc/fsa.h" #include "k2/csrc/fsa_algo.h" #include "k2/csrc/fsa_utils.h" #include "k2/csrc/host_shim.h" #include "k2/csrc/rm_epsilon.h" #include "k2/python/csrc/torch/fsa_algo.h" #include "k2/python/csrc/torch/torch_util.h" #include "k2/python/csrc/torch/v2/ragged_any.h" ...
the_stack
namespace std { inline char2 numeric_limits<char2>::max() noexcept { return make_char2(std::numeric_limits<char>::max(), std::numeric_limits<char>::max()); } inline char2 numeric_limits<char2>::min() noexcept { return make_char2(std::numeric_limits<char>::min(), std...
the_stack
// order: (shouldFlipX, shouldFlipY, shouldFlipZ) DEVICE uint8 next_child(uint8 order, uint8 mask) { for (uint8 child = 0; child < 8; ++child) { uint8 childInOrder = child ^ order; if (mask & (1u << childInOrder)) return childInOrder; } check(false); return 0; } template<bool isRoot, typename TDAG> DEVICE ...
the_stack
* Test of BlockMergeSort utilities ******************************************************************************/ // Ensure printing of CUDA runtime errors to console #define CUB_STDERR #include <stdio.h> #include <limits> #include <typeinfo> #include <memory> #include <cub/util_allocator.cuh> #include <cub/block/...
the_stack
#define cudaCheckErrors(msg) \ do { \ cudaError_t __err = cudaGetLastError(); \ if (__err != cudaSuccess) { \ mexPrintf("%s \n",msg);\ mexErrMsgIdAndTxt("TIGRE:Ax:interpolated_parallel",cudaGetErrorString(__err));\ } \ } while (0) // Declare th...
the_stack
#ifdef __cplusplus extern "C" { #endif unsigned char computeSmoothNormals[] = { 0x50,0xed,0x55,0xba,0x01,0x00,0x10,0x00,0x38,0x28,0x00,0x00,0x00,0x00,0x00,0x00, 0x02,0x00,0x01,0x01,0x58,0x00,0x00,0x00,0x28,0x0c,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x01,0x00,0x0b,0x00,0x00,0x...
the_stack
namespace facebook { namespace deeplearning { namespace torch { namespace detail { namespace { #define DIVUP(a, b) (((a) + (b) - 1) / (b)) const int SHARED_MEM_MAX_SIZE = 49152; const int MV_N_REDUCE = 8; const int MV_BUFFER_SIZE = 128; // assume : bias is contiguous // score last dim is contiguous // ...
the_stack
#define DETERMINISTIC //#define DEBUG //#define DYNAMIC #define NUM_NODE_SIZES 64 ///< number of different cell sizes #include "utility/src/utils.cuh" // database dependency #include "utility/src/detailed_place_db.cuh" #include "independent_set_matching/src/construct_spaces.cuh" #include "independent_set_matching/sr...
the_stack
#pragma once #include "Common.h" #include "CudaConstraints.h" #include "CudaData.cuh" #include <Eigen/SVD> namespace viper { struct C_distance_solve { C_distance_solve(C_distance *C, CudaStatePtr S, CudaProjectionsPtr P, float *L, float dt) : C(C), S(S), P(P), L(L), dt(dt) {} C_di...
the_stack
// GPU copy benchmark tests dtoh/htod/dtod data transfer bandwidth by GPU SM/DMA. #include <chrono> #include <cstdio> #include <cstring> #include <string> #include <vector> #include <getopt.h> #include <numa.h> #include <cuda.h> #include <cuda_runtime.h> // Arguments for each benchmark run. struct BenchArgs { /...
the_stack
Tensor FFModel::concat(int n, const Tensor* tensors, int axis, const char *name) { Concat *cat = new Concat(*this, n, tensors, axis, name); layers.push_back(cat); return cat->outputs[0]; } Concat::Concat(FFModel& model, int _n, c...
the_stack
using namespace at; namespace { constexpr int32_t MAX_PROBES = 3; enum { OPTIM_SGD = 0, OPTIM_ADAGRAD = 1, OPTIM_DENSE = 2, }; } // namespace inline void cuda_gemm_batched_fp32_fp32( cublasOperation_t transa, cublasOperation_t transb, int m, int n, int k, float* alpha, void** a_ar...
the_stack
#include "nnbnorm.hpp" #include "datacu.hpp" #include "impl/blashelper.hpp" #include "impl/sharedmem.cuh" #include <cassert> #include <cstdint> #include <cfloat> // ------------------------------------------------------------------- // Helpers // ------------...
the_stack
#include "flowfilter/gpu/image.h" #include "flowfilter/gpu/gpu_deleter.h" #include "flowfilter/gpu/error.h" namespace flowfilter { namespace gpu { //################################################# // GPUImage //################################################# GPUImage::GPUImage() { __width = 0; __height = ...
the_stack
#include "core1/panoRemapper.hpp" #include "core/rect.hpp" #include "core/transformGeoParams.hpp" #include "backend/common/imageOps.hpp" #include "backend/cuda/deviceBuffer.hpp" #include "backend/cuda/deviceStream.hpp" #include "backend/cuda/surface.hpp" #include "cuda/error.hpp" #include "cuda/util.hpp" #include ...
the_stack
// TODO: make it less vague(use proper include) #include "../gpu/kmeans/kmeans_centroids.h" #include <thrust/host_vector.h> TEST(KMeansCentroids, CalculateCentroids) { // GIVEN int k = 2; int d = 2; int n = 4; // Setup data thrust::host_vector<float> dataHost(n * d); dataHost[0] = 0.0f; dataHost[1] = ...
the_stack
__host__ __device__ int64_t LOOP_COUNT(uint32_t bits, test_t test) { if(test==xt_add) return 1000*8192/bits; else if(test==xt_sub) return 1000*8192/bits; else if(test==xt_accumulate) return 1000*8192/bits; else if(test==xt_mul) return 100*8192/bits; else if(test==xt_div_qr) return 40*8192/...
the_stack
#define TPB 256 static uint32_t *h_GNonces[MAX_GPUS]; static uint32_t *d_GNonces[MAX_GPUS]; __constant__ uint32_t pTarget[8]; __device__ static uint32_t T0up[] = { 0xA5F432C6, 0x84976FF8, 0x99B05EEE, 0x8D8C7AF6, 0x0D17E8FF, 0xBDDC0AD6, 0xB1C816DE, 0x54FC6D91, 0x50F09060, 0x03050702, 0xA9E02ECE, 0x7D87D156, 0x192BCC...
the_stack
// CGLS Conjugate Gradient Least Squares // Attempts to solve the least squares problem // // min. ||Ax - b||_2^2 + s ||x||_2^2 // // using the Conjugate Gradient for Least Squares method. This is more stable // than applying CG to the normal equations. Supports both generic operators // for computing Ax and A^...
the_stack
#ifndef INCLUDE_GGNN_CACHE_CUDA_SIMPLE_KNN_CACHE_NO_SLACK_CUH_ #define INCLUDE_GGNN_CACHE_CUDA_SIMPLE_KNN_CACHE_NO_SLACK_CUH_ #include <cuda.h> #include <cuda_runtime.h> #include <cub/cub.cuh> #include <limits> #include "ggnn/utils/cuda_knn_distance.cuh" #include "ggnn/utils/cuda_knn_utils.cuh" template <DistanceMe...
the_stack
#include <ATen/ATen.h> #include <ATen/cuda/CUDAContext.h> #include <THC/THC.h> #include <THC/THCAtomics.cuh> #include <THC/THCDeviceUtils.cuh> // TODO make it in a common file #define CUDA_1D_KERNEL_LOOP(i, n) \ for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < n; ...
the_stack
#include "common.cuh" #include <kat/on_device/collaboration/grid.cuh> #include <kat/on_device/collaboration/block.cuh> #include <kat/on_device/collaboration/warp.cuh> #include <kat/on_device/atomics.cuh> using std::size_t; using kat::warp_size; using fake_bool = int8_t; // so as not to have trouble with vector<bool> ...
the_stack
//#include <cstdio> #include "caffe/fast_rcnn_layers.hpp" #include "stdio.h" using std::max; using std::min; namespace caffe { //Definite equinox template <typename Dtype> __device__ inline float DexX(const Dtype* bottom_rois, int i_int, int j_int, const int pooled_height_int, const int pooled_width_int) { Dtype...
the_stack
#include <claraparabricks/genomeworks/cudaaligner/aligner.hpp> #include <claraparabricks/genomeworks/utils/signed_integer_utils.hpp> #include <claraparabricks/genomeworks/utils/limits.cuh> #include <claraparabricks/genomeworks/utils/mathutils.hpp> #include <claraparabricks/genomeworks/utils/cudautils.hpp> #include <cla...
the_stack
// Copyright (c) 2018 Changan Wang // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, di...
the_stack
#include <cfloat> #include "utility.hpp" using namespace ppl::common; namespace ppl { namespace cv { namespace cuda { #define RADIUS0 16 #define SMALL_KSIZE0 RADIUS0 * 2 + 1 #define RADIUS1 8 #define SMALL_KSIZE1 RADIUS1 * 2 + 1 template <typename BorderInterpolation> __global__ void medianC1SharedKernel(const uc...
the_stack
#include <ops/declarable/helpers/random.h> //#include <NativeOps.h> #include <array/NDArrayFactory.h> #include <exceptions/cuda_exception.h> #include <graph/Context.h> #include <helpers/ConstantTadHelper.h> #include <helpers/PointersManager.h> #include <helpers/RandomLauncher.h> #include <helpers/ShapeUtils.h> #includ...
the_stack
//#include <cutil_inline.h> #include <cutil_inline.h> #include <cutil_math.h> #include "CudaMath.h" #include "dds.h" #include "permutations.h" // Definitions #define INPUT_IMAGE "lena_std.ppm" #define REFERENCE_IMAGE "lena_ref.dds" #if 1 #define ERROR_THRESHOLD 0.1f #else #define ERROR_THRESHOLD 0.02f #endif #defin...
the_stack
// For compatibility with Pytorch 1.1 #ifndef TORCH_CHECK #define TORCH_CHECK AT_CHECK #endif // #define thc_cos THCNumerics<scalar_t>::cos // #define thc_sin THCNumerics<scalar_t>::sin #define thc_cos std::cos #define thc_sin std::sin #define FULL_MASK 0xffffffff static constexpr int MAX_BLOCK_SIZE = 1024; static c...
the_stack
* This sample demonstrates a combination of Peer-to-Peer (P2P) and * Unified Virtual Address Space (UVA) features new to SDK 4.0 */ #include <shrUtils.h> // includes, system #include <stdlib.h> #include <stdio.h> // includes, project #include <sdkHelper.h> // helper for shared that are common to CUDA SDK samples ...
the_stack
#include <rmm/device_uvector.hpp> #include <rmm/exec_policy.hpp> #include <thrust/binary_search.h> #include <thrust/iterator/counting_iterator.h> #include <thrust/iterator/transform_iterator.h> namespace cudf { namespace detail { namespace { /** * @brief The enum specifying which sorting method to use (stable or un...
the_stack
#include "TemplateFactory.h" #include <iostream> #include <ctime> #include <cstring> using namespace std; #include "ErrorCode.h" // 宏:TF_ENABLE_KICK(开启替换规则) // 开关宏,使能该宏,则在模板池存放满了模板以后,新的模板会替换不常用的模板,但 // 这种做法可能会拉慢单次调用的性能;如果关闭该宏,则单次处理性能会提高,但是从 // 总体来看,后续的模板频繁的申请与释放会带来内存处理的压力,总体性能可能会下 // 降。将以在模板种类使用较少时关闭该宏;如果使用模板种类较多,建议...
the_stack
#include "nvblox/core/accessors.h" #include "nvblox/core/common_names.h" #include "nvblox/integrators/integrators_common.h" #include "nvblox/mesh/impl/marching_cubes_table.h" #include "nvblox/mesh/marching_cubes.h" #include "nvblox/mesh/mesh_integrator.h" #include "nvblox/utils/timing.h" namespace nvblox { void MeshI...
the_stack
#ifdef GPU #if ( MODEL == HYDRO ) __global__ void CUFLU_dtSolver_HydroCFL( real g_dt_Array[], const real g_Flu_Array[][FLU_NIN_T][ CUBE(PS1) ], const real g_Mag_Array[][NCOMP_MAG][ PS1P1*SQR(PS1) ], const real dh, const real Safety, const real MinPres, co...
the_stack
* \file * cub::DeviceRunLengthEncode provides device-wide, parallel operations for computing a run-length encoding across a sequence of data items residing within device-accessible memory. */ #pragma once #include <stdio.h> #include <iterator> #include "../config.cuh" #include "dispatch/dispatch_rle.cuh" #include ...
the_stack
* COMPILATION TIP * g++ main.cpp ./structs/structs.cpp -o main * * */ #include "./metropolis.h" /* =============== boundary conditions =============== */ /** * @fn periodic_nn * @brief periodic boundary conditions; Choose correct matrix index with * periodic boundary conditions * * Input : * @param - i...
the_stack
/* classifier parameters */ /************************************ * Notes: * To paralleism the filter, * these monolithic arrays may * need to be splitted or duplicated ***********************************/ static int *stages_array; static int *rectangles_array; static int *weights_array; static int *alpha1_array; ...
the_stack
#pragma once #include <gunrock/app/problem_base.cuh> #include <gunrock/oprtr/1D_oprtr/for_all.cuh> #include <queue> #define debug_aml(a...) //#define debug_aml(a...) {printf("%s:%d ", __FILE__, __LINE__); printf(a);\ printf("\n");} namespace gunrock { namespace app { namespace mf { /** * @brief Speciflying par...
the_stack
#ifndef CH_SPH_GENERAL_CUH #define CH_SPH_GENERAL_CUH // ---------------------------------------------------------------------------- // CUDA headers // ---------------------------------------------------------------------------- #include <cuda.h> #include <cuda_runtime.h> #include <cuda_runtime_api.h> #include <device...
the_stack
#include <curand.h> #include <curand_kernel.h> #include <torch/extension.h> typedef torch::PackedTensorAccessor32<int32_t, 1, torch::RestrictPtrTraits> int32_accessor_1d; typedef torch::PackedTensorAccessor32<int32_t, 3, torch::RestrictPtrTraits> int32_accessor_3d; typedef torch::PackedTensorAccessor32<int32_t, 4, tor...
the_stack
#include <array/NDArrayFactory.h> #include <helpers/ConstantTadHelper.h> #include <helpers/MmulHelper.h> #include <helpers/ShapeUtils.h> #include <ops/declarable/helpers/top_k.h> //#include <ops/declarable/generic/helpers/BroadcastHelper.h> #include <cusolverDn.h> #include <exceptions/cuda_exception.h> namespace sd { ...
the_stack
#ifdef _WIN64 #define atoll(S) _atoi64(S) #define fseek(S, S1, S2) _fseeki64(S, S1, S2) #include <windows.h> #else #include <unistd.h> #endif using namespace std; using namespace thrust::placeholders; size_t total_count = 0, total_max; clock_t tot; unsigned int total_segments = 0, old_segments; size_t process_count; ...
the_stack
#include "DFImprovedSolver.h" #include "solvers/kernels/generateQT.h" /** * \brief Constructor -- get simulation parameters and grid. */ template <typename memoryType> DFImprovedSolver<memoryType>::DFImprovedSolver(parameterDB *pDB, domain *dInfo) { NavierStokesSolver<memoryType>::paramDB = pDB; NavierStokesSolve...
the_stack
namespace mshadow { namespace cuda { namespace { // workspace variables enum LSoftmaxTempSpaceType {kCost, kCosmt, kK, kSin2t, kFo, kCostM}; } #define CUDA_KERNEL_LOOP(i, n) \ for (int i = blockIdx.x * blockDim.x + threadIdx.x; \ i < (n); \ i += blockDim.x * gridDim.x) MSHADOW_XINLINE int LSPowOfMO(c...
the_stack
* Kernel utilities for loading tiles of data through global memory * with cache modifiers ******************************************************************************/ #pragma once #include "../../util/operators.cuh" #include "../../util/vector_types.cuh" #include "../../util/io/modified_load.cuh" B40C_NS_PREFIX...
the_stack
#include <cstdio> #include <cstdint> #include <cassert> #include "cuda_runtime.h" #include "cudabsp.h" #include "bsp_shared.h" #include "cudamatrix.h" #include "cudautils.h" //static inline __device__ __host__ void print_face( // BSP::DFace* pFace, // size_t faceIndex // ) { // // //char* c...
the_stack
#include "cudautils.h" #include "cudaSiftD.h" #include "cudaSift.h" /////////////////////////////////////////////////////////////////////////////// // Kernel configuration /////////////////////////////////////////////////////////////////////////////// __constant__ int d_MaxNumPoints; __device__ unsigned int d_PointCo...
the_stack
#include <cstdio> #include <vector> #include <bitset> #include <utility_kernels_pose.h> #include <multiple_rigid_pose_kernels.h> namespace pose { // OpenGL mapped input textures texture<float, cudaTextureType2D, cudaReadModeElementType> d_Zbuffer_texture; texture<float, cudaTextureType2D, cudaReadModeElementType> d_n...
the_stack
#include <kat/on_device/common.cuh> ///@cond #include <kat/detail/execution_space_specifiers.hpp> ///@endcond namespace kat { /** * @brief Uniform-naming scheme, templated-when-relevant wrappers of single PTX instruction * * @note should contain wrappers for all instructions which are not trivially * producible...
the_stack
#pragma once #include <gunrock/app/enactor_base.cuh> #include <gunrock/app/enactor_iteration.cuh> #include <gunrock/app/enactor_loop.cuh> #include <gunrock/oprtr/oprtr.cuh> #include <gunrock/app/snn/snn_problem.cuh> #include <gunrock/app/snn/snn_helpers.cuh> #include <gunrock/util/scan_device.cuh> #include <gunrock/u...
the_stack
#include "DeviceSymbolCopy.h" #include "LayoutTranslator.h" #include "SignalProcessingFitterQueue.h" #include "JobWrapper.h" #define TRANSLATE_DEBUG_OUTPUT 0 //////////////////////////////////// //Translator Functions //Translate the FgBuffer into the Image cube void TranslatorsFlowByFlow::TranslateFgBuffer_Regi...
the_stack
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/distance_op.h" #include "caffe2/utils/conversions.h" #include <cub/block/block_reduce.cuh> namespace caffe2 { namespace { template <typename T> __global__ void SquaredL2DistanceKernel( const int N, const int D, const T* X, const T* Y, T* distance) ...
the_stack
#include "utility.hpp" using namespace ppl::common; namespace ppl { namespace cv { namespace cuda { template <typename Tsrc> __global__ void unmaskedDevC1Kernel(const Tsrc* src, int rows, int cols, int src_stride, uint blocks, float* mean_values, float* stddev_values...
the_stack
#if ( defined GPU && MODEL == HYDRO && FLU_SCHEME == RTVD ) // check before compiling anything else #if ( NCOMP_PASSIVE != 0 ) # error : RTVD scheme does NOT support passive scalars !! #endif #include "CUFLU_Shared_FluUtility.cu" #include "CUDA_ConstMemory.h" #define to1D1(z,y,x) ( __umul24(z, FLU_NXT*FLU_NXT...
the_stack
#include <nvidia/helper_cuda.h> //#define BLK_SIZE 128 template<typename T, int32_t B> __device__ inline T integralGetCompLoc(T* A, int32_t i, int32_t j, int32_t w, int32_t h) { const int32_t iNeg = max(i-B,0)*(w+1); const int32_t jNeg = max(j-B,0); const int32_t iPos = min(i+B,h)*(w+1); const int32_t jPos = m...
the_stack
#include "lite/kernels/cuda/gru_compute.h" #include <string> #include <vector> #include "lite/backends/cuda/cuda_utils.h" #include "lite/backends/cuda/math/bias.h" #include "lite/backends/cuda/math/gru_forward.h" #include "lite/backends/cuda/math/sequence2batch.h" #include "lite/backends/cuda/target_wrapper.h" #inclu...
the_stack
template<typename scalar_t> __device__ __forceinline__ scalar_t logSumExp(scalar_t a, scalar_t b) { // standard log-sum-exp trick is used here to provide better numerical stability return (a >= b) ? a + std::log1p(exp(b-a)) : b + std::log1p(exp(a-b)); } // Vanilla transducer loss function (i.e. forward-backwar...
the_stack
namespace fastertransformer { template <typename T> __global__ void transpose_cache_batch_major(T* k_dst, T* v_dst, const float* k_src, const float* v_src, ...
the_stack
namespace nv { template<typename T1, typename T2> __global__ void gather(const size_t* d_idx, const T1* d_x_in, const T2* d_y_in, T1* d_x_out, T2* d_y_out, size_t len) { const size_t i = blockIdx.x * ...
the_stack
#include "k2/csrc/array_ops.h" #include "k2/csrc/cub.h" #include "k2/csrc/macros.h" #include "k2/csrc/math.h" #include "k2/csrc/ragged.h" #include "k2/csrc/ragged_utils.h" #include "k2/csrc/ragged_ops.h" namespace k2 { void CheckLayerEqual(int32_t layer, int32_t num_srcs, Ra...
the_stack
#include "common.cuh" #include <kat/on_device/collaboration/warp.cuh> #include <kat/on_device/collaboration/block.cuh> #include <kat/on_device/sequence_ops/warp.cuh> #include <kat/on_device/shuffle.cuh> ///@cond #include <kat/detail/execution_space_specifiers.hpp> ///@endcond namespace kat { namespace linear_grid { ...
the_stack
#include "libxomp.h" //---------------------------------------------------- // Device xomp_cuda_property retrieving functions #ifdef __cplusplus extern "C" { #endif DDE** DDE_head; DDE** DDE_tail; int xomp_num_devices = -1; int xomp_max_num_devices = -1; // -1 means un-initialized void** xomp_cuda_prop; #ifdef __...
the_stack
#if ( MODEL == HYDRO && ( FLU_SCHEME == MHM || FLU_SCHEME == MHM_RP ) ) // external functions #ifdef __CUDACC__ #include "CUFLU_Shared_FluUtility.cu" #include "CUFLU_Shared_DataReconstruction.cu" #include "CUFLU_Shared_ComputeFlux.cu" #include "CUFLU_Shared_FullStepUpdate.cu" #ifdef MHD #include "CUFLU_Shared_C...
the_stack
#include "octnet/gpu/gpu.h" #include "octnet/cpu/cpu.h" #include <thrust/execution_policy.h> #include <thrust/transform_reduce.h> #include <thrust/transform_scan.h> #include <thrust/iterator/counting_iterator.h> #include <thrust/functional.h> #include <thrust/equal.h> //-----------------------------------------------...
the_stack
namespace xgboost { namespace tree { // With constraints template <typename GradientPairT> XGBOOST_DEVICE float LossChangeMissing(const GradientPairT& scan, const GradientPairT& missing, const GradientPairT& parent_sum, ...
the_stack
#include <iostream> #include "viennacl.hpp" #include "viennacl_private.hpp" //include basic scalar and vector types of ViennaCL #include "viennacl/scalar.hpp" #include "viennacl/vector.hpp" #include "viennacl/vector.hpp" #include "viennacl/matrix.hpp" #include "viennacl/linalg/direct_solve.hpp" #include "viennacl/li...
the_stack
#include "utils/utils.cuh" #include "utils/intrinsics.cuh" #include "kernel_libs/kernel_fusion.cuh" #include "data_structures/graph.cuh" #include "data_structures/active_set.cuh" #include "data_structures/functor.cuh" #include "abstraction/config.cuh" #include <moderngpu/kernel_sortedsearch.hxx> #include <moderngpu/ke...
the_stack
* \test Tests conversion between matrices with different numeric type **/ // // *** System // #include <iostream> #include <iomanip> #include <vector> // // *** ViennaCL // //#define VIENNACL_DEBUG_ALL #include "viennacl/backend/memory.hpp" #include "viennacl/matrix.hpp" #include "viennacl/matrix_proxy.hpp" tem...
the_stack
__constant__ float eps=1e-8; __constant__ float grid_size = 1.0; __constant__ float distance_empty = 0.4; // first row, topology // second row, number of triangles in the corresponding topology // up to __3__ triangles __constant__ int acceptTopology[2][48] = {{1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 19,...
the_stack
// Thrust Dependencies #include <thrust/random.h> #include <thrust/device_ptr.h> #include <thrust/copy.h> // GL Dependency #include <glm/gtc/matrix_transform.hpp> // Octree-SLAM Dependencies #include <octree_slam/rendering/rasterize_kernels.h> #include <octree_slam/rendering/rasterize_tools.h> #include <octree_slam/c...
the_stack
template <typename SUM_T> __global__ void update_multi_node( SUM_T *sum_dst, unsigned *count_dst, const SUM_T *hist_sum_parent, const unsigned *hist_count_parent_count, const SUM_T *sum_src, const unsigned *count_src, const unsigned *__restrict__ parent_count_iter, const unsigned hist_size, const unsigned n) { ...
the_stack
extern "C" { #include "sph/sph_blake.h" } #include "cuda_helper.h" #include "miner.h" #include <memory.h> #define TPB 768 static const uint32_t c_IV256[8] = { 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19 }; __device__ __constant__ uint32_t _ALIGN(16) c_h[ 8]; _...
the_stack
#include "octnet/gpu/oc2col.h" #include "octnet/gpu/gpu.h" #include "octnet/gpu/buffer.h" #include "octnet/core/z_curve.h" __device__ inline bool oc2col_in_vol(const octree* in, const int d, const int h, const int w) { return d >= 0 && h >= 0 && w >= 0 && d < 8 * in->grid_depth && h < 8 * in->grid_height && w < 8 *...
the_stack
#if ( defined GRAVITY && defined GPU && POT_SCHEME == SOR && !defined USE_PSOLVER_10TO14 ) #define POT_NXT_F ( PATCH_SIZE+2*POT_GHOST_SIZE ) #define POT_NTHREAD ( RHO_NXT*RHO_NXT*POT_BLOCK_SIZE_Z/2 ) #define POT_USELESS ( POT_GHOST_SIZE%2 ) #define POT_USELESS2 ( POT_USELESS^(GRA_...
the_stack
#pragma once #include <cuda_runtime.h> #include <math_constants.h> #include "libvis/cuda/cuda_buffer.cuh" #include "libvis/logging.h" namespace vis { // Helper for point projection using the "pixel corner" origin convention, in CUDA code. struct PixelCornerProjector_ { PixelCornerProjector_() = default; // H...
the_stack
#include <map> #include <stdint.h> #include "miner.h" #include "salsa_kernel.h" #include "cuda_helper.h" typedef uint32_t sph_u32; #define SPH_ROTL32 ROTL32 #define SPH_ROTR32 ROTR32 __constant__ uint64_t ptarget64[4]; __constant__ uint32_t pdata[20]; // define some error checking macros #define DELIMITER '/' #defi...
the_stack
#include <cuda_runtime.h> #include <vector> #include <iostream> #include <chrono> #include <type_traits> using namespace tensorflow; const int kThreadsPerBlock = 256; #define min(a, b) ((a) > (b))? (b): (a) #define max(a, b) ((a) > (b))? (a): (b) __host__ __device__ __forceinline__ int divUp(int total, int grain...
the_stack
using namespace amgx; namespace amgx { namespace aggregation { namespace size8_selector { template <int NUM_COLS, typename IndexType> __global__ __launch_bounds__(256, 4) void my_findStrongestNeighbourBlockDiaCsr_NoMergeClean( const IndexType *row_offsets, const IndexType *column_indices, const float *edge_...
the_stack
#include <assert.h> #include <stdint.h> #include "rxmesh/context.h" #include "rxmesh/local.h" #include "rxmesh/types.h" namespace rxmesh { template <uint32_t blockThreads> __device__ __forceinline__ void load_uint16(const uint16_t* in, const uint16_t size, ...
the_stack
#include <thrust/transform.h> #include <thrust/functional.h> #include <thrust/device_ptr.h> #include <thrust/iterator/constant_iterator.h> #include <thrust/iterator/counting_iterator.h> #include <thrust/iterator/transform_iterator.h> #include <cub/iterator/counting_input_iterator.cuh> #include <cub/iterator/transform_...
the_stack
#include "cupoch/geometry/boundingvolume.h" #include "cupoch/geometry/graph.h" #include "cupoch/geometry/lineset.h" #include "cupoch/geometry/pointcloud.h" #include "cupoch/geometry/trianglemesh.h" #include "cupoch/geometry/distancetransform.h" #include "cupoch/geometry/geometry_functor.h" #include "cupoch/geometry/vox...
the_stack
#include <iostream> #include <cstdint> #include "include/gossip.cuh" #include "include/hpc_helpers/include/cuda_helpers.cuh" #include "include/hpc_helpers/include/timers.cuh" using gpu_id_t = gossip::gpu_id_t; using namespace helpers; #define BIG_CONSTANT(x) (x##LLU) __host__ __device__ uint64_t fmix64(uint64_t k) { ...
the_stack
* CTA-processing functionality for radix sort upsweep reduction kernels ******************************************************************************/ #pragma once #include "../../radix_sort/sort_utils.cuh" #include "../../util/basic_utils.cuh" #include "../../util/device_intrinsics.cuh" #include "../../util/io/loa...
the_stack
__global__ void comm_empty( real_2_t * __restrict sigma_in, real_2_t * __restrict sigma_out, real_2_t * __restrict hamiltonian) { } __global__ void comm_init ( const real_2_t * __restrict sigma_in, real_2_t * __restrict sigma_out, const real_2_t * __restrict hamiltonian, const i...
the_stack
#include "ScanArray.h" #include <iostream> #include <stdio.h> using namespace std; #define BLOCK_SIZE 1024 // 宏:NUM_BANKS // 定义了bank的数量。 #define NUM_BANKS 16 // 宏:LOG_NUM_BANKS // 定义了bank的对数值。 #define LOG_NUM_BANKS 4 // Kernel 函数: _scanNaiveKer(数组扫描的简单版本) // 简单版本的 scan 实现,每个线程处理一个元素。运行 log(n) 步, // 加 n * (log...
the_stack
#include "caffe/util/math_functions.hpp" #include "caffe/layers/operator/batch_norm_layer.hpp" //#include "caffe/layers/operator/cudnn_batch_norm_layer.hpp" #define BN_EPS float(1e-5) namespace caffe { //---------------------------------- forward --------------- static __global__ void kernel_local_stats(int num, int ...
the_stack
* \file * cub::BlockReduceTiles implements a stateful abstraction of CUDA thread blocks for participating in device-wide reduction. */ #pragma once #include <iterator> #include "../../block/block_load.cuh" #include "../../block/block_reduce.cuh" #include "../../grid/grid_mapping.cuh" #include "../../grid/grid_queu...
the_stack
#include <vector> namespace hvvr { struct CudaFormatDescriptor { uint32_t r = 0, g = 0, b = 0, a = 0; cudaChannelFormatKind channelType = cudaChannelFormatKindNone; cudaTextureReadMode readMode = cudaReadModeElementType; bool sRGB = false; uint32_t elementSize = 0; CudaFormatDescriptor() {} ...
the_stack
#include "caffe/blob.hpp" #include "caffe/common.hpp" #include "caffe/filler.hpp" #include "caffe/layer.hpp" #include "caffe/util/math_functions.hpp" #include "caffe/layers/inter_class_layer.hpp" //#include "stdio.h" namespace caffe { template <typename Dtype> __global__ void Weight_mean_gpu(int nthreads, const int...
the_stack
// Nearest lower power of 2 __device__ __inline__ uint flp2 (uint x) { return (0x80000000u >> __clz(x)); } //Computes the squared difference between two numbers template<typename T> __device__ __inline__ T L2p2(const T i1, const T i2) { T diff = i1 - i2; return diff*diff; } /* Adds new patch t...
the_stack
* \file * Operations for reading linear tiles of data into the CUDA thread block. */ #pragma once #include <iterator> #include <type_traits> #include "block_exchange.cuh" #include "../iterator/cache_modified_input_iterator.cuh" #include "../config.cuh" #include "../util_ptx.cuh" #include "../util_type.cuh" CUB_NA...
the_stack
Copyright (C) 2014-16 Andrea Vedaldi. All rights reserved. This file is part of the VLFeat library and is made available under the terms of the BSD license (see the COPYING file). */ #include "bits/impl/tinythread.h" #include "bits/imread.hpp" #include "bits/impl/imread_helpers.hpp" #include <vector> #include <strin...
the_stack
// This file was copied from libc++'s test suite, then modified to test CUDA. // For the most part, this consists of adding __device__ attributes and // deleting long double. // <cmath> // This test requires c++11 (it's mostly decltype stuff). #if __cplusplus >= 201103L #include <cmath> #include <type_traits> #incl...
the_stack
#include "cuda_utils.h" #include <vector> template <typename scalar_t> __global__ void chamfer_dist_kernel(int batch_size, int n, const scalar_t* __restrict__ xyz1, int m, const scalar_t* __restrict__ xyz2, scalar_t* __restrict__ dist, int* indexe...
the_stack
#include <cudf/column/column_view.hpp> #include <cudf/detail/iterator.cuh> #include <cudf/scalar/scalar.hpp> #include <cudf/utilities/traits.hpp> #include <thrust/binary_search.h> #include <thrust/execution_policy.h> #include <thrust/functional.h> #include <thrust/iterator/constant_iterator.h> #include <thrust/optiona...
the_stack
#include <stdio.h> // #include <vector> #include <cmath> #include <cassert> #ifdef CUDA_5 #include <helper_cuda.h> #define CUDA_SAFE_CALL checkCudaErrors #else #include <cutil.h> #endif #include "cuda_pointer.h" #define NTHREAD 64 // 64, 96, 128 or 192 #define NJBLOCK 28 // 8800GTS/512 has 16 #define NIBLOCK 16 // 16 ...
the_stack