text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
#include "modules/perception/inference/tensorrt/plugins/kernels.h" #include "modules/perception/inference/tensorrt/plugins/rcnn_proposal_plugin.h" namespace apollo { namespace perception { namespace inference { // nthreads = num_rois __global__ void get_rois_nums_kernel(const int nthreads, const float *rois, ...
the_stack
* cuPrintf.cu * * This is a printf command callable from within a kernel. It is set * up so that output is sent to a memory buffer, which is emptied from * the host side - but only after a cudaThreadSynchronize() on the host. * * Currently, there is a limitation of around 200 characters o...
the_stack
#include <stdio.h> #include <ATen/ATen.h> #include <cuda.h> #include <iostream> #include <cuda_runtime.h> __device__ __forceinline__ float atomicMax(float *address, float val) { int ret = __float_as_int(*address); while(val > __int_as_float(ret)) { int old = ret; if((ret = atomicCAS((int *...
the_stack
#include "CollisionGrid.cuh" #include "ConstraintsInfo.h" #include "CudaConstraints.cuh" #include "CudaData.cuh" #include "CudaSolver.h" #include "CudaUtils.cuh" #include <fstream> #include <thrust/binary_search.h> #include <thrust/gather.h> #define MIN_RADIUS 0.001f #define COLLISION_MARGIN 0.002f namespace viper { ...
the_stack
using namespace megdnn; using namespace cuda; namespace { struct BufferFetcherTexture { cudaTextureObject_t tex; __device__ __forceinline__ float get(uint32_t offset) { return tex1Dfetch<float>(tex, offset); } }; struct BufferFetcherRaw { const float* ptr; __device__ __forceinline__ flo...
the_stack
#include "src/FeatureLPPooling.cuh" #include "cuda/DeviceTensor.cuh" #include "cuda/CudaStaticAssert.cuh" #include "cuda/CudaUtils.cuh" #include "cuda/RegisterUtils.cuh" #include "cuda/util/CachedDeviceProperties.h" #include "THC.h" #include <boost/preprocessor/repetition/repeat.hpp> using namespace facebook::cuda; ...
the_stack
#include <nbla/array.hpp> #include <nbla/cuda/common.hpp> #include <nbla/cuda/function/deformable_convolution.hpp> #include <nbla/cuda/math.hpp> #include <nbla/singleton_manager.hpp> #include <nbla/variable.hpp> #include <nbla/cuda/utils/deformable_im2col.hpp> #include <algorithm> namespace nbla { template <typenam...
the_stack
template <class T> void free_data(T **ptr) { if (ptr) CUDACHECK(cudaFree(*ptr)); } void free_data_float(float **ptr) { free_data<float>(ptr); } void free_data_double(double **ptr) { free_data<double>(ptr); } void free_data_int(int **ptr) { free_data<int>(ptr); } template <class T> void copy_fecatorization_res...
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
// local dependency #include "electric_potential/src/density_function.h" DREAMPLACE_BEGIN_NAMESPACE /// define triangle_density_function template <typename T> inline __device__ DEFINE_TRIANGLE_DENSITY_FUNCTION(T); template <typename T> __global__ void __launch_bounds__(1024, 8) computeElectricForce( int num_bins...
the_stack
#include <array> #include <functional> #include <numeric> #include <vector> #include "caffe2/core/context_gpu.h" #include "caffe2/core/cudnn_wrappers.h" #include "caffe2/operators/spatial_batch_norm_op_impl.cuh" #include "caffe2/utils/math.h" #if CUDNN_VERSION_MIN(5, 0, 0) namespace caffe2 { namespace { void SetTe...
the_stack
#include <cuda_runtime_api.h> #include <cuda.h> #include <cuComplex.h> #include "num/gpu_reduce.h" #include "num/multind.h" #define CFL_SIZE 8 #define FL_SIZE 4 #define BLOCKSIZE 1024 static long gridsizeX(long N, unsigned int blocksize) { return (N + blocksize - 1) / blocksize; } static unsigned int gridsizeY(lon...
the_stack
#include <cstdio> #include "cuda_kernel_utils.h" #define POINT_BLOCK_SIZE 128 #define OFFSET_BLOCK_SIZE 512 ////////////////////////////////////////////////////////////////////////////////// GPU /** * Method to compute the key of each point. * @param pNumPoints Number of points. * @param pBatchSize ...
the_stack
#include "ew_op_gpu.h" __device__ __forceinline__ int div16(int numerator, int magic, int shift) { int res; asm("vmad.s32.u32.u32 %0, %1.h0, %2.h0, 0;" : "=r"(res) : "r"(numerator), "r"(magic)); return res >> shift; } __device__ __forceinline__ int mod16(int numerator, int div, int maxdiv) { int res; ...
the_stack
template<typename Ktraits> __global__ __launch_bounds__(Ktraits::THREADS_PER_CTA) void ln_bwd_kernel(void * __restrict__ dx_, void * __restrict__ dg_, void * __restrict__ d...
the_stack
#include <cublas_v2.h> #include <cuda_runtime.h> // includes cublaslt #include <cublasLt.h> // constants for fused bias+relu kernel #define BIAS_RELU_FW_NTHREADS 128 // forward number of thread per block #define BIAS_RELU_BW_NTHREADS_X 32 // backward number of thread in feature dim #define BIAS_RELU_BW_NTHREADS_Y 16 ...
the_stack
#include "CUFLU.h" #if ( MODEL == HYDRO ) // external functions #ifdef __CUDACC__ #include "CUFLU_Shared_FluUtility.cu" #if ( CHECK_INTERMEDIATE == EXACT ) # include "CUFLU_Shared_RiemannSolver_Exact.cu" #elif ( CHECK_INTERMEDIATE == HLLE ) # include "CUFLU_Shared_RiemannSolver_HLLE.cu" #elif ( CHECK_INTERMEDIA...
the_stack
\brief Unit tests for warp-level wmma gemm */ #include "cutlass/arch/wmma.h" #if defined(CUTLASS_ARCH_WMMA_SM70_ENABLED) #include "../../common/cutlass_unit_test.h" #include "cutlass/aligned_buffer.h" #include "cutlass/half.h" #include "cutlass/gemm/warp/default_mma_wmma_tensor_op.h" #include "cutlass/core_io.h" #i...
the_stack
#define STR1(X) #X #define STR(X) STR1(X) #define STRINGIFY(X,Y) X ## Y #define CON(X,Y) STRINGIFY(X,Y) #define KDir kernels #include "includes/ourmacros.h" /* __device__ __inline__ double ld_gbl_cg(const double *addr) { double return_value; asm("ld.global.cg.f64 %0, [%1];" : "=d"(return_value) : "l"(addr)...
the_stack
#include <pycaUtils.h> #include <GMemOpers.h> // TEST make sure boost isn't included in nvcc code #if defined(BOOST_COMPILER) int bla[-1]; #endif namespace PyCA { namespace Splatting{ __device__ void atomicSplatDistance(int* d_d, float x, float y, float z, int w, int h, int l) { int xInt = int(...
the_stack
// TODO: Pass expected values to the device, and results back to the host for // comparison. At the moment, errors only tell you which check failed, not // what the actual and expected values were, nor what arguments the tested // function was invoked with. // Note: // Testcases are adapted from those used in the Publ...
the_stack
#ifdef WIN32 bool IsOpenGLAvailable(const char *appName) { return true; } #else #if (defined(__APPLE__) || defined(MACOSX)) bool IsOpenGLAvailable(const char *appName) { return true; } #else // check if this is a linux machine #include <X11/Xlib.h> bool IsOpenGLAvailable(const char *appNam...
the_stack
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include "common.cuh" #include <kat/containers/array.hpp> #include <array> #include <memory> #include <kat/tuple.hpp> #include <stdio.h> #include <doctest.h> #include <cuda/api_wrappers.hpp> #include <type_traits> #include <cstdint> #include <vector> #include <algorithm> ...
the_stack
//#include <openssl/sha.h> #include <stdint.h> #include <miner.h> #include <cuda_helper.h> static uint32_t *d_hash[MAX_GPUS]; static uint32_t* d_hash_br1[MAX_GPUS]; static uint32_t* d_hash_br2[MAX_GPUS]; extern void quark_skein512_cpu_init(int thr_id, uint32_t threads); extern void quark_skein512_cpu_hash_64(int thr_...
the_stack
#include <random> #include <vector> #include <raft/cudart_utils.h> #include <raft/cuda_utils.cuh> #include <raft/handle.hpp> #include <raft/random/rng.hpp> #include "test_utils.h" #include <cuml/common/logger.hpp> #include <linalg/block.cuh> namespace MLCommon { namespace LinAlg { using namespace std; /* GEMM */...
the_stack
#define real float // Bilinear sampling is done in BHWD (coalescing is not obvious in BDHW) // we assume BHWD format in inputImages // we assume BHW(YX) format on grids __device__ void getTopLeft(float x, int width, int& point, float& weight) { /* for interpolation : stores in point and weight : ...
the_stack
template<typename scalar_t> __device__ scalar_t sign(scalar_t x0, scalar_t y0, scalar_t x1, scalar_t y1, scalar_t x2, scalar_t y2) { return (x0 - x2) * (y1 - y2) - (x1 - x2) * (y0 - y2); } template<typename scalar_t> __device__ bool PointInTriangle(scalar_t xp, scalar_t yp, scalar_t x0, scalar_t y0, scalar_...
the_stack
#pragma once #include <gunrock/oprtr/1D_oprtr/for_all.cuh> #include <gunrock/oprtr/1D_oprtr/for_each.cuh> namespace gunrock { namespace oprtr { /** * @brief Add the source vector to the destination vector with the same length * * @tparam T datatype of the vector. * * @param[in] d_dst Destination device-side vec...
the_stack
#include <nbla/array.hpp> #include <nbla/cuda/common.hpp> #include <nbla/cuda/function/interpolate.hpp> #include <nbla/cuda/utils/atomic_add.cuh> #include <nbla/cuda/utils/nd_index.cuh> #include <nbla/variable.hpp> namespace nbla { inline float compute_scale(int isize, int osize, bool align_corners) { return (osize...
the_stack
#include "gpu_treeshap.h" #include "tree_shap.h" const float inf = std::numeric_limits<tfloat>::infinity(); struct ShapSplitCondition { ShapSplitCondition() = default; ShapSplitCondition(tfloat feature_lower_bound, tfloat feature_upper_bound, bool is_missing_branch) : feature_lower_boun...
the_stack
namespace anakin{ namespace saber{ template <typename dtype> __global__ void decode_bbox_corner_variance_kernel(const int count, \ const dtype* loc_data, const dtype* prior_data, const dtype* variance, \ const int num_priors, const bool share_location, const int num_loc_classes, \ const int ba...
the_stack
// GLEW #define GLEW_STATIC #include <GL/glew.h> // GLFW #include <GLFW/glfw3.h> // CUDA 8.0, only for test now #include "cuda_runtime.h" #include "device_launch_parameters.h" // PBF #include "include/arcball_camera.h" #include "include/boundary_gpu.h" #include "include/config.h" #include "include/constants.h" #incl...
the_stack
This sample has two kernels, one doing the rendering every frame, and another one used to generate the mip map levels at startup. For rendering we use a "virtual" texturing approach, where one 2d texture stores pointers to the actual textures used. This can be achieved by the new cudaTextureObject introduced i...
the_stack
namespace xlib { template<unsigned ITEMS_PER_BLOCK, typename T> __global__ void mergePathLBPartition(const T* __restrict__ d_prefixsum, int prefixsum_size, T last_value, int num_merge, ...
the_stack
* Radix Sorting API * ******************************************************************************/ #pragma once #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include <float.h> #include <b40c/KernelCommon/b40c_error_synchronize.cu> #include <b40c/LsbRadixSort/radixsort_multi_c...
the_stack
#define TPB52 256 #define TPB50 128 __constant__ const uint2 keccak_round_constants[24] = { { 0x00000001, 0x00000000 }, { 0x00008082, 0x00000000 }, { 0x0000808a, 0x80000000 }, { 0x80008000, 0x80000000 }, { 0x0000808b, 0x00000000 }, { 0x80000001, 0x00000000 }, { 0x80008081, 0x80000000 }, { 0x00008009, 0x80000000 },...
the_stack
#include <stdio.h> #include <assert.h> #include <string.h> #include <limits.h> #include <math.h> #include <iostream> #include <algorithm> #include <iterator> #include <vector> #include <map> #include <cuda.h> #define RUN_CPU_SORTS //#define GET_DETAILED_PERFORMANCE #define gpucheck(ans) { gpuAssert((an...
the_stack
* @file * track_utils.cuh * * @brief tracking utilities function */ #pragma once namespace gunrock { namespace util { #define TO_TRACK false #define NUM_TO_TRACK 1 #define MAX_GPU 0 template <typename VertexT> __device__ __host__ __forceinline__ bool isTracking(VertexT node) { const VertexT node_to_track[] = ...
the_stack
using namespace std; namespace amgx { namespace idrmsync_solver { // Constructor template< class T_Config> IDRMSYNC_Solver_Base<T_Config>::IDRMSYNC_Solver_Base( AMG_Config &cfg, const std::string &cfg_scope) : Solver<T_Config>( cfg, cfg_scope), m_buffer_N(0) { std::string solverName, new_scope, tmp_scope; ...
the_stack
#include <array/NDArray.h> #include <array/NDArrayFactory.h> #include <cuda.h> #include <execution/LaunchContext.h> #include <graph/Context.h> #include <graph/Node.h> #include <graph/Variable.h> #include <graph/VariableSpace.h> #include <helpers/TAD.h> #include <ops/declarable/CustomOperations.h> #include <ops/specials...
the_stack
#include <thrust/complex.h> /////////////////////////////////////////////////////////////////////////////// // READER // /////////////////////////////////////////////////////////////////////////////// // Byte swap short __device__ short swap_int16( sh...
the_stack
#include <stdio.h> #include <stdlib.h> #include <string.h> //#include "KeccakTreeGPU.h" #include "KeccakTree.h" #include "KeccakF.h" __host__ void checkCUDAError(const char *msg) { cudaError_t err = cudaGetLastError(); if( cudaSuccess != err) { fprintf(stderr, "Cuda error: %s: %s.\n", msg, ...
the_stack
#include "Common.h" #define INFINITY ((float)(1e+300 * 1e+300)) __device__ __constant__ int screen_width; __device__ __constant__ int screen_pitch; __device__ __constant__ int screen_height; __device__ __constant__ Config config; // Frame Buffers __device__ __constant__ float4 * frame_buffer_albedo; __device__ __co...
the_stack
#include <ATen/ATen.h> #include <ATen/cuda/CUDAContext.h> #include <ATen/DeviceGuard.h> #include <THC/THC.h> #include <THC/THCDeviceUtils.cuh> #include <vector> #include <iostream> #include <cmath> int const threadsPerBlock = sizeof(unsigned long long) * 8; template <typename scalar_t> struct Point { scalar_t x...
the_stack
#include <torch/types.h> #include <ATen/ATen.h> #include <ATen/AccumulateType.h> #include <ATen/cuda/CUDAContext.h> #include <ATen/cuda/CUDAApplyUtils.cuh> #include <cuda.h> #include <cuda_runtime.h> #include <time.h> #include <pybind11/pybind11.h> #include <pybind11/stl.h> #include <vector> #define CHECK_CUDA(x)...
the_stack
#include <cuda_runtime.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <cmath> #include <GL/glew.h> #include <GL/glut.h> #include <cuda_gl_interop.h> #include "header.h" #include "visualisation.h" #define FOVY 45.0 // bo variables GLuint sphereVerts; GLuint sphereNormals; //Simulation o...
the_stack
#include "libhmsbeagle/GPU/GPUImplDefs.h" #include <stdlib.h> #include <string.h> #include <stdio.h> extern "C" { #elif defined(FW_OPENCL) #ifdef DOUBLE_PRECISION #pragma OPENCL EXTENSION cl_khr_fp64: enable #endif #define __umul24(x, y) (x * y) #endif //FW_OPENCL #if (!defi...
the_stack
__device__ static void geodesic(double* Variables, double* VariablesIn, double *y, double *dydx) { double r = y[0]; double theta = y[1]; double pr = y[4]; double ptheta = y[5]; double r2 = r * r; double twor = 2.0 * r; double sintheta = sin(theta); double costheta = cos(theta); double cos2 = co...
the_stack
#include <cuda_runtime_api.h> #include <stdio.h> #include "cuda_dxt.h" typedef unsigned int u32; typedef u32 UINT; struct vec3; struct uvec2; struct uvec3 { u32 r, g, b; __device__ uvec3(u32 r, u32 g, u32 b) : r(r), g(g), b(b) {} __device__ uvec3(u32 n = 0) : r(n), g(n), b(n) {} __device__ uvec3(con...
the_stack
#include <opencv2/cudafeatures2d.hpp> #include "cuda_runtime.h" #include "device_launch_parameters.h" #include "labeling_algorithms.h" #include "register.h" #define BLOCK_ROWS 16 #define BLOCK_COLS 16 using namespace cv; namespace { // Only use it with unsigned numeric types template <typename T> __device__ _...
the_stack
#include "cuda_error.h" #include "cuda_runtime.h" #include "Utils.h" #include "ResourcePool.h" #include "StreamManager.h" #include "SignalProcessingFitterQueue.h" //job types #include "SingleFitStream.h" #include "MultiFitStream.h" //#include "GenerateBeadTraceStream.h" #define MAX_EXECUTION_ERRORS 10 #define NUM_...
the_stack
namespace fastertransformer{ template <typename T> __inline__ __device__ T gelu(T x) { float cdf = 0.5f * (1.0f + tanhf((0.7978845608028654f * (x + 0.044715f * x * x * x)))); return x * cdf; } template <> __inline__ __device__ half2 gelu(half2 val) { half2 val_pow3 = __hmul2(val, __hmul2(val, val)); float2 tm...
the_stack
namespace paddle { namespace lite { namespace kernels { namespace cuda { using Tensor = lite::Tensor; using DDim = lite::DDim; #define MAX_VAL(a, b) (((a) > (b)) ? (a) : (b)) #define MIN_VAL(a, b) (((a) < (b)) ? (a) : (b)) __global__ void max_pool_kernel(const float* input, float* outp...
the_stack
namespace dgl { using runtime::NDArray; using namespace runtime::cuda; namespace aten { namespace impl { ///////////////////////////// BinaryElewise ///////////////////////////// template <typename IdType, typename Op> __global__ void _BinaryElewiseKernel( const IdType* lhs, const IdType* rhs, IdType* out, int64_...
the_stack
#include <assert.h> #include <stdio.h> #include <stdint.h> #include <sys/socket.h> // AF_LOCAL #include <poll.h> // POLL #include <sys/param.h> #define O_NONBLOCK 00004 #define O_GPUNET_BOUNCE 04000 #define EWOULDBLOCK 11 #ifndef UINT32_MAX #define UINT32_MAX 0xffffffffU #endif #define SOC_NONBLOCK(soc_...
the_stack
#include <cuda_runtime.h> #include <cuda_fp16.h> #include "cutensor.h" #define HANDLE_ERROR(x) { const auto err = x;\ if (err == CUTENSOR_STATUS_NOT_SUPPORTED) { return false; }\ if (err != CUTENSOR_STATUS_SUCCESS) {printf("Error: %s in line %d\n", cutensorGetErrorString(err), __LINE__); return false; } } #def...
the_stack
#include "utility.hpp" #include "norm.hpp" using namespace ppl::common; namespace ppl { namespace cv { namespace cuda { template <typename Tsrc, typename Tdst> __global__ void convertKernel(const Tsrc* src, int rows, int cols, int channels, int src_stride, const uchar* mask, int mask_stride, ...
the_stack
//#include "../src/kat/on_device/constexpr_math.cuh" #include <kat/on_device/constexpr_math.cuh> //#include "../external/doctest/doctest.h" namespace kernels { } // namespace kernels namespace kce = kat::constexpr_; // TODO: What about invalid arguments? template <typename I> struct compile_time_execution_results {...
the_stack
#include <gsl/gsl_math.h> #include <gsl/gsl_blas.h> #include <gsl/gsl_eigen.h> #include <gsl/gsl_matrix.h> #include <gsl/gsl_linalg.h> #include "int_lib/cints.h" #include "int_lib/crys.h" #include "typedef.h" #include "basis.h" #include "scf.h" #include "cuda_rys_sp.h" #include "cuda_rys_dp.h" int main(int argc, ch...
the_stack
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> #include <curand_kernel.h> #include <cuda_runtime.h> #include <device_launch_parameters.h> #include <cufft.h> #include "runtime/device/gpu/cuda_common.h" #define TWO_DIVIDED_BY_SQRT_PI 1.1283791670218446 #define CONSTANT_kB 0.00198716 #define...
the_stack
#define TPB 320 __constant__ uint32_t c_PaddedMessage80[32]; // padded message (80 bytes + padding) // #ifdef NOASM #include "cuda_x11_aes_noasm.cu" // #else // #include "cuda_x11_aes.cu" // #endif static __device__ __forceinline__ void AES_ROUND_NOKEY( const uint32_t*const __restrict__ sharedMemory, uint32_t &x0,...
the_stack
#include <cudf/column/column_device_view.cuh> #include <cudf/lists/lists_column_view.hpp> #include <cudf/utilities/bit.hpp> #include <io/utilities/block_utils.cuh> #include <io/utilities/config_utils.hpp> #include <io/utilities/time_utils.cuh> #include <cub/cub.cuh> #include <rmm/cuda_stream_view.hpp> #include <rmm/ex...
the_stack
#if (USE_TEXTURE) #define LOAD_FLOAT(i) tex1Dfetch<float>(texFloat, i) #define SET_FLOAT_BASE #else #define LOAD_FLOAT(i) d_Src[i] #define SET_FLOAT_BASE #endif //////////////////////////////////////////////////////////////////////////////// /// Position convolution kernel center at (0, 0) in the image ///////////////...
the_stack
using namespace std; namespace gpu { __global__ void unitarysingle( gpu_qstate_t * psireal, gpu_qstate_t * psiimag, gpu_qsize_t Dim, gpu_qsize_t Block, gpu_qstate_t matrix_real00, gpu_qstate_t matrix_real01, gpu_qstate_t ma...
the_stack
#define START_IL_TIMER() start = std::chrono::high_resolution_clock::now(); #define END_IL_TIMER(x) \ stop = std::chrono::high_resolution_clock::now(); \ duration = std::chrono::duration_cast<std::chrono::microseconds>(sto...
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 static int _ccv_nnc_mul_forw(const ccv_nnc_cmd_t cmd, const ccv_nnc_hint_t hint, const int flags, ccv_nnc_tensor_t* c...
the_stack
//////////////////////////////////////////////////////////////////////////////// //! Initialize the image array, ie, set all pixels to zero //! Essentially, this function has the same effect as the command: //! "cutilSafeCall(cudaMemcpy(image_device, image, image_bytes, cudaMemcpyHostToDevice))"; //! //! CUDA p...
the_stack
#include <nbla/array.hpp> #include <nbla/cuda/common.hpp> #include <nbla/cuda/function/group_normalization.hpp> #include <nbla/variable.hpp> // Kernels and ops #include <nbla/cuda/function/kernel/group_normalization.cuh> #include <nbla/cuda/function/kernel/normalization.cuh> #include <nbla/cuda/utils/reduce_ops/group_...
the_stack
#include "utility.hpp" using namespace ppl::common; namespace ppl { namespace cv { namespace cuda { __global__ void warpPerspectiveLinearKernel(const uchar* src, int src_rows, int src_cols, int channels, int src_stride, float coeffe0, float coeffe1, f...
the_stack
template <class Vector> void TestScatterSimple(void) { Vector map(5); // scatter indices Vector src(5); // source vector Vector dst(8); // destination vector map[0] = 6; map[1] = 3; map[2] = 1; map[3] = 7; map[4] = 2; src[0] = 0; src[1] = 1; src[2] = 2; src[3] = 3; src[4] = 4; dst[0] = 0; ds...
the_stack
#include <dnn-utility.h> using namespace std; CURAND_STATE::CURAND_STATE(unsigned seed, int N): _states(NULL) { cudaMalloc ( &_states, N * N * sizeof( curandState ) ); setupCuRandState <<< 1, N * N >>> ( _states, seed ); CCE(cudaDeviceSynchronize()); } curandState* CURAND_STATE::get() const { return _states; ...
the_stack
#include "common.h" #include "polish_E.h" // Some type definitions -- could get from common.h // typedef double Matches_5[5][3]; // typedef double Ematrix[3][3]; //---------------------------------------------------------------------------- // // This relies on a parametrization for an Essential Matrix as given // ...
the_stack
#include <limits> #include <cmath> // HACK TESTING #include <iostream> using std::cout; using std::endl; using std::max; using std::min; template<typename I, typename F> inline __device__ F clip(F x) { return min_gpu(max_gpu(x,F(minval_gpu<I>())),F(maxval_gpu<I>())); } template<typename F> inline __device__ F clip...
the_stack
* \file * cub::BlockRegionReduceByKey implements a stateful abstraction of CUDA thread blocks for participating in device-wide reduce-value-by-key. */ #pragma once #include <iterator> #include "device_scan_types.cuh" #include "../../block/block_load.cuh" #include "../../block/block_store.cuh" #include "../../block...
the_stack
// @author Yurii Shyrma (iuriish@yahoo.com), created on 20.04.2018 // #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/Point...
the_stack
#define threadsPerBlock 1024 #include "cuda_helper.h" __constant__ uint64_t c_PaddedMessage80[16]; // padded message (80 bytes + padding) __constant__ uint64_t c_tmp[8*9]; __constant__ uint64_t pTarget[4]; uint32_t *d_wxnonce[MAX_GPUS] = { 0 }; uint32_t *d_WXNonce[MAX_GPUS] = { 0 }; /** * Whirlpool CUDA kernel imp...
the_stack
struct LinearInitParams { DnnHandle handle; int batchSize, inputSize, outputSize; }; Tensor RnnModel::add_linear_node(Tensor x, int output_size, ParallelConfig pc, SharedVariable params) { assert(x.numDim == 3); assert(x.adim[2] == LSTM_PER_NODE_LENGTH); assert(x.pdim[2] == L...
the_stack
#include <kfusion/cuda/device.hpp> using namespace kfusion::device; /* * VECTOR FIELD */ __device__ __forceinline__ float4* sobfu::device::VectorField::beg(int x, int y) const { return data + x + dims.x * y; } __device__ __forceinline__ float4* sobfu::device::VectorField::zstep(float4* const ptr) const { retu...
the_stack
#include <iostream> #include <algorithm> #include "cuda_runtime.h" #include "device_launch_parameters.h" #include "bbcu/bbcu.h" #include "bbcu/bbcu_util.h" #include "Common.cuh" // ------------------------------------------------- // Forward // ------------------------------------------------- template <int N=6...
the_stack
#include "libvis/cuda/patch_match_stereo.cuh" #include <math_constants.h> #include "libvis/cuda/cuda_auto_tuner.h" #include "libvis/cuda/cuda_unprojection_lookup.cuh" #include "libvis/cuda/cuda_util.cuh" #include "libvis/cuda/cuda_util.h" #include "libvis/cuda/patch_match_stereo_cost.cuh" #include "libvis/cuda/patch_...
the_stack
#include "cuda_helper.h" #include "cuda_vectors.h" static uint32_t *d_gnounce[MAX_GPUS]; static uint32_t *d_GNonce[MAX_GPUS]; #define shl(x, n) (x << n) #define shr(x, n) (x >> n) #define ss0(x) (shr(x, 1)^ shl(x, 3) ^ ROTL32(x, 4) ^ ROTL32(x, 19)) #define ss1(x) (shr(x, 1)^ shl(x, 2) ^ ROL8(x) ^ ROTL32(x, 23...
the_stack
//#pragma once #include <gunrock/util/str_to_T.cuh> namespace gunrock { namespace util { template <> long strtoT_simple<long>(const char *str, char **str_end, int base) { return strtol(str, str_end, base); } template <> unsigned long strtoT_simple<unsigned long>(const char *str, char **str_end, ...
the_stack
#include "dragon/core/context_cuda.h" #include "dragon/utils/device/common_cub.h" #include "dragon/utils/math_functions.h" #include "dragon/utils/op_kernels.h" namespace dragon { namespace kernels { namespace { template <typename T, typename AccT> __global__ void _PRelu(const int N, const T* x, const T* w, T* y) { ...
the_stack
#include <stdio.h> #include "cuda_math.cuh" //----------------------------------------- GVDB Data Structure #define CUDA_PATHWAY #include "cuda_gvdb_scene.cuh" // GVDB Scene...
the_stack
#include "common.cuh" #include <kat/on_device/collaboration/warp.cuh> #include <type_traits> ///@cond #include <kat/detail/execution_space_specifiers.hpp> ///@endcond namespace kat { namespace collaborative { namespace warp { namespace detail { template<typename LHS, typename RHS = LHS, typename Result = LHS> str...
the_stack
#include "octnet/gpu/combine.h" #include "octnet/gpu/gpu.h" #include <cstdio> #include <cstdlib> __global__ void kernel_concat(ot_data_t* out, int n_leafs, const ot_data_t* in1, const ot_data_t* in2, const ot_size_t feature_size_in1, const ot_size_t feature_size_in2, const ot_size_t feature_size_out) { CUDA_KERNE...
the_stack
#include <cuda.h> #include <float.h> #include <stdint.h> // NanoVDB #include <nanovdb/NanoVDB.h> #include <nanovdb/util/HDDA.h> #include <nanovdb/util/Ray.h> #include <nanovdb/util/SampleFromVoxels.h> #define CUDA_PATHWAY #include <cuda_math.cuh> #include <cuda_gvdb_scene.cuh> #include <cuda_gvdb_nodes.cuh> // Short...
the_stack
#include <cuda.h> #include <cuda_runtime.h> #include <vector> #include <curand.h> #include <stdio.h> #include <math.h> #include <float.h> #include "cudaCG_all.h" //#define NUM_THREADS 512 #define BLOCK 512 #define CEIL_DIV(num, denum) (num+denum-1)/denum #define IDX(b,l,t,m,i,cum,L) (i+2*(m+t*(2*l+1)+cum[l]+b*cum[L+...
the_stack
__device__ float square(const float a) { return a*a; } /* * Block size 1x128 * blockIdx.x determines pixel.x, image idx in batches of 128*imgsPerThread * blockIdx.y determines pixel.y * * So each block does one output for some number of images and all the fliters. * * threadIdx.x determines img idx * * i...
the_stack
#define MAX_K 4 #define MAX_BATCH_SIZE 32 #define MAX_N 12 void FFModel::group_by(const Tensor& input, const Tensor& assign, Tensor* outputs, int n, float alpha, const char* name) { Group_by* group_by = new Group_by(*thi...
the_stack
#include "cudpp_mergesort.h" #include <cudpp_globals.h> #include <cudpp_util.h> #include "sharedmem.h" #include "cta/mergesort_cta.cuh" /** * @file * mergesort_kernel.cu * * @brief CUDPP kernel-level radix sorting routines */ /** \addtogroup cudpp_kernel * @{ */ /** @name MergeSort Functions * @{ */ ...
the_stack
#if ( MODEL == HYDRO && FLU_SCHEME == CTU ) // 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_ConstrainedTransport.cu" #endif...
the_stack
// This CUDA kernel produces the semi-ring product of two // sparse matrices of types T_A and T_B and common index space size n, to a // output matrix of type T_C. The matrices are sparse, with different numbers // of non-zeros and different sparsity patterns. // ie. we want to produce C = A'*B in the sense of the g...
the_stack
#include "PPPMForceComputeGPU.cuh" #include "hoomd/TextureTools.h" // __scalar2int_rd is __float2int_rd in single, __double2int_rd in double #ifdef SINGLE_PRECISION #define __scalar2int_rd __float2int_rd #else #define __scalar2int_rd __double2int_rd #endif #define GPU_PPPM_MAX_ORDER 7 // workaround for HIP bug #ifde...
the_stack
#include <kfusion/cuda/device.hpp> using namespace kfusion; using namespace kfusion::device; /* * POTENTIAL GRADIENT */ __global__ void sobfu::device::calculate_potential_gradient_kernel(float2* phi_n_psi, float2* phi_global, float4* nabla_phi_n_o_...
the_stack
#include "../kernels/transformerKernels.h" #include "../kernels/embKernels_int8.h" #include "../kernels/transformerKernels_int8.h" #include "cublas_helper.h" /** @file QuantTransformer encoder, composed by gemm lib and custom cuda kernel function */ namespace lightseq { namespace cuda { template <OperationType OpT...
the_stack
// System includes #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> // CUDA runtime #include <cuda_runtime.h> //CUFFT Header file #include <cufftXt.h> // helper functions and utilities to work with CUDA #include <helper_functions.h> #include <helper_cuda.h> // Complex data type typedef ...
the_stack
* \file * cub::PersistentBlockScan implements an abstraction of CUDA thread blocks for * participating in device-wide prefix scan. */ #pragma once #include <iterator> #include "../grid/grid_mapping.cuh" #include "../grid/grid_even_share.cuh" #include "../grid/grid_queue.cuh" #include "../../block/block_load.cuh" ...
the_stack
#pragma once // Julien Demouth's implementation of the Volkov strategy showed it is // better to fully unroll by hand and have as much stuff as possible // compile to immediate instructions. // 2008. Volkov and Kazian, Fitting FFT onto the G80 Architecture // // Write our own using a mix of Volkov for vertical FFTs an...
the_stack
#include <kat/on_device/ptx.cuh> #include <kat/common.hpp> #if ! __CUDA_ARCH__ >= 300 #error "This code can only target devices of compute capability 3.0 or higher." #endif ///@cond #include <kat/detail/execution_space_specifiers.hpp> ///@endcond namespace kat { // TODO: Consider using "sized types" (from cstdint)...
the_stack