text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
#include <stdio.h>
#include <stdlib.h>
#include <nvbio/basic/timer.h>
#include <nvbio/basic/console.h>
#include <nvbio/basic/vector.h>
#include <nvbio/basic/shared_pointer.h>
#include <nvbio/basic/dna.h>
#include <nvbio/strings/string_set.h>
#include <nvbio/strings/infix.h>
#include <nvbio/strings/seeds.h>
#include <nv... | the_stack |
typedef struct {
int hashbitlen;
unsigned long long databitlen;
unsigned long long datasize_in_buffer;
uint64_t x[8][2];
unsigned char buffer[64];
} jhHashState;
__constant__ unsigned char d_JH256_H0[512] = {
0xeb, 0x98, 0xa3, 0x41, 0x2c, 0x20, 0xd3, 0xeb, 0x92, 0xcd, 0xbe, 0x7b, 0x9c, 0xb2, 0x45, 0xc1,
0x1c, 0... | the_stack |
#include "_reg_resampling_gpu.h"
#include "_reg_tools.h"
#include "interpolations.h"
/* *************************************************************** */
/* *************************************************************** */
template <const bool tIs3D, const resampler_boundary_e tBoundary>
__global__ void reg_getImage... | the_stack |
//#include <torch/serialize/tensor.h>
//#include <ATen/ATen.h>
//#include <ATen/cuda/CUDAContext.h>
#define CUDA_NUM_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(TEN... | the_stack |
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>
#include "../gpu/arima/arima.h"
#include "cuda_utils2.h"
TEST(ARIMA, differencing) {
const int length = 10;
thrust::device_vector<float> data(length);
for (auto i = 0; i < length; ++i) data[i] = float(i / 2);
thrust::device_vector<float> differe... | the_stack |
#include "NavierStokesSolver.h"
#include "io/io.h"
//##############################################################################
// INITIALISE
//##############################################################################
/**
* \brief Constructor. Copies the database and informatio... | the_stack |
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <inttypes.h>
#include <stdarg.h>
#include <ctype.h>
#include <assert.h>
#include <cuda.h>
#include "sleefquadinline_cuda.h"
#include "sleefquadinline_purec_scalar.h"
#define STDIN_FILENO 0
//
... | the_stack |
using namespace std;
namespace amgx
{
namespace idr_solver
{
// Constructor
template< class T_Config>
IDR_Solver_Base<T_Config>::IDR_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;
cfg.getParam... | the_stack |
#if ( MODEL == HYDRO )
// external functions and GPU-related set-up
#ifdef __CUDACC__
#include "CUAPI.h"
#include "CUFLU_Shared_FluUtility.cu"
#include "CUDA_ConstMemory.h"
extern real (*d_SrcDlepProf_Data)[SRC_DLEP_PROF_NBINMAX];
extern real *d_SrcDlepProf_Radius;
#endif // #ifdef __CUDACC__
// local function... | the_stack |
#include <cstdio>
#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 = 1024;
inline int GET_BLOCKS(const int N) {
return (N + CUDA_NUM_THREAD... | the_stack |
#pragma once
#include <cstdint>
#include "data_spec_packed.cuh"
#include "random_util.cuh"
namespace {
namespace device {
template<class data_type_t, class voxel_index_t>
__device__ __inline__ float trilerp_one(
const data_type_t* __restrict__ data,
int reso, int stride,
const voxel_index_t* ... | the_stack |
namespace lightseq {
namespace cuda {
/**
@brief: ker_norm_layer_prepost
layer normalization, modify input according to is_post_ln
@thread
gridDim.x = batch_size * batch_seq_len
blockDim.x = max_thread_per_block
@param
input: [batch_size, batch_seq_len, hidden_size]
output: [batch_size, batch_seq_len, hidden_size]
s... | the_stack |
#define _SIZE_T_DEFINED
#include <cuda.h>
#include <device_launch_parameters.h>
#include <texture_fetch_functions.h>
#include "float.h"
#include <builtin_types.h>
#include <vector_functions.h>
#include <math.h>
#include "../NeuralNetwork/Activation/ActivationFunction.cu"
#include "../Common/Reduction/Reduction.cu"
... | the_stack |
#include <vector>
#define MAX_BLOCKS 256
#define NUM_THREADS 256
#define MAX(a, b) ((a) > (b)) ? (a) : (b)
#define MIN(a, b) ((a) < (b)) ? (a) : (b)
#define HARDTANH(x) ((x) < (-1.0)) ? (-1.0) : (((x) <= (1.0)) ? (x) : (1.0))
const int WARP_SIZE = 32;
// Crude benchmarks suggest 256 is better than 512 and 1024
// TODO:... | the_stack |
#define CUDA_CHECK(condition) \
/* Code block avoids redefinition of cudaError_t error */ \
do { \
cudaError_t error = condition; \
if (error != cudaSuccess) { \
std::cout << cudaGetErrorString(error) << std::endl; \
} \
} while (0)
#define CUDA_1D_KERNEL_LOOP(i, n) \... | the_stack |
namespace anakin {
namespace saber {
static void cudnn_gemm(cublasHandle_t handle, const bool TransA,
const bool TransB, const int M, const int N, const int K,
const float alpha, const float* A, const float* B, const float beta,
float* C) {
// N... | the_stack |
typedef double Matches[][3];
/* SFILE_END */
//=============================================================================
// Various operators on the polynomial classes
//=============================================================================
// const int poly3_1::size_ = 3;
// const int poly3_2::s... | the_stack |
__device__ __inline__ unsigned long long int gclock64() {
unsigned long long int rv;
asm volatile ( "mov.u64 %0, %%globaltimer;" : "=l"(rv) );
return rv;
}
template <typename T_weight, typename T_data, int R, int S, int BATCH_UNROLL>
__device__ void nv_wavenet_dualBlock_skip(int sample, int num_layers, int... | the_stack |
* \file
* cub::DeviceRadixSort provides device-wide, parallel operations for computing a radix sort across a sequence of data items residing within device-accessible memory.
*/
#pragma once
#include <stdio.h>
#include <iterator>
#include "dispatch/dispatch_radix_sort.cuh"
#include "../config.cuh"
/// Optional out... | the_stack |
#if defined(THC_REAL_IS_FLOAT) || defined(THC_REAL_IS_DOUBLE)
#ifdef USE_MAGMA
static void THCTensor_(copyArray1d)(THCState *state, THCTensor *self, real *src, int k)
{
long size[1] = { k };
long stride[1] = { 1 };
THCTensor_(resizeNd)(state, self, 1, size, stride);
size_t len = k * sizeof(real);
THCudaChec... | the_stack |
#if defined(THC_REAL_IS_HALF)
#define _REAL(val) THC_float2half(val)
#else
#define _REAL(val) (val)
#endif
static int nn_(from_samples_to_structured)(lua_State *L) {
THCState *state = getCudaState(L);
// processes inputs
if (lua_gettop(L) != 3)
return LUA_HANDLE_ERROR_STR(L, "expected 3 arguments: samples, o... | the_stack |
* \test Tests the correct handling of self-assignments.
**/
//
// *** System
//
#include <iostream>
//
// *** ViennaCL
//
//#define VIENNACL_DEBUG_ALL
#include "viennacl/scalar.hpp"
#include "viennacl/vector.hpp"
#include "viennacl/vector_proxy.hpp"
#include "viennacl/matrix.hpp"
#include "viennacl/matrix_proxy... | the_stack |
See COPYRIGHT.TXT and LICENSE.TXT for copyright and license information
----------------------------------------------------------------------- */
/*****************
* rtk #includes *
*****************/
#include "rtkCudaUtilities.hcu"
#include "rtkConfiguration.h"
#include "rtkCudaWarpBackProjectionImageFilter.hc... | the_stack |
#include <cstdlib>
#include <ctime>
#include <cstdio>
using namespace akg_reduce;
using namespace std;
// file to test multi-aggerated values reduce in single thread.
// including single-block reduce/multi-block reduce by x/y directions.
template <typename T>
void CompareResults(T *arr1, T *arr2, int len) {
double ... | the_stack |
* This is a simple test program to measure the memcopy bandwidth of the GPU.
* It can measure device to device copy bandwidth, host to device copy bandwidth
* for pageable and pinned memory, and device to host copy bandwidth for pageable
* and pinned memory.
*
* Usage:
* ./bandwidthTest [option]...
*/
// incl... | the_stack |
namespace amgx
{
namespace aggregation
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
__host__ __device__ int hash_function(int a, int seed = 17)
{
a ^= seed;
a = (a + 0x7ed55d16) + (a << 12);
a = (a ^ 0xc761c23c) + (a >> 19);
... | the_stack |
#include <prnn/detail/matrix/matrix_operations.h>
#include <prnn/detail/matrix/matrix_transforms.h>
#include <prnn/detail/matrix/copy_operations.h>
#include <prnn/detail/matrix/matrix.h>
#include <prnn/detail/matrix/matrix_view.h>
#include <prnn/detail/matrix/operation.h>
#include <prnn/detail/parallel/multi_bulk_sync... | 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 |
// ConnectRegion.cu
// 实现图像的连通区域操作
#include "ConnectRegion.h"
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
// 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y
// 定义了默认的线程块的尺寸。
#define DEF_BLOCK_X 32
#define DEF_BLOCK_Y 8
// 宏:CONNREGION_PACK_LEVEL
// 定义了一个线程中计算的像素点个数,若该值为4,则在一个线程中计算2 ^ 4 = 16
// 个像素... | the_stack |
* \file
* Thread utilities for reading memory using PTX cache modifiers.
*/
#pragma once
#include <cuda.h>
#include <iterator>
#include "../util_ptx.cuh"
#include "../util_type.cuh"
#include "../util_namespace.cuh"
/// Optional outer namespace(s)
CUB_NS_PREFIX
/// CUB namespace
namespace cub {... | the_stack |
* \file
* DeviceScan provides device-wide, parallel operations for computing a prefix scan across a sequence of data items residing within device-accessible memory.
*/
#pragma once
#include <iterator>
#include "../../agent/agent_scan_by_key.cuh"
#include "../../thread/thread_operators.cuh"
#include "../../config.c... | the_stack |
#include <gtest/gtest.h>
#include <cuda_runtime.h>
#include <stdio.h>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <random>
#include <string>
#include <vector>
#include "dali/core/dev_buffer.h"
#include "dali/core/format.h"
#include "dali/core/math_util.h"
#include "dali/core/tensor_shape_p... | the_stack |
#include <cudpp_globals.h>
#include "cudpp_stringsort.h"
#include <cudpp.h>
#include <stdio.h>
#include <cudpp_util.h>
#include <math.h>
#include "sharedmem.h"
/**
* @file
* stringsort_cta.cu
*
* @brief CUDPP CTA-level sort routines
*/
/** \addtogroup cudpp_cta
* @{
*/
/** @name Merge Sort Functions
* @{
*/
... | the_stack |
*
* Code and text by Sean Baxter, NVIDIA Research
* See http://nvlabs.github.io/moderngpu for repository and documentation.
*
******************************************************************************/
#pragma once
#include "../mgpuhost.cuh"
#include "../kernels/segreduce.cuh"
#include "../kernels/bulkinsert.... | the_stack |
#include "lead_lag_nested_detail.cuh"
#include "rolling/rolling_collect_list.cuh"
#include "rolling/rolling_detail.hpp"
#include "rolling/rolling_jit_detail.hpp"
#include "rolling_detail.hpp"
#include <cudf/aggregation.hpp>
#include <cudf/column/column_device_view.cuh>
#include <cudf/column/column_factories.hpp>
#incl... | the_stack |
* \file
* dnn/src/cuda/convolution_helper/block_tile_consumer/iconv_block_consumer_unroll_width.cuh
* MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
*
* Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
*
* Unless required by applicable law or agreed to in writing,
* software ... | the_stack |
#include <stdlib.h>
#include <stdio.h>
#include "cuda.h"
#include <cufft.h>
extern int nblock_size;
extern int maxgsx;
static cudaError_t crc;
static cufftResult cfrc;
static cufftHandle planrx, planxr, planrxn, planxrn;
static cufftHandle plany, planyn;
__global__ void gpuctpose4(float2 f[], float2 g[], int nx, int... | the_stack |
* CTA-processing functionality for radix sort downsweep scan kernels
******************************************************************************/
#pragma once
#include "../../util/basic_utils.cuh"
#include "../../util/cta_work_distribution.cuh"
#include "../../util/tex_vector.cuh"
#include "../../util/io/load_til... | the_stack |
namespace {
/*
* CUDA Kernel of the forward function for Node-Edge Multiplication(reduced on edge, designed for relative positional encoding).
*/
template <typename scalar_t>
__global__ void node_mul_edge_forward_kernel(const int64_t* __restrict__ row, const int64_t* __restrict__ indptr, const int64_t* __restrict__ ... | the_stack |
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <math.h>
#include <hip/hip_runtime.h>
#include "options.h"
#include "scoped_ptrs.h"
using namespace aocl_utils;
#define MANUAL_VECTOR 8
#define NUM_THREADS_PER_WG 64
#define BLOOM_1 5
#define BLOOM_2 0x7F... | the_stack |
typedef std::chrono::high_resolution_clock::time_point TimePoint;
struct Params {
size_t natlig;
size_t natpro;
size_t ntypes;
size_t nposes;
std::vector<Atom> protein;
std::vector<Atom> ligand;
std::vector<FFParams> forcefield;
std::array<std::vector<float>, 6> poses;
size_t iterations;
// XXX... | the_stack |
#include "trt_engine/trt_network_crt/plugins/adaptive_pooling_plugin/adaptive_pooling_plugin.h"
#include <cuda_fp16.h>
#include <cuda_runtime.h>
#include <device_launch_parameters.h>
#include <algorithm>
#include <cstdint>
#include <limits>
#include "trt_engine/trt_network_crt/plugins/common/half_ext.cuh"
#include "... | the_stack |
// cuda_check_status_cu ----------------------------------------------------
// extern "C"
static void cuda_check_status_cu(cudaError_t status, int whiam)
{
if(status != cudaSuccess) {
printf("cuda error: code %d, %s, line%d\n", status, cudaGetErrorString(status), whiam);
exit(E... | the_stack |
#ifndef HAVE_OPENCV_CUDEV
#error "opencv_cudev is required"
#else
#include "opencv2/cudev.hpp"
using namespace cv::cudev;
void cmpScalar(const GpuMat& src, cv::Scalar val, bool inv, GpuMat& dst, const GpuMat&, double, Stream& stream, int cmpop);
namespace
{
template <class Op, typename T> struct CmpOp : binar... | the_stack |
/* ----------------------------------------------------------------------
factorial n table, size SNA::nmaxfactorial+1
------------------------------------------------------------------------- */
const double nfac_table[] = {
1,
1,
2,
6,
24,
120,
720,
5040,
40320,
362880,
3628800,
39916800,
... | 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, ... | the_stack |
* Evaluates different tuning configurations of DeviceReduce.
*
* The best way to use this program:
* (1) Find the best all-around single-block tune for a given arch.
* For example, 100 samples [1 ..512], 100 timing iterations per config per sample:
* ./bin/tune_device_reduce_sm200_nvvm_5.0_abi_i386 --i... | the_stack |
#include <linalg/batched/matrix.cuh>
#include <raft/cudart_utils.h>
#include <raft/linalg/add.cuh>
#include <raft/mr/device/allocator.hpp>
#include <gtest/gtest.h>
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <random>
#include <vector>
namespace MLCommon {
namespace LinAlg {
namespace Batched {... | the_stack |
#include <nvidia/helper_cuda.h>
#define PI 3.141592653589793f
#define BLOCK_SIZE 256
// int tidk = 0*BLOCK_SIZE+tid; mu[tidk] += mu[tidk + s];
// tidk = 1*BLOCK_SIZE+tid; mu[tidk] += mu[tidk + s];
// tidk = 2*BLOCK_SIZE+tid; mu[tidk] += mu[tidk + s];
// tidk = 3*BLOCK_SIZE+tid; mu[tidk] += mu[tid... | the_stack |
#include <async_event.h>
#include <thrust/count.h> //count
#include <thrust/sort.h> //sort
#include <thrust/binary_search.h> //lower_bound
#include <thrust/unique.h> //unique
#include <thrust/host_vector.h>
#include <cusp/detail/format_utils.h> //offsets_to_indices
#include <determinism_checker.h>
#include <solvers/so... | the_stack |
#include <kernels.cuh>
#include <cub/block/block_radix_sort.cuh>
#include <cub/warp/warp_reduce.cuh>
#include <cub/block/block_load.cuh>
#include <cub/block/block_discontinuity.cuh>
#include <cub/block/block_store.cuh>
#include <cub/block/block_reduce.cuh>
#include <cub/cub.cuh>
#include <math_constants.h>
#define HLF... | the_stack |
void tsnecuda::util::GaussianNormalizeDeviceVector(cublasHandle_t &handle,
thrust::device_vector<float> &d_points, const int num_points,
const int num_dims)
{
// Compute the means
auto d_means = tsnecuda::util:... | the_stack |
template<typename IndexType, typename ValueType>
void __global__ neighbor_count_kernel(IndexType* tri0, IndexType* tri1, IndexType* tri2, IndexType ne, IndexType* nbcount)
{
for(int eidx = threadIdx.x; eidx < ne; eidx += gridDim.x * blockDim.x)
{
IndexType i = tri0[eidx];
IndexType j = tri1[eidx];
Index... | the_stack |
// GaussianSmoothImage.cu
// 图像高斯平滑操作,包括普通高斯平滑和带mask的高斯平滑
#include "GaussianSmoothImage.h"
#include "ErrorCode.h"
// 宏定义,定义了五个高斯平滑尺度对应的权重总和
#define GAUSS_THREE 16
#define GAUSS_FIVE 256
#define GAUSS_SEVEN 4096
#define GAUSS_NINE 65536
#define GAUSS_ELEVEN 1048576
// 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y
// 定义了默认的线程块... | the_stack |
#include "util.cuh"
#include "operator.cuh"
#include "rspmm.h"
namespace at {
// Memory & time efficient implementation of generalized spmm
// Much of the code is inspired by GE-SpMM
// https://github.com/hgyhungry/ge-spmm
namespace {
const int kCoarseningFactor = 2;
const int kThreadPerBlock = 256;
} // namespace... | the_stack |
#pragma once
#include <math/vector.h>
#include <math/matrix.h>
#include "config.h"
#include "instrumentation.cuh"
#include "fragment_shader_stage.cuh"
#include "viewport.cuh"
#include "bitmask.cuh"
#include "rasterization_stage.cuh"
#include <ptx_primitives.cuh>
#include <cub/cub.cuh>
templ... | the_stack |
//------------------------------------------------------------------------------
// block_apply_chunk macro
//------------------------------------------------------------------------------
// A = A - V*T'*V'*A, for a single chunk of N columns of A, starting at column
// j1 and ending at j1+N-1.
//
// This function use... | the_stack |
namespace cgbn {
template<class env>
__device__ __forceinline__ void core_t<env>::mont_mul(uint32_t r[LIMBS], const uint32_t a[LIMBS], const uint32_t b[LIMBS], const uint32_t n[LIMBS], const uint32_t np0) {
uint32_t sync=sync_mask(), group_thread=threadIdx.x & TPI-1;
uint32_t u1, ru[LIMBS], r1=0, ra[LIMBS], c=0, t... | the_stack |
// CHECK: #include <hip/hip_runtime.h>
#include <cuda_runtime.h>
#include <stdint.h>
// Random predefiend 32 and 64 bit values
constexpr int32_t value32 = 0x70F0F0FF;
constexpr int64_t value64 = 0x7FFF0000FFFF0000;
constexpr unsigned int writeFlag = 0;
__global__
void fn(float* px, float* py) {
bool a[42];
__shar... | the_stack |
#include <torch/extension.h>
#include <vector>
#include <ATen/ATen.h>
#include <ATen/cuda/CUDAContext.h>
#include <THC/THC.h>
#include <THC/THCAtomics.cuh>
#include <THC/THCDeviceUtils.cuh>
#include <stdio.h>
#define Idx3(n, c, d, N, C, D) (((n)*(C)*(D)) + ((c)*(D)) + (d))
#define Idx2(n, c, N, C) (((n)*(C)) + (c... | the_stack |
#include "lite/backends/cuda/cuda_utils.h"
#include "lite/core/op_registry.h"
#include "lite/kernels/cuda/softmax_compute.h"
namespace paddle {
namespace lite {
namespace kernels {
namespace cuda {
using Tensor = lite::Tensor;
extern __shared__ char tile[];
template <typename dtype>
__global__ void sharemem_softmax_k... | the_stack |
#if __CUDA_ARCH__ >= 300
#define edcellupdate(RR,RP1,RP2,RPP,WUN,TMP) \
asm("vmin4.s32.s32.s32.add" "%0, %1.b3210, %2.b4321, %3;": "=r" (RR) : "r" (RP1), "r" (RP2), "r" (WUN)); \
asm("vadd4.s32.s32.s32" "%0, %1, %2, %3;": "=r" (TMP) : "r" (MM), "r" ... | the_stack |
#include "my_lib_kernel.h"
#define min(a,b) ((a<b)?(a):(b))
#define max(a,b) ((a>b)?(a):(b))
#define DEBUG (0)
#ifndef BLOCKDIMX
#define BLOCKDIMX (32)
#endif
#ifndef BLOCKDIMY
#define BLOCKDIMY (16)
#endif
//forward path of our layer
__global__ void SeparableConvFlowLayer_gpu_forward_kernelfunc(
... | the_stack |
#ifndef __DEVICE_EMULATION__
#define _DEVICE_CODE_
#endif
#include "octgravdefs.h"
#include "dev_octgrav_tex.cuh"
#ifndef LMEM_STACK_SIZE
#define LMEM_STACK_SIZE 256
#endif
#define LEAF_BIT (1 << (24))
__device__ bool open_node(float4 cell_com,
float4 cell_pos,
float4 node_pos,
float4 node_com) {
... | the_stack |
#include <cuda_runtime.h>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include "turbo_transformers/layers/kernels/gpu_transpose_kernel.h"
namespace turbo_transformers {
namespace layers {
namespace kernels {
/*
input : (batch_size, seq_len, weight_num, head_num, size_per_head) ->
output : (weigh... | the_stack |
#include "ImgConvert.h"
#include <iostream>
using namespace std;
// 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y
// 定义了默认的线程块尺寸。
#define DEF_BLOCK_X 32
#define DEF_BLOCK_Y 8
// 宏:DEF_BLOCK_1D
// 定义一维线程块尺寸。
#define DEF_BLOCK_1D 512
// Kernel 函数:_cstConvertImgKer(实现将坐标集转化为图像算法)
// 将坐标集内的坐标映射到输入图像中并将目标点置为 highpixel 从而实现
// 坐标集与... | the_stack |
#include <cuml/decomposition/pca.hpp>
#include <cuml/decomposition/pca_mg.hpp>
#include <cuml/decomposition/sign_flip_mg.hpp>
#include <opg/linalg/qr_based_svd.hpp>
#include <opg/matrix/matrix_utils.hpp>
#include <opg/stats/cov.hpp>
#include <opg/stats/mean.hpp>
#include <opg/stats/mean_center.hpp>
#include <raft/cud... | the_stack |
namespace simtbx {
namespace gpu {
namespace af = scitbx::af;
//refactor later into helper file
static cudaError_t cudaMemcpyVectorDoubleToDevice(CUDAREAL *dst, const double *src, size_t vector_items) {
CUDAREAL * temp = new CUDAREAL[vector_items];
for (size_t i = 0; i < vector_items; i++) {
... | the_stack |
// Forward Declarations for benchmark kernels
__global__ void MAddU(float *target, float val1, float val2);
__global__ void MulMAddU(float *target, float val1, float val2);
__global__ void MAddU_DP(double *target, double val1, double val2);
__global__ void MulMAddU_DP(double *target, double val1, double val2);
// A... | the_stack |
#include <cugraph/detail/shuffle_wrappers.hpp>
#include <cugraph/utilities/error.hpp>
#include <raft/handle.hpp>
#include <rmm/device_uvector.hpp>
#include <thrust/copy.h>
#include <thrust/distance.h>
#include <thrust/for_each.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/iterator_trait... | the_stack |
#include <torch/extension.h>
#include <cstdint>
#include "cuda_util.cuh"
#include "render_util.cuh"
#include "data_spec_packed.cuh"
namespace {
namespace device {
// From old version (name is hacky whatever)
struct BasicSingleRaySpec {
__device__ BasicSingleRaySpec(const float* __restrict__ origin, const float* __... | the_stack |
#include <nbla/array.hpp>
#include <nbla/logger.hpp>
#include <nbla/variable.hpp>
#include <nbla/cuda/array/cuda_array.hpp>
#include <nbla/cuda/common.hpp>
#include <nbla/cuda/cudnn/cudnn.hpp>
#include <nbla/cuda/cudnn/function/add2.hpp>
#include <nbla/cuda/cudnn/function/batch_normalization.hpp>
#include <nbla/cuda/c... | the_stack |
using simtbx::nanoBragg::shapetype;
using simtbx::nanoBragg::hklParams;
using simtbx::nanoBragg::SQUARE;
using simtbx::nanoBragg::ROUND;
using simtbx::nanoBragg::GAUSS;
using simtbx::nanoBragg::GAUSS_ARGCHK;
using simtbx::nanoBragg::TOPHAT;
static void CheckCudaErrorAux(const char *, unsigned, const char *, cudaError_... | the_stack |
#include <iomanip>
#include "caffe/FRCNN/frcnn_proposal_layer.hpp"
#include "caffe/FRCNN/util/frcnn_utils.hpp"
#include "caffe/FRCNN/util/frcnn_helper.hpp"
#include "caffe/FRCNN/util/frcnn_param.hpp"
#include "caffe/FRCNN/util/frcnn_gpu_nms.hpp"
namespace caffe {
namespace Frcnn {
using std::vector;
__global__... | the_stack |
#include "correlation_cuda_kernel.cuh"
#define CUDA_NUM_THREADS 1024
#define THREADS_PER_BLOCK 32
#define FULL_MASK 0xffffffff
#include <ATen/ATen.h>
#include <ATen/NativeFunctions.h>
#include <ATen/Dispatch.h>
#include <ATen/cuda/CUDAApplyUtils.cuh>
using at::Half;
template<typename scalar_t>
__forceinline__ __dev... | the_stack |
#include <types.h>
#include <my_errors.h>
#include <kernel.h>
#include <functions.h>
#include <utilis.h>
using namespace std;
extern "C"
HostError Hermite6th(const double TTIME, double* GTIME, double* ATIME, double* local_time, double* step, const unsigned int N, const unsigned int M, double4* pos_PH, float4* vel_PH,... | the_stack |
#include <cassert>
#include <cstring>
#include <iostream>
#include <tuple>
#include <vector>
namespace fastertransformer {
static inline void set_alpha(uint32_t& alpha, float norm, Data_type dtype)
{
if (dtype == DATA_TYPE_FP16)
{
half2 h2 = __float2half2_rn(norm);
alpha = reinterpret_cast<co... | the_stack |
// layernorm code modified from Nvidia's DeepLearningExamples
// https://github.com/NVIDIA/DeepLearningExamples/blob/master/FasterTransformer/v3.1/fastertransformer/cuda/open_decoder.cu#L1369-L81429
template <typename T>
__global__
void add_bias_input_layernorm(T* out, const T* input, const T* bias, const T* gamma, c... | the_stack |
__global__ void sum_cols_%float_type%(%float_type% *A, %float_type% *out,
const int increment,
const int a0, const int a1)
{
const int t_i = threadIdx.y;
const int t_j = threadIdx.x;
const int dim_i = blockDim.y;
const int dim_... | the_stack |
typedef enum { SUM = 0, MEAN = 1, MAX = 2 } reduce_t;
#define CHECK_CUDA(x) \
TORCH_CHECK(x.device().is_cuda(), #x " must be a CUDA tensor")
#define CHECK_CONTIGUOUS(x) \
TORCH_CHECK(x.is_contiguous(), #x " ... | the_stack |
#include <math.h> // required for fabs()
#include <float.h> // required for DBL_EPSILON
// Externally Defined Routines //
extern "C" __host__ __device__
double xChebyshev_Tn_Series(double x, const double a[], int degree);
// ... | the_stack |
* Test of BlockRadixSort utilities
******************************************************************************/
// Ensure printing of CUDA runtime errors to console
#define CUB_STDERR
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <cub/block/block_radix_sort.cuh>
#include <cub/block/block_l... | the_stack |
#include <algorithm>
#include <cmath>
#include "amir_cuda_util/cuda_util.h"
using namespace amirstan::cuda;
template <typename scalar_t>
__device__ scalar_t deformable_im2col_bilinear(const scalar_t *bottom_data,
const int data_width,
... | the_stack |
#if defined(THC_REAL_IS_HALF)
#define _REAL(val) THC_float2half(val)
#else
#define _REAL(val) (val)
#endif
static int nn_(StepLSTM_updateOutput)(lua_State *L) {
THCState *state = getCudaState(L);
THCTensor *weight = (THCTensor *)luaT_checkudata(L, 1, torch_Tensor);
THCTensor *bias = (THCTensor *)luaT_checkudata(... | the_stack |
#define TPB80 384
#define TPB64 384
extern "C" {
#include <sph/sph_whirlpool.h>
#include <miner.h>
}
#include <cuda_helper.h>
#include <cuda_vector_uint2x4.h>
#include <cuda_vectors.h>
#define xor3x(a,b,c) (a^b^c)
#include "cuda_whirlpool_tables.cuh"
__device__ static uint64_t b0[256];
__device__ static uint64_t b... | the_stack |
#include <ATen/ATen.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <thrust/device_vector.h>
#include <vector>
#define CUDA_1D_KERNEL_LOOP(i, n) \
for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < n; \
i += blockDim.x * gridDim.x)
#define POSE_CHANNELS 9
// poses_s... | the_stack |
void kernel_sizing(CSRGraph &, dim3 &, dim3 &);
#define TB_SIZE 256
const char *GGC_OPTIONS = "coop_conv=False $ outline_iterate_gb=False $ backoff_blocking_factor=4 $ parcomb=True $ np_schedulers=set(['fg', 'tb', 'wp']) $ cc_disable=set([]) $ tb_lb=False $ hacks=set([]) $ np_factor=8 $ instrument=set([]) $ unroll=[] $... | the_stack |
using namespace nvinfer1;
namespace bert
{
inline __device__ void res_add(
float (&hdata)[4], const uint32_t idata, const uint32_t ires, const float dqData, const float dqRes)
{
char4 ires4 = reinterpret_cast<const char4&>(ires);
char4 idata4 = reinterpret_cast<const char4&>(idata);
hdata[0] = float(i... | the_stack |
__global__ void
kerMakeFirstTetra
(
Tet* tetArr,
TetOpp* oppArr,
char* tetInfoArr,
Tet tet,
int tetIdx,
int infIdx
)
{
const Tet tets[] = {
{ tet._v[0], tet._v[1], tet._v[2], tet._v[3] },
{ tet._v[1], tet._v[2], tet._v[3], infIdx },
{ tet._v[0], tet._v[3], tet._v[2], infIdx },
{ t... | the_stack |
#include "io.h"
#include "utilities/types.h"
#include "utilities/boundaryCondition.h"
/**
* \brief Converts a string to a number.
*
* \param str a string
*
* \return a number (\c real or \c integer)
*/
template <typename T>
T toNumber(std::string str)
{
T num;
std::stringstream ss(str); //turn the string into... | the_stack |
#include "bits/mexutils.h"
#include "bits/datamex.hpp"
#include "bits/nnconv.hpp"
#include "bits/nnfullyconnected.hpp"
#include "bits/nnsubsample.hpp"
#if ENABLE_GPU
#include "bits/datacu.hpp"
#endif
#include <memory>
#include <assert.h>
#include <math.h>
/* option codes */
enum {
opt_stride = 0,
opt_pad,
opt_... | the_stack |
#include <svo/img_align/sparse_img_align_device_utils.cuh>
#include <imp/cu_core/cu_texture.cuh>
#include <imp/cu_core/cu_utils.hpp>
#include <svo/common/logging.h>
#include <svo/img_align/sparse_img_align_base.h>
namespace svo {
GpuCacheHandler::GpuCacheHandler():
patch_area_(0), feature_capacity_(0), reduction_... | the_stack |
#include "CUFLU.h"
#if ( MODEL == HYDRO && (FLU_SCHEME == MHM || FLU_SCHEME == MHM_RP || FLU_SCHEME == CTU) )
// external functions
#ifdef __CUDACC__
#if ( RSOLVER == EXACT )
# include "CUFLU_Shared_RiemannSolver_Exact.cu"
#elif ( RSOLVER == ROE )
# include "CUFLU_Shared_RiemannSolver_Roe.cu"
#elif ( RSOLVER =... | the_stack |
#define BLOCK_WIDTH 16
namespace dip {
__constant__ float T[4][4];
__device__ bool interpolate(int volume_size, float volume_dimension,
float voxel_dimension, float min_weight,
const Voxel *volume, Vertex center,
float vx, float vy, ... | the_stack |
#if !defined(CUDA_VERSION)
#define __device__ __attribute__((device))
#define __global__ __attribute__((global))
#define __shared__ __attribute__((shared))
#define __constant__ __attribute__((constant))
typedef unsigned long long uint64_t;
#endif
// We have to keep all builtins that depend on particular target feature... | the_stack |
#include <rmm/cuda_stream_view.hpp>
#include <rmm/device_buffer.hpp>
#include <rmm/device_uvector.hpp>
#include <rmm/exec_policy.hpp>
#include <thrust/copy.h>
#include <thrust/sequence.h>
#include <thrust/transform.h>
#include <cub/device/device_segmented_radix_sort.cuh>
namespace cudf {
namespace lists {
namespace ... | the_stack |
* Copyright (c) 2019 by Contributors
* \file pseudo2DTranspose_op-inl.cuh
* \brief pseudo 2D transpose
* \author Dawid Tracz
*/
#ifndef MXNET_OPERATOR_TENSOR_PSEUDO2DTRANSPOSE_OP_INL_CUH_
#define MXNET_OPERATOR_TENSOR_PSEUDO2DTRANSPOSE_OP_INL_CUH_
#include <mxnet/tuple.h>
#include <mxnet/tensor_blob.h>
#include <... | the_stack |
* $Created by: XIAO Tong (email: xiaotong@mail.neu.edu.cn) 2018-04-24
*/
#include "CopyBlocksInGrid.h"
#include "CopyBlocksInGrid.cuh"
#include "../../XDevice.h"
namespace nts { // namespace nts(NiuTrans.Tensor)
#ifdef USE_CUDA
/*
copy data by index (device code)
here we keep all the data of a grid within the share... | the_stack |
namespace {
template <typename scalar_t>
__global__ void wb_cuda_scale_calc_kernel(
const scalar_t* __restrict__ input,
scalar_t* __restrict__ scale_output,
scalar_t* __restrict__ dev_tmp,
int* __restrict__ dev_last_block_counter,
const int64_t total_elements_count) {
const ... | the_stack |
#include <chrono>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <hip/hip_runtime.h>
#include "snap.h"
#include "utils.cu"
#if REFDATA_TWOJ == 14
#include "refdata_2J14_W.h"
#elif REFDATA_TWOJ == 8
#include "refdata_2J8_W.h"
#elif REFDATA_TWOJ == 4
#include "refda... | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.