text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
// The Mandelbrot CUDA GPU thread function /* Version using software scheduling of thread blocks. The idea here is to launch of fixed number of worker blocks to fill the machine, and have each block loop over the available work until it is all done. We use a counter in global memory to keep t...
the_stack
This example demonstrates several CUTLASS utilities in the context of a mixed-precision floating-point matrix product computation. These utilities are intended to be useful supporting components for managing tensor and matrix memory allocations, initializing and comparing results, and computing reference output....
the_stack
typedef long long ll_t; typedef unsigned long long ull_t; typedef struct __builtin_align__(32) { float s0, s1, s2, s3, s4, s5, s6, s7; } _float8; typedef union { _float8 f8; float val[8]; } float8; __device__ __forceinline__ float atomicMax(float *address, float val) { int ret = __float_as_int(*address); w...
the_stack
namespace lightseq { namespace cuda { template <typename T> void print_vec(const thrust::device_vector<T>& outv, std::string outn, int num_output_ele) { std::cout << outn << ": "; if (num_output_ele > 0) { num_output_ele = std::min(size_t(num_output_ele), outv.size()); thrust::copy(outv.begi...
the_stack
#include "mask/mergerMask.hpp" #include "backend/common/imageOps.hpp" #include "backend/cuda/deviceBuffer.hpp" #include "backend/cuda/deviceStream.hpp" #include "backend/cuda/surface.hpp" #include "cuda/util.hpp" #include "gpu/core1/voronoi.hpp" #include "gpu/memcpy.hpp" #include "mask/mergerMaskConstant.hpp" namesp...
the_stack
#include "HugeCTR/include/general_buffer2.hpp" #include "HugeCTR/include/resource_managers/resource_manager_ext.hpp" #include "HugeCTR/include/tensor2.hpp" #include "gtest/gtest.h" #include "input_generator.hpp" #include "utest/test_utils.h" // all your base are belong to us #define private public #define protected pu...
the_stack
#include "nvblox/experiments/integrators/cuda/experimental_integrator_input_frames.cuh" namespace nvblox { namespace experiments { __device__ inline float interpolateDepthTexture( cudaTextureObject_t depth_texture, const Eigen::Vector2f& u_px) { return tex2D<float>(depth_texture, u_px.x() + 0.5, u_px.y() + 0.5)...
the_stack
#include <thrust/execution_policy.h> #include <thrust/extrema.h> #include "caffe/blob.hpp" #include "caffe/common.hpp" #include "caffe/util/math_functions.hpp" #include "caffe/util/quantize.hpp" #include <float.h> namespace caffe { template <typename Dtype> __global__ void gpu_fix_kernel1(const int n, const Dtype *x...
the_stack
#include <cuda_runtime.h> #include <cublasLt.h> #include "sample_cublasLt_LtSgemmCustomFind.h" #include "helpers.h" /* Structure to store information about different run trials */ typedef struct { cublasLtMatmulAlgo_t algo; cublasStatus_t status; float time; size_t workspaceSize; // actual memory wor...
the_stack
/* * Shabal implementation. * * ==========================(LICENSE BEGIN)============================ * * Copyright (c) 2007-2010 Projet RNRT SAPHIR * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal...
the_stack
#include <complex> #include <iostream> #include <thrust/complex.h> // this is valid for compute capability 3.5 -> 8.0 (and beyond?) //const unsigned int MAX_BLOCKS_X = 4294967295; // 2^32-1 const unsigned int MAX_BLOCKS_Y = 65535; const unsigned int MAX_BLOCKS_Z = 65535; namespace strumpack { namespace gpu { ...
the_stack
#include "caffe/layers/eltwise_layer.hpp" #include "caffe/util/math_functions.hpp" namespace caffe { template<typename Dtype, typename MItype, typename MOtype> void EltwiseLayer<Dtype, MItype, MOtype>::GenerateProgram() { this->device_program_ = this->device_->CreateProgram(); stringstream ss; ss << this->devi...
the_stack
float THCudaBlas_Sdot(THCState *state, int64_t n, float *x, int64_t incx, float *y, int64_t incy) { if (n == 1) { incx = 1; incy = 1; } if ((n <= INT_MAX) && (incx <= INT_MAX) && (incy <= INT_MAX)) { int i_n = (int)n; int i_incx = (int)incx; int i_incy = (int)incy; float result; cubla...
the_stack
#define USE_SHARED 1 #include "cuda_helper.h" //static uint32_t *d_nonce[MAX_GPUS]; #define SPH_ROTL32(x, n) ROTL32(x, n) #define SPH_ROTR32(x, n) ROTR32(x, n) #define F1(x6, x5, x4, x3, x2, x1, x0) \ (((x1) & ((x0) ^ (x4))) ^ ((x2) & (x5)) ^ ((x3) & (x6)) ^ (x0)) #define F2(x6, x5, x4, x3, x2, x1, x0) \ (((...
the_stack
#include <helpers/ConstantTadHelper.h> #include <helpers/PointersManager.h> #include <helpers/ShapeUtils.h> #include <ops/declarable/helpers/transforms.h> namespace sd { namespace ops { namespace helpers { ////////////////////////////////////////////////////////////////////////// template <typename T> SD_KERNEL stati...
the_stack
#include <cub/cub.cuh> #include "cuda-decoder-kernels.h" #include "cuda-decoder-kernels-utils.h" namespace kaldi { namespace cuda_decoder { // Initialize the hashmap with NO_VAL // Called in InitDeviceData, when building the CudaDecoder object __global__ void init_hashmap_kernel(DeviceParams cst_dev_params) { const...
the_stack
#include "../config.cuh" #include "../thread/thread_search.cuh" #include "../util_math.cuh" #include "../util_namespace.cuh" #include "../util_ptx.cuh" #include "../util_type.cuh" #include "block_scan.cuh" #include <limits> #include <type_traits> CUB_NAMESPACE_BEGIN /** * \brief The BlockRunLengthDecode class suppor...
the_stack
#ifndef FLT_MAX #define FLT_MAX 3.402823466e+38F #endif #define EPSILON_ABS_ZERO 1e-10 #define EPSILON_DIV_ZERO 1e-4 // 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) { ...
the_stack
#include <thrust/sequence.h> #include <random> template <typename T> struct TypedColumnTest : public cudf::test::BaseFixture { cudf::data_type type() { return cudf::data_type{cudf::type_to_id<T>()}; } TypedColumnTest() : data{_num_elements * cudf::size_of(type()), rmm::cuda_stream_default}, mask{cudf::b...
the_stack
#define IDX2C(i,j,ld) (((j)*(ld))+(i)) #define IDX3C(c,i,j,in_h,in_w) ((c)*((in_h)*(in_w)) + (i)*(in_w) +(j)) #define IDX4C(n,c,i,j,in_c,in_h,in_w) ((n)*((in_c)*(in_h)*(in_w)) + (c)*((in_h)*(in_w)) + (i)*(in_w) +(j)) #define IDX5C(t,n,c,i,j,in_n,in_c,in_h,in_w) ((t)*((in_n)*(in_c)*(in_h)*(in_w)) + (n)*((in_c)*(in_h)*(i...
the_stack
#include "cuda_helper.h" #include "cuda_vector.h" #include "cuda_x11_aes.cu" static uint2 *d_nonce[MAX_GPUS]; static uint32_t *d_found[MAX_GPUS]; __device__ __forceinline__ uint32_t mul27(const uint32_t x) { // uint32_t result = (x << 5) - (x + x + x + x + x); uint32_t result = (x *27); // uint32_t result; // as...
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> static inline __device__ __half log(const half v) { return hlog(v); } template<typename NUM1, typename NUM2> __global__ void _ccv_nnc_...
the_stack
#include "vector_pool_gpu.h" #include "cuda_utils.h" __global__ void query_three_nn_by_stacked_local_idxs_kernel( const float *support_xyz, const float *new_xyz, const float *new_xyz_grid_centers, int *new_xyz_grid_idxs, float *new_xyz_grid_dist2, const int *stack_neighbor_idxs, const int *start_len, ...
the_stack
#include "support_kernels.cu" #include <stdio.h> ////////////////////////////// ////////////////////////////// ////////////////////////////// #define LEVEL_MIN 3 extern "C" __global__ void boundaryReduction(const int n_particles, real4 *positions, ...
the_stack
#include <stdio.h> #include <math.h> #include "common.h" /////////////////////////////////////////////////////////////// // Construct the particle boundary box // Setting particle normals require the explicit construction /////////////////////////////////////////////////////////////// void constructBoundaryBox(boundar...
the_stack
#define DATA_TYPE float //#define DATA_TYPE __half namespace std { template <typename _CharT, typename _Traits> inline basic_ostream<_CharT, _Traits> & tab(basic_ostream<_CharT, _Traits> &__os) { return __os.put(__os.widen('\t')); } } void print_usage(){ //b:l:m:e:g:j:i:p:r:w:o:h std::cout<<"runTe...
the_stack
#include <device_launch_parameters.h> namespace surfelwarp { namespace device { __device__ __constant__ float4 reference_node_coordinates[d_max_num_nodes]; /* This kernel do skinning of both vertex and nodes given * node coordinate and vertex coordinate, vertex.w can not be used */ __global__ void skinningVer...
the_stack
const int WARP_SIZE = 32; // The maximum number of threads in a block const int MAX_BLOCK_SIZE = 512; // Number of threads in a block given an input size up to MAX_BLOCK_SIZE static int getNumThreads(int nElem) { int threadSizes[5] = { 32, 64, 128, 256, MAX_BLOCK_SIZE }; for (int i = 0; i != 5; ++i) { if (nEl...
the_stack
#include <cuda_runtime.h> #include <cuda_runtime_api.h> #include <device_launch_parameters.h> #include "cuda/cuda_check.h" #include "ssids/gpu/kernels/datatypes.h" #define HOGG_ASSEMBLE_TX 128 // Block height #define HOGG_ASSEMBLE_TY 8 // Block width #define HOGG_ASSEMBLE_NTX 32 // Number of threads x #define HO...
the_stack
namespace timemachine { Context::Context( int N, const double *x_0, const double *v_0, const double *box_0, Integrator *intg, std::vector<BoundPotential *> bps, MonteCarloBarostat *barostat) : N_(N), intg_(intg), bps_(bps), step_(0), d_sum_storage_(nullptr), d_sum_storage_bytes_(0), bar...
the_stack
* \test Tests the individual building blocks of the eigenvalue routines based on the QR method. **/ /* * * Test file for qr-method * */ // include necessary system headers #include <iostream> #ifndef NDEBUG #define NDEBUG #endif #define VIENNACL_WITH_UBLAS #include "viennacl/scalar.hpp" #include "viennacl/ve...
the_stack
* \file * cub::DeviceHistogram provides device-wide parallel operations for constructing histogram(s) from a sequence of samples data residing within device-accessible memory. */ #pragma once #include <stdio.h> #include <iterator> #include <limits> #include "dispatch/dispatch_histogram.cuh" #include "../util_names...
the_stack
using namespace std; #ifndef MAP_FILE #define MAP_FILE MAP_SHARED #endif long fsize(int fd) { struct stat stat; int res = fstat(fd, &stat); return stat.st_size; } int printll(char *s) { while (*s != '\n' && *s != ',' && *s != '\t') { putchar(*s++); } return 0; } long hash(char *str0, int len) { uns...
the_stack
#include <nbla/cuda/common.hpp> #include <nbla/cuda/function/kernel/transpose.cuh> #include <nbla/cuda/utils/block_reduce.cuh> namespace nbla { // Kernels for SyncBatchNormalization template <typename T> __global__ void forward_batch_mean_sqmean_kernel(const int size1, const int size2, ...
the_stack
// ***************************************************************************** // advectScalar // ***************************************************************************** __global__ void SemiLagrangeRK2Ours( CudaFlagGrid flags, CudaMACGrid vel, CudaRealGrid src, CudaRealGrid dst, const float dt, const i...
the_stack
//#include <Graph/GraphBase.hpp> #include <Graph/GraphStd.hpp> #include <Graph/GraphWeight.hpp> #include <Graph/BellmanFord.hpp> #include <Graph/Dijkstra.hpp> #include <iostream> #include "Device/Util/Timer.cuh" #include "Device/DataMovement/impl/Block.i.cuh" #include <cooperative_groups.h> //#define ENABLE_MGPU #inc...
the_stack
#include <algorithm> #include <LightGBM/cuda/cuda_algorithms.hpp> #include "cuda_best_split_finder.hpp" namespace LightGBM { __device__ void ReduceBestGainWarp(double gain, bool found, uint32_t thread_index, double* out_gain, bool* out_found, uint32_t* out_thread_index) { const uint32_t mask = 0xffffffff; const ...
the_stack
#include "SFSSolverParameters.h" #include "SFSSolverState.h" #include "SFSSolverTerms.h" #include "SFSSolverUtil.h" #include "SFSSolverEquations.h" #include <assert.h> #include <stdio.h> #include <stdint.h> #include "ConvergenceAnalysis.h" #include "CUDATimer.h" #ifdef _WIN32 #include <conio.h> #endif #ifdef _WIN32...
the_stack
using namespace std; #define NUM_ELEM_PT 16 #define NUM_ELEM_BITSHIFT 4 #define ORDERV(x,a,b) { bool swap = reverse ^ (x[a]<x[b]); \ T auxa = x[a]; \ if (swap) { x[a] = x[b]; x[b] = auxa; } } #define B2V(x,a) { ORDERV(x,a,a+1) } #define B4V(x,a) { for (int i4=0;i4<2;i4++) { ORDERV(x,a+i4,a+i4+2) } B2V(x...
the_stack
#include <iostream> #include <algorithm> #include <chrono> #include "cuda_runtime.h" #include "device_launch_parameters.h" #include "bbcu/bbcu.h" #include "bbcu/bbcu_util.h" ////////////////////////////// // forward ////////////////////////////// template <typename T=float, bool fill=true> __global__ void kerna...
the_stack
* @file * @brief * This file contains preprocessors from raw image to a common format for * computational kernels. It also does color space transformations. */ #include "gpujpeg_colorspace.h" #include "gpujpeg_preprocessor_common.h" #include "gpujpeg_preprocessor.h" #include "gpujpeg_util.h" /** * Store value to...
the_stack
__device__ half2 cH2(const half* ptr, int offset){ return __ldg( (half2*)(ptr+offset) ); } __forceinline__ __device__ unsigned lane_id() { unsigned ret; asm volatile ("mov.u32 %0, %laneid;" : "=r"(ret)); return ret; } __forceinline__ __device__ unsigned warp_id() { // this is not equal to threadId...
the_stack
#include "utils.hpp" #include "kernels.cu" void benchmark( complex_t *sigma_in, complex_t *sigma_out, complex_t *hamiltonian, size_t size_sigma, size_t size_hamiltonian, complex_t *sigma_reference, complex_t *sigma_reference_transformed , const int dim, const int num, // global_wo...
the_stack
#include "join_common_utils.hpp" #include <cudf/detail/iterator.cuh> #include <cudf/detail/null_mask.hpp> #include <cudf/detail/utilities/cuda.cuh> #include <rmm/cuda_stream_view.hpp> #include <rmm/device_uvector.hpp> #include <cub/cub.cuh> namespace cudf { namespace detail { /** * @brief Remaps a hash value to a ...
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_CUDNN enum { CCV_NNC_CMD_CUDNN_CONV_FWD_ALGO_IMPLICIT_GEMM, // CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_GEMM CCV_NNC_CMD_CUDNN...
the_stack
#include "opencv2/core/cuda/common.hpp" #include "opencv2/core/cuda/utility.hpp" #include "opencv2/core/cuda/functional.hpp" #include "opencv2/core/cuda/limits.hpp" #include "opencv2/core/cuda/vec_math.hpp" #include "opencv2/core/cuda/reduce.hpp" using namespace cv::cuda; using namespace cv::cuda::device; namespace p...
the_stack
#include "CUDA_backend.hpp" #include "../util/Macros.hpp" #include "../util/ensure.hpp" #include <cudnn.h> #include <cublas_v2.h> #include <stdio.h> #include <sstream> #include <iostream> //////////////////////////////////////////////////////////// /// NAMESPACE UTIL MACROS ////////////////////////////////////////////...
the_stack
#if ( MODEL == HYDRO ) /******************************************************** 1. Ideal gas EoS with a constant adiabatic index (EOS_GAMMA) 2. This file is shared by both CPU and GPU GPU_EoS_Gamma.cu -> CPU_EoS_Gamma.cpp 3. Three steps are required to implement an EoS I. Set EoS auxiliary arrays II....
the_stack
#include <stdio.h> #include "helper_math.h" #include "matrix_math.h" #include "atmosphere/constants.h" #include "atmosphere/definitions.h" //#include <//assert.h> #define COMBINED_SCATTERING_TEXTURES __device__ float ClampCosine(float mu) { return clamp(mu, float(-1.0), float(1.0)); } __device__ float ClampDist...
the_stack
THC_API accreal THCTensor_(dot)(THCState *state, THCTensor *self, THCTensor *src) { #if defined(THC_REAL_IS_FLOAT) || defined(THC_REAL_IS_DOUBLE) || defined(THC_REAL_IS_HALF) THCAssertSameGPU(THCTensor_(checkGPU)(state, 2, self, src)); THArgCheck(THCTensor_(nElement)(state, self) == THCTensor_(nElement...
the_stack
typedef float d_type; #define DATA_TYPE CUDNN_DATA_FLOAT int GROUP_COUNT = 1; int INPUT_CHANNELS_PER_GROUP = 128; int choose_algo = -1; cudnnMathType_t MATH_TYPE = CUDNN_DEFAULT_MATH; cudnnTensorFormat_t INPUT_TENSOR_FORMAT = CUDNN_TENSOR_NCHW; int INPUT_BATCH_SIZE = 16; int INPUT_CHANNELS = 0; int INPUT_HEIGHT = 11...
the_stack
#pragma once #ifdef BOOST_FOUND // Boost includes for CPU Dijkstra SSSP reference algorithms #include <boost/config.hpp> #include <boost/graph/graph_traits.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/dijkstra_shortest_paths.hpp> #include <boost/property_map/property_map.hpp> #else #include <qu...
the_stack
namespace dart { // -=-=-=-=-=-=-=-=-=- helper -=-=-=-=-=-=-=-=-=- static inline __host__ __device__ unsigned char clamp(int c) { return min(max(0,c),255); } inline __host__ __device__ uchar3 hsv2rgb(float h, float s, float v) { float c = v*s; float hPrime = h/60.0f; float x = c*(1 - fabs(fmodf(hPrime...
the_stack
#define BSZ 16 /** * \namespace kernels * \brief Contains all custom-written CUDA kernels. */ namespace kernels { /** * \brief Computes u-component of the vector resulting from the explicit terms of * the discretized momentum equation, and element of the explcit convective terms. * * \param rn explicit...
the_stack
#include "nvcomp_cub.cuh" #include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <iostream> #include <stdexcept> #include <string> #include <vector> #if defined(_WIN32) #include <malloc.h> #endif namespace nvcomp { namespace highlevel { namespace { /***********************************...
the_stack
#define EIGEN_TEST_NO_LONGDOUBLE #define EIGEN_TEST_NO_COMPLEX #define EIGEN_TEST_FUNC argmax_all #define EIGEN_USE_GPU // this is needed on Beignet 1.2.1, Intel HD5500 (as far as I can tell?) // #define EIGEN_DEFAULT_DENSE_INDEX_TYPE int32_t // #define CALL_SUBTEST_1(expr) expr // #define CALL_SUBTEST_2(expr) expr /...
the_stack
* \file * cub::BlockRadixRank provides operations for ranking unsigned integer types within a CUDA thread block */ #pragma once #include <stdint.h> #include "../thread/thread_reduce.cuh" #include "../thread/thread_scan.cuh" #include "../block/block_scan.cuh" #include "../block/radix_rank_sort_operations.cuh" #incl...
the_stack
#include <iostream> using std::cout; using std::cerr; using std::endl; #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <mpi.h> namespace etics { namespace scf { __constant__ Real RadCoeff[(NMAX+1)*(LMAX+1)]; /*!< Stores coefficients related to the G */ ...
the_stack
#include <rmm/cuda_stream_view.hpp> #include <rmm/device_uvector.hpp> #include <cub/cub.cuh> #include <thrust/iterator/counting_iterator.h> #include <thrust/scan.h> #include <algorithm> using cudf::device_span; namespace cudf { namespace strings { namespace detail { namespace { // // This is the functor for the ur...
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_PAD ( WARP_SIZE/2 - (POT_NXT_F*2%WARP_SIZE) ) #define POT_NTHREAD ( RHO_NXT*RHO_NXT*POT_BLOCK_SIZE_Z/2 ) #define POT_USELESS ( POT_GHOST...
the_stack
#include "FiniteDiff.h" // TEST make sure boost isn't included in nvcc code #if defined(BOOST_COMPILER) int bla[-1]; #endif namespace PyCA { template<BackgroundStrategy bg, InterpT interp> __global__ void ApplyH_kernel(float* d_o, const float* d_i, const float* d_hx, const float* d_hy, ...
the_stack
namespace vilib { #define BLOCKDIM_X 32 #define BLOCKDIM_Y 4 #define RESULT_STEPS 8 #define HALO_STEPS 1 #define INSTANTIATE_1D_ROW(I, O) \ template __host__ void conv_filter_row_gpu<I,O>(const I * d_image_in, ...
the_stack
#include <cuda.h> #include <cuda_fp16.h> #include <cuda_profiler_api.h> #include <cuda_runtime.h> #include <ATen/ATen.h> #include <ATen/cuda/CUDAContext.h> #include <torch/extension.h> #include "dropout.cuh" #include "softmax.cuh" #include "strided_batched_gemm.cuh" namespace multihead_attn { namespace self_bias_add...
the_stack
#include "cupoch/collision/collision.h" #include "cupoch/geometry/intersection_test.h" #include "cupoch/geometry/lineset.h" #include "cupoch/geometry/occupancygrid.h" #include "cupoch/geometry/voxelgrid.h" namespace cupoch { namespace collision { namespace { const int MAX_NUM_COLLISIONS = 10000; template <typename L...
the_stack
//#include <stdio.h> using namespace kfusion::device; //////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Volume initialization namespace kfusion { namespace device { __global__ void clear_volume_kernel(TsdfVolume tsdf) { ...
the_stack
#include "Threshold.h" #include <iostream> using namespace std; #include "ErrorCode.h" // 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y // 定义了默认的线程块的尺寸。 #define DEF_BLOCK_X 32 #define DEF_BLOCK_Y 8 // Kernel 函数:_thresholdKer(使用 ImageCuda 实现的阈值分割) // 有输出图像但无高低像素值(low,high) static __global__ void // kernel 函数无返回值 _threshol...
the_stack
#define CUDA_NUM_THREADS 256 #define CUDA_MAX_THREADS 256 // #define THREADS_PER_BLOCK 64 #define DIM0(TENSOR) ((TENSOR).x) #define DIM1(TENSOR) ((TENSOR).y) #define DIM2(TENSOR) ((TENSOR).z) #define DIM3(TENSOR) ((TENSOR).w) #define DIM3_INDEX(TENSOR, xx, yy, zz, ww) ((TENSOR)[((xx) * (TENSOR##_stride....
the_stack
// Self #include "GDelData.h" // Project #include "Config.h" #include "GDelKernels.h" #include "thrust/extrema.h" // Externs extern int ThreadsPerBlock; extern int BlocksPerGrid; /////////////////////////////////////////////////////////////////// PointData // struct GetMortonNumber { // Note: No...
the_stack
#include <helpers/DebugHelper.h> #include <system/Environment.h> #include <system/op_boilerplate.h> #include <types/types.h> #include "../indexreduce.h" #include "../legacy_ops.h" using namespace simdOps; template <typename X, typename Z> static SD_KERNEL void simpleIndexReduceGeneric(const int op, void const *dx, s...
the_stack
#include <stdio.h> #include <stdlib.h> #include <vector> #include <algorithm> #include <nvbio/basic/timer.h> #include <nvbio/basic/console.h> #include <nvbio/basic/vector.h> #include <nvbio/basic/packedstream.h> #include <nvbio/strings/string_set.h> #include <nvbio/strings/seeds.h> #include <nvbio/basic/shared_pointer....
the_stack
using namespace std; void process_error(int severity, string err); // this should probably live in a utils header file #if defined(_MSC_VER) #define BIG_CONSTANT(x) (x) // Other compilers #else // defined(_MSC_VER) #define BIG_CONSTANT(x) (x##LLU) #endif // !defined(_MSC_VER) unsigned int hash_seed; struct float...
the_stack
#ifdef _WIN32 #ifndef NOMINMAX #define NOMINMAX #endif #endif #include "chrono_sensor/optix/shaders/device_utils.h" static __device__ __inline__ float NormalDist(const float& NdH, const float& roughness) { float rough_sqr = roughness * roughness; float den_2 = NdH * NdH * (rough_sqr - 1.f) + 1...
the_stack
* @brief The cugraph Jaccard core functionality * * @file jaccard.cu * ---------------------------------------------------------------------------**/ #include <cugraph/legacy/graph.hpp> #include <cugraph/utilities/error.hpp> #include <rmm/device_vector.hpp> #include <utilities/graph_utils.cuh> namespace cugraph { ...
the_stack
#include <cstdio> #include <iostream> #include <fstream> #include "cuda_kernel_utils.h" #define POINT_BLOCK_SIZE 128 #define POINT_BLOCK_PACK_SIZE 256 ////////////////////////////////////////////////////////////////////////////////// GPU __constant__ int cellOffsets[27][3]; /** * Method to count the neighboring ...
the_stack
using namespace cv::cuda; typedef unsigned char uchar; typedef unsigned short ushort; ////////////////////////////////////////////////////////////////////////////////// //// Non Local Means Denosing namespace cv { namespace cuda { namespace device { namespace imgproc { __device__ __forceinline__ floa...
the_stack
void THNN_(SpatialDepthwiseConvolution_updateOutput)( THCState *state, THCTensor *input, THCTensor *output, THCTensor *weight, THCTensor *bias, int kW, int kH, int dW, int dH, ...
the_stack
#include <cuda.h> #include <torch/torch.h> #include <torch/extension.h> namespace { __device__ float calc_single_iou(const float4 b1, const float4 b2) { // (lt), (rb) float l = max(b1.x, b2.x); float t = max(b1.y, b2.y); float r = min(b1.z, b2.z); float b = min(b1.w, b2.w); float first = (r - l); firs...
the_stack
#ifndef HAVE_OPENCV_CUDEV #error "opencv_cudev is required" #else #include "opencv2/cudev.hpp" using namespace cv::cudev; void mulScalar(const GpuMat& src, cv::Scalar val, bool, GpuMat& dst, const GpuMat& mask, double scale, Stream& stream, int); namespace { template <typename SrcType, typename ScalarType, ty...
the_stack
#include "cudakernel/memory/channel_shuffle.h" #include "cudakernel/common/divmod_fast.h" #include "cudakernel/common/memory_utils.h" #include "ppl/nn/common/tensor_shape.h" #include "ppl/common/retcode.h" #include "cudakernel/common/common.h" template <typename T> __global__ void ppl_cukernel_channel_shuffle( int...
the_stack
namespace amgx { namespace { template <typename TConfig> static void error_vector_too_small(const Vector<TConfig> &v, int required_size) { std::stringstream ss; ss << "Vector size too small: not enough space for halo elements." << std::endl; ss << "Vector: {tag = " << v.tag << ", " << "size = " << v.size()...
the_stack
#include "core/providers/cuda/cu_inc/common.cuh" #include "gist_impl.h" #include "gist.h" #include <cuda_runtime.h> using namespace onnxruntime::cuda; namespace onnxruntime { namespace cuda { template <typename T> __global__ void _GistBinarizeEncoderKernel( const T* input_data, bool* output_data, const CU...
the_stack
#include "util/type_name.hpp" #include "util/miscellany.cuh" #include <kat/on_device/streams/printfing_ostream.cuh> #include <kat/on_device/collaboration/block.cuh> #include <kat/on_device/time.cuh> #include <doctest.h> #include <cuda/api_wrappers.hpp> constexpr const auto num_grid_blocks { 2 }; constexpr const auto...
the_stack
* Abstract tile-processing functionality for partitioning downsweep scan * kernels ******************************************************************************/ #pragma once #include <b40c/util/cuda_properties.cuh> #include <b40c/util/basic_utils.cuh> #include <b40c/util/io/modified_load.cuh> #include <b40c/util/...
the_stack
#include "../traversal_common.cuh" #include <thrust/host_vector.h> #include <cub/cub.cuh> #include <rmm/device_vector.hpp> #include <rmm/exec_policy.hpp> #include <raft/cudart_utils.h> #include <raft/integer_utils.h> #include <raft/handle.hpp> namespace cugraph { namespace mg { namespace detail { template <typena...
the_stack
#include <torch/extension.h> #include "cuda_util.cuh" #include "data_spec_packed.cuh" #include "render_util.cuh" #include <iostream> #include <cstdint> #include <tuple> namespace { const int WARP_SIZE = 32; const int TRACE_RAY_CUDA_THREADS = 128; const int TRACE_RAY_CUDA_RAYS_PER_BLOCK = TRACE_RAY_CUDA_THREADS / WAR...
the_stack
#include <pybind11/pybind11.h> #include <iostream> #include <torch/extension.h> #include <functional> #include <pybind11/stl.h> #include <pybind11/functional.h> #include <torch/extension.h> #include <ATen/cuda/Exceptions.h> #include <ATen/cuda/detail/DeviceThreadHandles.h> #include <ATen/cuda/CUDAContext.h> __device__...
the_stack
#if __CUDA_ARCH__ >= 300 #define MAXXGRID 2147483647 #else #define MAXXGRID 65535 #endif void setsizes(long long N, dim3 *gridp, int *nthreadsp); __forceinline__ __device__ int solve1(int j) { float v = sqrtf((float)j); #pragma unroll for (int k = 0; k < 5; k++) { v = v - (v*(v+1)-2*j)/(2*v+1); // Newton it...
the_stack
using namespace sd; /** * This is utility kernel, that updates given special buffer with proper values in device memory */ extern "C" SD_KERNEL void prepareShapeBuffer(int* dimension, int* maxDimension, sd::LongType* specialPointer, int rows, sd::DataType dataType) { sd...
the_stack
#include <cstdio> #include <iostream> #include <fstream> #include "cuda_kernel_utils.h" #define EXECUTION_BLOCK_MLP_SIZE 128 ////////////////////////////////////////////////////////////////////////////////// GPU __device__ void evaluateMLP( const int pThreadId, const int pOffset, const int pTotalBlocks,...
the_stack
namespace VGUGV { namespace Common { texture<uchar, cudaTextureType2D, cudaReadModeElementType> FrameCuda_GrayImageTexture; texture<uchar, cudaTextureType2D, cudaReadModeElementType> FrameCuda_MaskImageTexture; __device__ bool pixelLieOutsideImageMask(CUDA_PitchMemory<uchar> maskImage, int x, int ...
the_stack
NAMESPACE_BEGIN(enoki) extern uint32_t cuda_log_level(); __global__ void arange(uint32_t n, uint32_t *out) { for (uint32_t i = blockIdx.x * blockDim.x + threadIdx.x; i < n; i += blockDim.x * gridDim.x) out[i] = i; } ENOKI_EXPORT size_t cuda_partition(size_t size, const void **ptrs_, void ***ptr...
the_stack
// input: radius (1), nsample (1), xyz1 (b,n,3), xyz2 (b,m,3) // output: idx (b,m,nsample), pts_cnt (b,m) __global__ void query_ball_point_gpu(int b, int n, int m, float radius, int nsample, const float *xyz1, const float *xyz2, int *idx, int *pts_cnt) { int batch_index = blockIdx.x; xyz1 += n*3*batch_index; ...
the_stack
#include "affinity.cuh" __constant__ int g_anDispRange[AFF_MAP_DISP_RANGE_MAX]; namespace impl { __device__ inline void l2dist_lu_exec(const device::DistCalcLUT* aDistCalcLUTs, float* aDescCalcLUT, float* aAffArray, int nOffsets, int nDescSize) { const int nThreads = blockDim.x; const int nThread...
the_stack
__global__ void k_forward_rush_larsen(double* states, const double t, const double dt, const double* parameters, const int n) { int i = blockIdx.x * blockDim.x + threadIdx.x; if (i < n) { // Assign states const double Xr1 = states[n * STATE_Xr1 + i]; const double Xr2 = states[...
the_stack
namespace surfelwarp { namespace device { enum { window_halfsize = 1, }; __device__ __forceinline__ float computeAlignmentErrorWindowSearch( cudaTextureObject_t depth_vertex_confid_map, cudaTextureObject_t depth_normal_radius_map, cudaTextureObject_t filter_foreground_mask, cudaTextureObject_t reference...
the_stack
#include "eaconv/src/EAConv2d_kernel.h" #include "eaconv/src/cuda_check.h" #include "eaconv/src/handle.h" #include "eaconv/src/conv_params.h" struct Workspace { Workspace(THCState* state, size_t size) : state(state), size(size), data(NULL) { checkCUDA(THCudaMalloc(state, &data, size)); } Workspace(cons...
the_stack
#define ITERATION 100 typedef unsigned char uint8_t; static const uint8_t sbox[16] = { 0xC0, 0x50, 0x60, 0xB0, 0x90, 0x00, 0xA0, 0xD0, 0x30, 0xE0, 0xF0, 0x80, 0x40, 0x70, 0x10, 0x20, }; // look-up tables for speeding up permutation layer static const uint8_t sbox_pmt_3[256] = { 0xF0, 0xB1, 0xB4, 0xE5, 0xE1, 0xA0,...
the_stack
#include "CUFLU.h" #if ( MODEL == HYDRO && defined MHD ) // external functions #ifdef __CUDACC__ #include "CUFLU_Shared_FluUtility.cu" #else // #ifdef __CUDACC__ void Hydro_Rotate3D( real InOut[], const int XYZ, const bool Forward, const int Mag_Offset ); void Hydro_Con2Flux( const int XYZ, real Flux[], const ...
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 the generic inner product functions of ViennaCL #include "viennacl/linalg/inner_prod.hpp" //include the generic norm...
the_stack
#include <layers/fully_connected_layer.hpp> #include <linalg/matrix_vector_op.cuh> #include <linalg/reduce.cuh> #include <utils.cuh> #include <utils.hpp> #include <vector> namespace HugeCTR { namespace { void __global__ add_bias_kernel_row(float* data, const float* bias, const int m, const int n) { int offset = bl...
the_stack