text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
#include <thrust/device_vector.h>
#include <thrust/tuple.h>
#include <thrust/execution_policy.h>
#include <thrust/copy.h>
#include <thrust/sort.h>
#include <thrust/binary_search.h>
#include <thrust/unique.h>
#include <thrust/sequence.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/constant_i... | the_stack |
#include <vector>
#include <math.h>
#include "geometry/grid_3d.h"
#include "geometry/SE3.h"
#include "util/mirrored_memory.h"
namespace dart {
inline __device__ __host__ bool intersectBox(float3 rayDir, float3 origin, float3 boxmin, float3 boxmax, float2 * t) {
//double3 rayDir = make_double3(r.x,r.y,r.z);
/... | the_stack |
#include "debugging.h"
#include "hash_compacting.h"
#include "hash_functions.h"
#include "hash_table.cuh"
#include <cudpp.h>
#include "cuda_util.h"
#include <set>
namespace CudaHT {
namespace CuckooHashing {
/* --------------------------------------------------------------------------
Retrieval functions.
---... | the_stack |
// maximum # of GTYPE elements allocating on constant memory: 4096
__constant__ GTYPE matrix_const_gpu[1024];
__constant__ ITYPE matrix_mask_list_gpu[1024];
__constant__ UINT sorted_insert_index_list_gpu[15];
__constant__ UINT target_index_list_gpu[15];
/** vqcsim からの移植
* perform multi_qubit_Pauli_gate with XZ mask... | the_stack |
//#define __CUDA_ARCH__ 350
//#define USE_INTERPOLATED_EMPTY
namespace {
enum ModelFuncEvaluationOutputMode { NoOutput, OneParam, TwoParams };
}
//empty t
__device__
//void interpolateEmpty( float * interPolTrace, const float * emptyTracesRegion, const unsigned short * RegionMask, const size_t regId, const size_t... | the_stack |
//#include "timer-util.h"
#include "gpu.cuh"
#include "ldgm-session-gpu.h"
struct coding_params {
int num_lost;
int k;
int m;
int packet_size;
int max_row_weight;
};
__global__ void frame_encode(char * data,int * pcm,struct coding_params * params);
__global__ void frame_encode... | the_stack |
//#define SOLVE_ZERO_INI_GUESS
//#define DEBUG
//#define DEBUGX
namespace amgx
{
// parameter is used as test name
DECLARE_UNITTEST_BEGIN(EnergyminAlgorithmTest);
std::string get_A_input_Dir() { return "Internal/energymin/input_matrix/"; }
std::string get_ext_str() { return ".mtx"; }
void generateInputFilenames(co... | the_stack |
#include <map>
#include <set>
#include <glog/logging.h>
class ConstructGradient {
public:
template <typename FloatT>
static typename TransformStorage<FloatT>::GradientType* construct(
const typename Storage<FloatT>::Gradients& gradients,
const TransformStorage<FloatT>& param,
const ParamI... | the_stack |
#include <thrust/binary_search.h>
#include <thrust/device_vector.h>
#include <thrust/gather.h>
#include <thrust/remove.h>
#include <thrust/sort.h>
#include <thrust/unique.h>
#include "nvblox/core/accessors.h"
#include "nvblox/core/common_names.h"
#include "nvblox/integrators/integrators_common.h"
#include "nvblox/mesh... | the_stack |
#define CUDA_1D_KERNEL_LOOP(i, n) \
for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < n; \
i += blockDim.x * gridDim.x)
__global__
void CropAndResizeKernel(
const int nthreads, const float *image_ptr, const float *boxes_ptr,
const int *box_ind_ptr, int num_boxes, int batc... | the_stack |
#if ( MODEL == HYDRO )
/********************************************************
1. Isothermal EoS (EOS_ISOTHERMAL)
2. This file is shared by both CPU and GPU
GPU_EoS_Isothermal.cu -> CPU_EoS_Isothermal.cpp
3. Three steps are required to implement an EoS
I. Set EoS auxiliary arrays
II. Implement EoS ... | the_stack |
#include "dali/kernels/signal/dct/dct_gpu.h"
#include <cmath>
#include "dali/core/common.h"
#include "dali/core/convert.h"
#include "dali/core/error_handling.h"
#include "dali/core/format.h"
#include "dali/core/util.h"
#include "dali/kernels/common/utils.h"
#include "dali/kernels/kernel.h"
#include "dali/kernels/signal... | the_stack |
#define ROUND_OFF 50000
#define CUDA_NUM_THREADS 1024
#define WARPS_PER_BLOCK 1
#define THREADS_PER_WARP 32
#define CUDA_KERNEL_LOOP(i, n) for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < (n); i += blockDim.x * gridDim.x)
#define GET_BLOCKS(n, t) (n+t-1) / t
// == Dimension rearrangement Kernel
__global__ vo... | the_stack |
#include "datacu.hpp"
#include <assert.h>
#include <cfloat>
#include <algorithm>
#include <sm_20_atomic_functions.h>
// -------------------------------------------------------------------
// Helpers
// --------------------------------------------------------... | the_stack |
using namespace nvinfer1;
using nvinfer1::plugin::InstanceNormalizationPlugin;
using nvinfer1::plugin::InstanceNormalizationPluginCreator;
template <typename T, int32_t THREADS_PER_CTA>
__global__ __launch_bounds__(THREADS_PER_CTA) void in3dReluActivation(
T* __restrict dst, T* __restrict src, float alpha, int32_t... | the_stack |
#include "octnet/gpu/unpool.h"
#include "octnet/gpu/gpu.h"
#include <cstdlib>
__global__ void kernel_gridunpool2x2x2_struct(octree out, int n_blocks, ot_size_t feature_size, const octree in) {
CUDA_KERNEL_LOOP(out_grid_idx, n_blocks) {
int gn,ogd,ogh,ogw;
octree_split_grid_idx(&out, out_grid_idx, &gn, &ogd... | the_stack |
#include "caffe/common.hpp"
#include "caffe/util/im2col.hpp"
namespace caffe {
template <typename Dtype, int num_axes>
__global__ void im2col_gpu_kernel(const int n, const Dtype* data_im,
const int* im_shape, const int* col_shape,
const int* kernel_shape, const int* pad, const int* stride,
Dtype* data_col... | the_stack |
#include "FlutterBinarize.h"
#include "Histogram.h"
#include <iostream>
#include <string.h>
using namespace std;
#include "time.h"
#include "stdlib.h"
#include "curand.h"
#include "curand_kernel.h"
// 宏:GET_MIN(a, b)
// 返回两个数的最小值。
#define GET_MIN(a, b) ((a) < (b) ? (a) : (b))
// 宏:GET_MAX(a, b)
// 返回两个数的最大值。
#defi... | the_stack |
namespace anakin{
namespace saber{
//! general kernel for softmax
template <typename dtype>
__global__ void softmax_max_kernel(int total_size, const dtype* in_data, dtype* out_data, \
dtype min_data, int inner_num, int outer_num, int axis_size){
//! compute data index
int idx = blockIdx.x * blockDim.... | the_stack |
#if(CUDAGMM_VERSION == 4)
#define SWAP(a, b, t) t = (a); a = (b); b = (t)
__constant__ CvFastBgGMMParams d_GMMParams;
__constant__ CvFastBgGMMData d_GMMData;
__constant__ int d_arrImageInfo[ImageInfoCount];
/*====================================================================================*/
// forward d... | the_stack |
// -----------------------------------------------------------------------------------------
// NVEnc by rigaya
// -----------------------------------------------------------------------------------------
//
// The MIT License
//
// Copyright (c) 2014-2016 rigaya
//
// Permission is hereby granted, free of cha... | the_stack |
#include <ctc.h>
#include "test.h"
bool small_test() {
const int alphabet_size = 5;
const int T = 2;
std::vector<float> activations = {0.1, 0.6, 0.1, 0.1, 0.1,
0.1, 0.1, 0.6, 0.1, 0.1};
// Calculate the score analytically
float expected_score;
{
... | the_stack |
static __constant__ const uint8_t c_perm[8][8] = {
{ 2, 3, 6, 7, 0, 1, 4, 5 },{ 6, 7, 2, 3, 4, 5, 0, 1 },{ 7, 6, 5, 4, 3, 2, 1, 0 },{ 1, 0, 3, 2, 5, 4, 7, 6 },
{ 0, 1, 4, 5, 6, 7, 2, 3 },{ 6, 7, 2, 3, 0, 1, 4, 5 },{ 6, 7, 0, 1, 4, 5, 2, 3 },{ 4, 5, 2, 3, 6, 7, 0, 1 }
};
static __constant__ const uint32_t c_IV_512[32... | the_stack |
#include "CascadedCommon.h"
#include "CascadedCompressionGPU.h"
#include "CascadedDecompressionKernels.cuh"
#include "CascadedMetadata.h"
#include "CascadedMetadataOnGPU.h"
#include "Check.h"
#include "CudaUtils.h"
#include "nvcomp_cub.cuh"
#include "type_macros.h"
#include "unpack.h"
#include <cassert>
#include <iost... | the_stack |
#pragma once
#include <set>
#include <map>
#include <vector>
#include <algorithm>
//#define KNN_TEST_DEBUG
#ifdef KNN_TEST_DEBUG
#define debug(a...) printf(a)
#else
#define debug(a...)
#endif
namespace gunrock {
namespace app {
namespace knn {
/**
* @brief Speciflying parameters for KNN Problem
* @param ... | the_stack |
#include <algorithm>
// Pseudo-random number generator
namespace amgx
{
static __host__ __device__ __forceinline__ unsigned int hash_function(unsigned int a, unsigned int seed, unsigned int rows = 0)
{
a ^= seed;
a = (a + 0x7ed55d16) + (a << 12);
a = (a ^ 0xc761c23c) + (a >> 19);
a = (a + 0x165667b1) ... | the_stack |
* \file
* cub::BlockScanTiles implements a stateful abstraction of CUDA thread blocks for participating in device-wide prefix scan.
*/
#pragma once
#include <iterator>
#include "scan_tiles_types.cuh"
#include "../../block/block_load.cuh"
#include "../../block/block_store.cuh"
#include "../../block/block_scan.cuh"
... | the_stack |
#include <opencv2/cudafeatures2d.hpp>
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include "labeling_algorithms.h"
#include "register.h"
// Rasmusson2013
#define BLOCK_SIZE 6
#define PATCH_SIZE (BLOCK_SIZE + 2)
using namespace cv;
using namespace std;
namespace {
// This kernel makes use ... | the_stack |
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "caffe/util/math_functions.hpp"
#include "caffe/common.hpp"
#include "GeneralizedPatchMatch.cuh"
#include "Combo.cuh"
#define ENABLE_VIS 0
struct Parameters
{
std::vector<std::string> layers; //which layer... | the_stack |
#include "common.cuh"
#include "../../ball_cover_common.h"
#include "../block_select_faiss.cuh"
#include "../haversine_distance.cuh"
#include "../selection_faiss.cuh"
#include <cstdint>
#include <limits.h>
#include <raft/cuda_utils.cuh>
#include <faiss/gpu/utils/Limits.cuh>
#include <faiss/gpu/utils/Select.cuh>
#in... | the_stack |
// includes
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <stdio.h>
#include "shrUtils.h"
#include "cmd_arg_reader.h"
using namespace std;
// size of PGM file header
const unsigned int PGMHeaderSize = 0x40;
#define MIN_EPSILO... | the_stack |
template <typename scalar_t>
__global__ void FaceAreasNormalsForwardKernel(
const scalar_t* __restrict__ verts,
const int64_t* __restrict__ faces,
scalar_t* __restrict__ face_areas,
scalar_t* __restrict__ face_normals,
const size_t V,
const size_t F) {
const size_t tid = blockIdx.x * blockDim.... | the_stack |
// #include <mem.h>
#include "interp.h"
#include "GSplat.h"
#include "GSplat.cuh"
#include <GMemOpers.h>
// #include "GImageFieldOpers.h"
// #include "GImageOpers.h"
// #include "FOpers.h"
#include "FiniteDiff.h"
// TEST make sure boost isn't included in nvcc code
#if defined(BOOST_COMPILER)
int bla[-1];
#endif
na... | the_stack |
#include <cudatbx/cuda_utilities.cuh>
#include <cudatbx/math/reduction.cuh>
#include <cudatbx/scattering/direct_summation.h>
#include <cudatbx/scattering/form_factors.cuh>
/* ============================================================================
Changing fType will affect the number of values that can be stor... | the_stack |
#include <cublas_v2.h>
#include <thrust/device_ptr.h>
#include <thrust/functional.h>
#include <thrust/transform_reduce.h>
#include "cml/cml_matrix.cuh"
#include "cml/cml_utils.cuh"
#include "cml/cml_vector.cuh"
// Cuda Matrix Library
namespace cml {
namespace {
cublasFillMode_t InvFillMode(cublasFillMode_t uplo) {... | the_stack |
#pragma once
#include <iostream>
#include <math.h>
#include <gunrock/app/problem_base.cuh>
namespace gunrock {
namespace app {
namespace pr_nibble {
/**
* @brief Speciflying parameters for pr_nibble Problem
* @param parameters The util::Parameter<...> structure holding all parameter
* info \return cudaError_t e... | the_stack |
#include "caffe/filler.hpp"
#include "caffe/layer.hpp"
#include "caffe/util/im2col.hpp"
#include "caffe/util/math_functions.hpp"
#include "caffe/vision_layers.hpp"
namespace caffe {
__global__ void sync_conv_groups_highway() { }
template <typename Dtype>
__global__ void ReLUForward(const int n, const Dtype* in, Dt... | the_stack |
#if defined(_WIN32)
#include <stddef.h>
#else
#include <inttypes.h>
#endif
#define PAGE_SIZE 4096
// threshold to consider using pre-allocated pool
#define PINNED_POOL_SIZE_THRESHOLD (100*1024*1024)
// 8 MB for pool allocations on host & device
#define PINNED_POOL_SIZE ( 100 * 1024 * 1024)
// set that macro... | the_stack |
#include "common.h"
#include "gptKernels_int8.h"
#include "transformerKernels.h"
/**
@file
Implemented the cuda kernel function and its launcher
that required by GPT model.
Currently, fp16 and fp32 versions are provided
*/
namespace lightseq {
namespace cuda {
__forceinline__ __device__ int8_t float2int8(float x, float... | the_stack |
#define GAMMA 1.4f
#define iterations 2000
#ifndef block_length
#define block_length 192
#endif
#define NDIM 3
#define NNB 4
#define RK 3 // 3rd order RK
#define ff_mach 1.2f
#define deg_angle_of_attack 0.0f
#define VAR_DENSITY 0
#define VAR_MOMENTUM 1
#define VAR_DENSITY_ENERGY (VAR_MOMENTUM+NDIM)
#define NVAR (V... | the_stack |
#ifdef __INTELLISENSE__
/* just for vstudio code colors */
#define __CUDA_ARCH__ 520
#endif
#define TPB52 32
#define TPB50 16
#define Nrow 8
#define Ncol 8
#define memshift 3
__constant__ const uint2x4 blake2b_IV[2] = {
0xf3bcc908lu, 0x6a09e667lu,
0x84caa73blu, 0xbb67ae85lu,
0xfe94f82blu, 0x3c6ef372lu,
0x5f1d36f... | the_stack |
/** \addtogroup cudpp_app
*
*/
/** @name Segmented Scan Functions
* @{
*/
#include <cstdlib>
#include <cstdio>
#include <assert.h>
#include "cuda_util.h"
#include "cudpp.h"
#include "cudpp_util.h"
#include "cudpp_plan.h"
#include "cudpp_manager.h"
#include "kernel/segmented_scan_kernel.cuh"
#include "kernel/vect... | the_stack |
#include <sobfu/cuda/utils.hpp>
/* cuda includes */
#include <curand.h>
#include <curand_kernel.h>
/* thrust includes */
#include <thrust/device_vector.h>
#include <thrust/extrema.h>
using namespace kfusion::device;
////////////////////////////////////////////////////////////////////////////////////////////////////... | the_stack |
#include "cudapoa_structs.cuh"
#include <claraparabricks/genomeworks/utils/cudautils.hpp>
#include <claraparabricks/genomeworks/utils/limits.cuh>
#include <stdio.h>
namespace claraparabricks
{
namespace genomeworks
{
namespace cudapoa
{
template <typename ScoreT>
__device__ __forceinline__ ScoreT* get_score_ptr_t... | the_stack |
#define CUDA_KERNEL_LOOP(i, n) \
for (int i = blockIdx.x * blockDim.x + threadIdx.x; \
i < (n); \
i += blockDim.x * gridDim.x)
const int CUDA_NUM_THREADS = 512;
inline int GET_BLOCKS(const int N)
{
return (N + CUDA_NUM_THREADS - 1) / CUDA_N... | the_stack |
// Params ---------------------------------------------------------------------
struct Params {
int device;
int n_gpu_threads;
int n_gpu_blocks;
int n_threads;
int n_warmup;
int n_reps;
const char *file_name;
const char *comparison_file;
... | the_stack |
// ConnectRegionNew.cu
// 实现图像的连通区域操作
#include "ConnectRegionNew.h"
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
// 宏:DEF_BLOCK_H
// 定义了默认的一个线程块处理图像的行数。
#define DEF_BLOCK_H 4
// 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y
// 定义了默认的线程块的尺寸。
#define DEF_BLOCK_X 4
#define DEF_BLOCK_Y 2
// 宏:CON... | the_stack |
#include <stdio.h>
#include <thrust/execution_policy.h>
#include <thrust/gather.h>
#include <thrust/sort.h>
#include <thrust/transform.h>
#include <chrono>
#include <thread>
#include <vector>
#include "common_cuda_helper.hpp"
#include "nms_cuda_kernel.cuh"
#include "trt_cuda_helper.cuh"
#include "trt_plugin_helper.hp... | the_stack |
#include "kernel_common.h"
#include "util/mirrored_memory.h"
namespace dart {
static const LossFunctionType lossFunction = HuberLoss;
// -=-=-=-=-=-=-=-=-=- kernels -=-=-=-=-=-=-=-=-=-
template <bool dbgDA, bool dbgErr, bool dbgNorm>
__global__ void gpu_errorAndDataAssociationObsToMod(const float4 * obsVertMap,
... | the_stack |
#include "utils.h"
#include "kernel_prng.h"
#include "kernel_metropolis.h"
#include "kernel_reduction.h"
int main(int argc, char **argv){
int L = 32;
int R = 1;
int atrials = 1;
int ains = 1;
int apts = 1;
int ams = 1;
uint64_t seed = 2;
float TR = 0.1f;
fl... | the_stack |
#pragma once
#include <gunrock/util/basic_utils.h>
#include <gunrock/util/error_utils.cuh>
#include <gunrock/util/multithread_utils.cuh>
#include <gunrock/util/multithreading.cuh>
#include <vector>
namespace gunrock {
namespace app {
/**
* @brief Base partitioner structure.
*
* @tparam _VertexId
* @tparam _Size... | the_stack |
#include "Matrix.h"
#include <iostream>
#include <fstream>
using namespace std;
#include "ErrorCode.h"
// Host 静态方法:newMatrix(创建矩阵)
__host__ int MatrixBasicOp::newMatrix(Matrix **outmat)
{
MatrixCuda *resmatCud; // 对应于返回的 outmat 的 MatrixCuda 型数据。
// 检查装载输出矩阵的指针是否为 NULL。
if (outmat == NULL)
ret... | the_stack |
* Cooperative tile SOA (structure-of-arrays) scan within CTAs
******************************************************************************/
#pragma once
#include "../../../util/srts_grid.cuh"
#include "../../../util/reduction/soa/cooperative_soa_reduction.cuh"
#include "../../../util/scan/soa/serial_soa_scan.cuh"
... | the_stack |
*
* This tutorial explains how to use the iterative solvers in ViennaCL in a matrix-free manner, i.e. without explicitly assembling a matrix.
*
* We consider the solution of the Poisson equation \f$ \Delta \varphi = -1 \f$ on the unit square \f$ [0,1] \times [0,1] \f$ with homogeneous Dirichlet boundary conditions ... | the_stack |
// GetContourSet.cu
// 实现有连接性的闭合轮廓的获得算法
#include "GetContourSet.h"
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
#include "ErrorCode.h"
// 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y
// 定义了默认的线程块的尺寸。
#define DEF_BLOCK_X 32
#define DEF_BLOCK_Y 8
// 宏:GET_CONTOUR_SET_INI_IFI
// 定义了一个无穷大
#define GE... | the_stack |
namespace dgl {
namespace transform {
namespace impl {
/*!
* \brief Utility class used to avoid linker errors with extern
* unsized shared memory arrays with templated type
*/
template <typename Type>
struct SharedMemory {
__device__ inline operator Type* () {
extern __shared__ int __smem[];
return reinte... | the_stack |
#include "nnbilinearsampler.hpp"
#include "datacu.hpp"
#include "impl/dispatcher.hpp"
#include <cassert>
// -------------------------------------------------------------------
// Helpers
// -------------------------------------------------------------------
... | the_stack |
#include <algorithm>
#include <numeric>
#include <utility>
#include <vector>
#include "k2/csrc/array.h"
#include "k2/csrc/array_ops.h"
#include "k2/csrc/context.h"
#include "k2/csrc/math.h"
#include "k2/csrc/ragged.h"
#include "k2/csrc/ragged_ops.h"
#include "k2/csrc/tensor.h"
namespace {
// TODO(haowen): may move be... | the_stack |
#include <cstdio>
#include <utility_kernels_pose.h>
namespace pose {
// number of median reductions performed within each block
// implies that we have 3^MED_BLOCK_LEVELS threads
const int MED_BLOCK_LEVELS = 5;
const int MED_BLOCK_SIZE = 243;
texture<float, cudaTextureType2D, cudaReadModeElementType> d_Zbuffer_textu... | the_stack |
typedef long long ll_t;
typedef struct __builtin_align__(8)
{
float value;
int index;
} pair;
#if (__CUDA_ARCH__ < 700)
__device__ void __nanosleep(unsigned int ns){
clock_t start_clock = clock();
clock_t clock_offset = 0;
while (clock_offset < ns)
{
clock_offset = clock() - start_clock;
}
}
#endif
... | the_stack |
size_t free_space_ = 0;
void EstimateFreeSpace() {
/*
size_t total;
cudaMemGetInfo(&free_space_, &total);
//free_space_ >>= 1;
if (free_space_ > 1>>20) {
free_space_ -= 1 << 20; // Just remove 1 MB. This seems to work!
}
*/
// How to get free contiguous space ?
free_space_ = MAX_MEMORY_BYTES;
}
i... | the_stack |
#include <stdio.h>
#include "GCRSMatrix.h"
#include "galois.h"
#include "jerasure.h"
#include "utils.h"
int gcrs_check_k_m_w(int k, int m, int w){
if (k < MIN_K || k > MAX_K) {
return -1;
}
if (k < m) {
return -1;
}
if (w < MIN_W) {
w = MIN_W;
}
while (pow(2, w) < (k+m)) {
++w;
}
... | the_stack |
#define MAX(x, y) ((x>y) ? x : y)
// Define some error checking macros.
#define cudaErrCheck(stat) { cudaErrCheck_((stat), __FILE__, __LINE__); }
void cudaErrCheck_(cudaError_t stat, const char *file, int line) {
if (stat != cudaSuccess) {
fprintf(stderr, "CUDA Error: %s %s %d\n", cudaGetErrorString(stat), file, lin... | the_stack |
#define ERR (1.e-24)
#ifdef __NVCC__
#define DECL __host__ __device__
#else
#define DECL
#endif
template <typename RealType> struct Surreal {
typedef RealType value_type;
RealType real, imag;
DECL Surreal<RealType>(){}; // uninitialized for efficiency
DECL Surreal<RealType>(const RealType &v, const R... | the_stack |
#include <ATen/cuda/CUDABlas.h>
#include <ATen/cuda/CUDAContext.h>
#include <ATen/native/cuda/vol2col.cuh>
namespace at {
namespace native {
namespace {
static inline void slow_conv_transpose3d_shape_check(
const Tensor& input,
const Tensor& grad_output,
const Tensor& weight,
const Tensor& bias,
... | the_stack |
#include <claraparabricks/genomeworks/utils/cudautils.hpp>
#include <claraparabricks/genomeworks/utils/mathutils.hpp>
#include <claraparabricks/genomeworks/utils/signed_integer_utils.hpp>
#include <claraparabricks/genomeworks/utils/threadsafe_containers.hpp>
#include <claraparabricks/genomeworks/cudaaligner/aligner.hp... | the_stack |
#include <cstring>
#include <cmath>
#include <iostream>
#include <vector>
#include <memory> // std::align
#include <chrono>
#include <hip/hip_runtime.h>
#define REPEAT 100
#define NPTS (2048*8)
#define NDIM 128
#define M1W 128
#define M2W 16
#define M2H 16
#define M5W 16
#define M5H 16
#define M5R 4
#de... | the_stack |
#define CUDA_NUM_THREADS 512
// Computer the number of threads needed in GPU
inline int get_n_threads(int n) {
const int pow_2 = std::log(static_cast<float>(n)) / std::log(2.0);
return max(min(1 << pow_2, CUDA_NUM_THREADS), 1);
}
__device__ int compute_index(
int offset_x, int offset_y, int offset_z, int len_y,... | the_stack |
#include <cmath>
#include "caffe/common.hpp"
#include "caffe/util/math_functions.hpp"
namespace caffe {
void caffe_gpu_gemm(const CBLAS_TRANSPOSE TransA,
const CBLAS_TRANSPOSE TransB, const int M, const int N, const int K,
const float alpha, const float* A, const float* B, const float beta,
float* C) {
... | the_stack |
#include "k2/csrc/array_ops.h"
#include "k2/csrc/device_guard.h"
#include "k2/csrc/fsa_algo.h"
#include "k2/csrc/fsa_utils.h"
#include "k2/csrc/hash.h"
#include "k2/csrc/ragged_ops.h"
#include "k2/csrc/thread_pool.h"
namespace k2 {
namespace intersect_pruned_internal {
/* Information associated with a state active o... | the_stack |
using namespace std::chrono;
#define warp_size 32
#define SharedPartDevice 64
#define FULL_MASK 0xffffffff
#define NBytes Nuints
#define PRINT 0
#define Number_of_Diagonals 9
#define F_ReadLength 100
#define BitVal(data,y) ( (data>>y) & 1) // Return Data.Y value
#define SetBit(data,y) data |= (1 << y) // Set Da... | the_stack |
#include "smplx/smplx.hpp"
#include "smplx/util.hpp"
#include "smplx/internal/cuda_util.cuh"
namespace smplx {
namespace {
using cuda_util::device::BLOCK_SIZE;
using cuda_util::from_host_eigen_sparse_matrix;
using cuda_util::from_host_eigen_matrix;
using cuda_util::to_host_eigen_matrix;
namespace device {
/** Rodrigu... | the_stack |
#include "Curve.h"
#include <iostream>
#include <fstream>
using namespace std;
// 宏:SMCURVE_VALID 和 SMCURVE_NOT_VALID
// 定义了 smCurveCordiXY 是否有效的范围值。
#define SMCURVE_VALID 1
#define SMCURVE_NOT_VALID 0
// 宏:TANGENT_VALID 和 TANGENT_NOT_VALID
// 定义了 tangent 是否有效的范围值。
#define TANGENT_VALID 1
#define TANGEN... | the_stack |
#include <cusparse.h>
#include <torch/extension.h>
#include <ATen/cuda/CUDAContext.h>
#include <ATen/cuda/Exceptions.h>
#include <c10/cuda/CUDACachingAllocator.h>
#include "utils.cuh"
#if defined(__CUDACC__) && (CUSPARSE_VERSION >= 11000)// || (!defined(_MSC_VER) && CUSPARSE_VERSION >= 10301))
#define IS_GENERIC_AVA... | the_stack |
// Thrust Dependencies
#include <thrust/device_ptr.h>
#include <thrust/device_vector.h>
#include <thrust/sort.h>
#include <thrust/unique.h>
#include <thrust/remove.h>
// Octree-SLAM Dependencies
#include <octree_slam/timing_utils.h>
#include <octree_slam/world/svo/svo.h>
namespace octree_slam {
namespace svo {
text... | the_stack |
#include "utils/utils.cuh"
#define NUM_BANKS 32
#define LOG_NUM_BANKS 5
#define CONFLICT_FREE_OFFSET(n) ((n) >> LOG_NUM_BANKS)
// Blelloch scan
template<typename data_t>
__global__ void __pre_scan( data_t* dg_index,
data_t* dg_input,
data_t* dg_output,
... | the_stack |
#pragma once
#include <vector>
#include <gunrock/util/basic_utils.h>
#include <gunrock/util/error_utils.cuh>
#include <gunrock/util/multithread_utils.cuh>
#include <gunrock/util/multithreading.cuh>
#include <gunrock/graph/gp.cuh>
namespace gunrock {
namespace partitioner {
using PartitionStatus = unsigned int;
enu... | the_stack |
#include "histogram/histogram_gmem_atomics.h"
#include "histogram/histogram_smem_atomics.h"
#include "histogram/histogram_cub.h"
#include <cub/util_allocator.cuh>
#include <test/test_util.h>
using namespace cub;
//---------------------------------------------------------------------
// Globals, constants, and type d... | the_stack |
#include "DiffPattern.h"
#include <stdio.h>
#include <iostream>
#include <fstream>
using namespace std;
// 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y
// 定义了默认的线程块的尺寸。
#define DEF_BLOCK_X 8
#define DEF_BLOCK_Y 8
// 结构体:PatternData( 每个 pattern 的详细数据)
// 描述每个 pattern 的数据集合,包括走向角、中心坐标、和最小外接有向矩形的长边
// 及短边等
typedef struct PatternData_s... | the_stack |
__device__ double* t3_s_d;
__device__ double* t3_d;
#include "header.h"
extern "C" void set_dev_mem_d(size_t h1d, size_t h2d, size_t h3d, size_t p4d, size_t p5d,size_t p6d)
{
size_t size_t3;
size_t3 = h1d*h2d*h3d*p4d*p5d*p6d;
t3_d = (double *) getGpuMem(size_t3*sizeof(double));
cudaMemset(t3_d,0,siz... | the_stack |
#include <cuspatial/error.hpp>
#include <cuspatial/spatial_join.hpp>
#include <cudf/column/column.hpp>
#include <cudf/column/column_factories.hpp>
#include <cudf/table/table.hpp>
#include <cudf/utilities/type_dispatcher.hpp>
#include <rmm/cuda_stream_view.hpp>
#include <rmm/device_uvector.hpp>
#include <rmm/exec_poli... | the_stack |
Parallel reduction
This sample shows how to perform a reduction operation on an array of values
to produce a single value.
Reductions are a very common computation in parallel algorithms. Any time
an array of values needs to be reduced to a single value using a binary
associative operator, a red... | the_stack |
const int WS = 32;
#define ORDER 1
#include "alg5.cu"
#undef ORDER
#define ORDER 2
#include "alg5.cu"
namespace rod
{
struct recfilter5_plan
{
recfilter5_plan()
// at least these should be initialized to make
// upload_plan work when plan is empty
: a_in(NULL)
, width(0)
... | the_stack |
// Moments.cu
// 几何矩的计算
#include "Moments.h"
#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
#include "ErrorCode.h"
// 宏:M_PI
// π值。对于某些操作系统,M_PI可能没有定义,这里补充定义 M_PI。
#ifndef M_PI
#define M_PI 3.14159265359
#endif
// 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y
// 定义了默认的线程块的尺寸。
#define DEF_BLOCK_X 256... | the_stack |
#define ROUND_OFF 50000
#define CUDA_NUM_THREADS 1024
#define WARPS_PER_BLOCK 1
#define THREADS_PER_WARP 32
#define CUDA_KERNEL_LOOP(i, n) for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < (n); i += blockDim.x * gridDim.x)
#define GET_BLOCKS(n, t) (n+t-1) / t
// == Dimension rearrangement Kernel
__global__ vo... | the_stack |
* Quadro and Tesla GPUs with compute capability >= 2.0 can overlap two memcopies
* with kernel execution. This sample illustrates the usage of CUDA streams to
* achieve overlapping of kernel execution with copying data to and from the device.
*
* Additionally, this sample uses CUDA events to measure elapsed time... | the_stack |
namespace xlib {
namespace detail {
template<typename T, int SIZE, CacheModifier CM>
__device__ __forceinline__
WarpQueueBase<T, SIZE, CM>
::WarpQueueBase(T (&queue)[SIZE],
T* __restrict__ queue_ptr,
int* __restrict__ size_ptr) : _queue(queue),
... | the_stack |
#ifndef INCLUDE_GGNN_UTILS_CUDA_KNN_DATASET_CUH_
#define INCLUDE_GGNN_UTILS_CUDA_KNN_DATASET_CUH_
#include <algorithm>
#include <limits>
#include <string>
#include <cuda.h>
#include <cuda_runtime.h>
#include <stdio.h>
#include "io/loader_ann.hpp"
#include "io/storer_ann.hpp"
/**
* KNN database data that will be sh... | the_stack |
using namespace std;
typedef boost::uint32_t uint32;
typedef boost::uint64_t uint64;
#define MAX_CUDA_THREADS (1<<20)
#define MAX_CUDA_BLOCKS 256
#define MAX_CUDA_THREADS_PER_BLOCK 2048
#define REGISTERS_PER_CUDA_THREAD 64
#define TRAIL_NOCONSTRUCTOR
#include "birthday_types.hpp"
#ifndef CUDA_SAFE_CALL
#define CUDA... | the_stack |
#ifndef HAVE_OPENCV_CUDEV
#error "opencv_cudev is required"
#else
#include "opencv2/cudaarithm.hpp"
#include "opencv2/cudev.hpp"
#include "opencv2/core/private.cuda.hpp"
using namespace cv;
using namespace cv::cuda;
using namespace cv::cudev;
namespace
{
template <typename T1, typename T2, typename D, typename... | the_stack |
#include <opencv2/cudafeatures2d.hpp>
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include "labeling_algorithms.h"
#include "register.h"
#define BLOCK_X 8
#define BLOCK_Y 4
#define BLOCK_Z 4
using namespace cv;
namespace {
// Only use it with unsigned numeric types
template <typename... | the_stack |
* @file writer_impl.cu
* @brief cuDF-IO parquet writer class implementation
*/
#include "writer_impl.hpp"
#include "compact_protocol_reader.hpp"
#include "compact_protocol_writer.hpp"
#include <io/statistics/column_statistics.cuh>
#include <io/utilities/column_utils.cuh>
#include <io/utilities/config_utils.hpp>
#... | the_stack |
#include <doctest.h>
#include <cuda/api_wrappers.hpp>
#include <type_traits>
#include <cstdint>
#include <vector>
#include <algorithm>
#include <cassert> // for device-side assertions
struct result_of_check {
bool result;
kat::size_t line_number;
};
namespace kernels {
template <typename F>
__global__ void run_s... | the_stack |
#include <memory>
#include <type_traits>
#include <gtest/gtest.h>
#include <ginkgo/core/base/array.hpp>
#include <ginkgo/core/base/dim.hpp>
#include <ginkgo/core/base/types.hpp>
#include <ginkgo/core/matrix/dense.hpp>
#include "common/unified/base/kernel_launch_reduction.hpp"
#include "common/unified/base/kernel_... | the_stack |
#include <cstdio>
#include <utility_kernels.h>
#include <convolution_kernels.h>
namespace vision {
texture<float, 2, cudaReadModeElementType> imageTexture;
texture<float, 2, cudaReadModeElementType> floatTexture;
texture<float2, 2, cudaReadModeElementType> float2Texture;
// 24-bit multiplication is faster on G80,
//... | the_stack |
#define CUDA_KERNEL
#include "fluid_system_cuda.cuh"
#include "cutil_math.h" // cutil32.lib
#include <string.h>
#include <assert.h>
#include <curand.h>
#include <curand_kernel.h>
__constant__ FParams fparam; // CPU Fluid params
__constant__ FBufs fbuf; // GPU Particle buffers (unsorted)
__constant__ FBufs ... | 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;
#if __cplusplus < 201701L
#include <experimental/optional>
template <typename T>
using optiona... | the_stack |
template <typename T, typename TN>
__inline__ __device__ void welfordCombine(
T& a_avg,
T& a_M2,
TN& a_N,
const T& b_avg,
const T& b_M2,
TN b_N) {
if (b_N == 0) {
return;
}
TN ab_N = a_N + b_N;
T b_N_div_ab_N = ((T)(nvfuser_index_t)(b_N)) / ((T)(nvfuser_index_t)(ab_N));
T delta = b... | the_stack |
#include "dali/operators/ssd/box_encoder.cuh"
#include <cuda.h>
#include <vector>
#include <utility>
namespace dali {
__host__ __device__ inline float4 ToCenterWidthHeight(const float4 &box) {
return {
0.5f * (box.x + box.z),
0.5f * (box.y + box.w),
box.z - box.x,
box.w - box.y};
}
void Bo... | the_stack |
// <math.h>
// 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.
// This test requires C++11 (it's mostly decltype checks).
#if __cplusplus >= 201103L
#include <math.h>
#include <type_traits>
#in... | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.