text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
#include "CUFLU.h"
#if ( MODEL == HYDRO )
// internal function prototypes
// --> only necessary for GPU since they are included in Prototype.h for the CPU codes
#ifdef __CUDACC__
GPU_DEVICE
static real Hydro_Con2Pres( const real Dens, const real MomX, const real MomY, const real MomZ, const real Engy,
... | the_stack |
#include <nvfunctional>
///////////////////////////////////////////////////////////////////////////////
// FUNCTION POINTERS //
///////////////////////////////////////////////////////////////////////////////
template<typename T>
__device__ __forceinline__ bool l... | the_stack |
#include <unordered_set>
#include <unordered_map>
#include "core/graph.h"
#include "core/solver.h"
#include "model/graph.h"
#include "gpu/graph.cuh"
/**
* @page Node Embedding
*
* Node embedding is an instantiation of the system on normal graphs (e.g. social network, citation network)
*
* In node embedding, ther... | the_stack |
#include "utils/utils.cuh"
#include "utils/intrinsics.cuh"
#include "kernel_libs/kernel_fusion.cuh"
#include "data_structures/graph.cuh"
#include "data_structures/active_set.cuh"
#include "data_structures/functor.cuh"
#include "abstraction/config.cuh"
template<ASFmt fmt, QueueMode M, typename G, typename F>
__global__... | the_stack |
* Test of WarpScan utilities
******************************************************************************/
// Ensure printing of CUDA runtime errors to console
#define CUB_STDERR
#include <stdio.h>
#include <typeinfo>
#include <cub/warp/warp_scan.cuh>
#include <cub/util_allocator.cuh>
#include "test_util.h"
usi... | the_stack |
namespace xlib {
namespace device_reduce {
const unsigned BLOCK_SIZE = 32;
namespace kernel {
template<unsigned UNROLL_STEPS = 1, typename R, typename T,
typename ThreadOp, typename WarpOp, typename SeletOp>
__global__
void reduce_arg(T* __restrict__ d_in,
int ... | the_stack |
#define PI 3.14159265
// 2** 31
__device__ const uint32_t REPLUSIVE_INIT = 2147483648;
__device__ const int direction[8][2]={1,0, 1,1, 0,1, -1,1, -1,0, -1,-1, 0,-1, 1,-1};
#define CUDA_1D_KERNEL_LOOP(index, nthreads) \
for (int index = blockIdx.x * blockDim.x + threadIdx.x; index < n... | the_stack |
#include <gunrock/gunrock.h>
// Utilities and correctness-checking
#include <gunrock/util/test_utils.cuh>
// Graph definations
#include <gunrock/graphio/graphio.cuh>
#include <gunrock/app/app_base.cuh>
#include <gunrock/app/test_base.cuh>
// single-source shortest path includes
#include <gunrock/app/sage/sage_test.c... | the_stack |
#include <cublas.h>
#include <helper_cuda.h>
#include <helper_timer.h>
// uncomment if you do not use the viewer.
//#define NOVIEWER
#include "3dregistration.h"
using namespace std;
__global__ static void
updateM(int rowsM, int colsM, int pitchM,
float* d_Xx, float* d_Xy, float* d_Xz,
float* d_Yx, float* d_Y... | the_stack |
#include "FillCurve.h"
#include <iostream>
using namespace std;
// 宏:DEBUG_IMG
// 定义是否输出中间图像调试信息
// #define DEBUG_IMG
// 宏:DEBUG_TIME
// 定义是否输出时间调试信息
// #define DEBUG_TIME
// 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y
// 定义了默认的线程块的尺寸。
#define DEF_BLOCK_X 32
#define DEF_BLOCK_Y 8
// 宏:CUDA_PIXEL_GLO(x,y)
// 获取全局内存中内核函数中图像中(x,y)像素... | the_stack |
namespace MegBA {
namespace geo {
namespace {
template <typename T>
__device__ void AngleAxisRotatePoint(
const T angle_axis0, const T angle_axis1, const T angle_axis2,
const T point0, const T point1, const T point2, T &re_projection0,
T &re_projection1, T &re_projection2, T *dprojection0_dangleaxis,
T ... | the_stack |
SgemmEx: f16.f16->f16
f16.f16->f32
i8.i8->f32
f32.f32->f32
*CgemmEx: ci8.ci8->cf32 [>= sm_50]
cf32.cf32->cf32 [>= sm_50]
DgemmEx: f64.f64->f64
ZgemmEx: cf64.cf64->cf64
*Cgemm3m: cf32.cf32->cf32 (Gauss) [>= sm_50]
... | the_stack |
// Avoid warnings in Qt includes with CUDA compiler
#pragma GCC diagnostic ignored "-Wattributes"
// Avoid warnings in Eigen includes with CUDA compiler
#pragma diag_suppress code_is_unreachable
#include "surfel_meshing/cuda_depth_processing.cuh"
#include <libvis/cuda/cuda_util.h>
#include <math_constants.h>
#includ... | the_stack |
#include <raft/cuda_utils.cuh>
#include <rmm/device_uvector.hpp>
#include <thrust/for_each.h>
#include <numeric>
namespace cugraph {
namespace detail {
template <typename T>
rmm::device_uvector<T> append_all(raft::handle_t const& handle,
std::vector<rmm::device_uvector<T>>&& inpu... | the_stack |
#pragma once
#include <libgen.h>
#include <math.h>
#include <stdio.h>
#include <vector>
#include <time.h>
#include <iostream>
#include <sstream>
#include <string>
#include <gunrock/util/parameters.h>
#include <gunrock/graph/coo.cuh>
namespace gunrock {
namespace graphio {
namespace labels {
/**
* @brief Reads a us... | the_stack |
#include <stdio.h>
#include <memory.h>
#include "cuda_helper.h"
#ifdef __INTELLISENSE__
#define __CUDA_ARCH__ 500
#define __funnelshift_r(x,y,n) (x >> n)
#define atomicExch(p,x) x
#endif
#if __CUDA_ARCH__ >= 300
// 64 Registers Variant for Compute 3.0
#include "quark/groestl_functions_quad.h"
#include "quark/groestl... | the_stack |
* \test Tests vector operations (BLAS level 1) for floating point arithmetic.
**/
//
// *** System
//
#include <iostream>
#include <iomanip>
#include <cmath>
//
// *** ViennaCL
//
//#define VIENNACL_DEBUG_ALL
#include "viennacl/vector.hpp"
#include "viennacl/vector_proxy.hpp"
#include "viennacl/linalg/inner_prod.... | the_stack |
//#include "Tests.h"
#include "Chunk.cuh"
#include <bitset>
#include <iostream>
#include <cstdio>
using namespace std;
#ifdef __GPU
namespace FFF{
/*------- CHUNK ------*/
/*
* Chunk constant memory
*/
__constant__ idx_t p_Mod[max_nonzero_coefs_in_mod];
__constant__ idx_t p_ModLen;
__constant__ Element element_mul;
... | the_stack |
#include <iterator>
#include <cstdio>
#include <cub/agent/agent_three_way_partition.cuh>
#include <cub/config.cuh>
#include <cub/device/dispatch/dispatch_scan.cuh>
#include <cub/thread/thread_operators.cuh>
#include <cub/util_device.cuh>
#include <cub/util_math.cuh>
#include <thrust/system/cuda/detail/core/triple_che... | the_stack |
#include "SortArray.h"
#include <iostream>
#include <cmath>
using namespace std;
// Kernel 函数: _bitonicSortByAscendKer(双调升序排序)
// 实现并行双调排序,按照升序排序。套用 template 模板以便对多类型数据进行处理。
template < typename Type >
static __global__ void
_bitonicSortByAscendKer(
Type *inarray, // 输入数组。
Type *outarray, // 排序后的输... | the_stack |
#include "opencv2/core/cuda/common.hpp"
#include "opencv2/core/cuda/functional.hpp"
#include "opencv2/core/cuda/emulation.hpp"
#include "opencv2/core/cuda/transform.hpp"
using namespace cv::cuda;
using namespace cv::cuda::device;
namespace hist
{
__global__ void histogram256Kernel(const uchar* src, int cols, int ... | the_stack |
#include <ATen/cuda/CUDAContext.h>
#include <THC/THC.h>
#include "box_convolution.h" // for `enum class Parameter`
#define BLOCK_SIZE 256
#define NUM_THREADS 1024
using std::min;
using std::max;
namespace gpu {
template <typename T, size_t N>
using CudaAcsr = const at::PackedTensorAccessor32<T, N, torch::RestrictP... | the_stack |
#if ( MODEL == HYDRO )
/********************************************************
1. Template of a user-defined EoS (EOS_USER)
2. This file is shared by both CPU and GPU
GPU_EoS_User_Template.cu -> CPU_EoS_User_Template.cpp
3. Three steps are required to implement an EoS
I. Set EoS auxiliary arrays
II.... | the_stack |
__constant__ float EPS2;
typedef float2 DS; // double single;
struct DS4 {
DS x, y, z, w;
};
struct DS2 {
DS x, y;
};
// This function computes c = a + b.
__device__ DS dsadd(DS a, DS b) {
// Compute dsa + dsb using Knuth's trick.
float t1 = a.x + b.x;
float e = t1 - a.x;
float t2 = ((b.x - e) + (a.x -... | the_stack |
#pragma once
#include <cuda_runtime.h>
#include <libvis/libvis.h>
#include "badslam/cuda_util.cuh"
#include "badslam/util.cuh"
#include "badslam/robust_weighting.cuh"
namespace vis {
// --- Depth (geometric) residual ---
// Weight factor on the depth residual in the cost term.
constexpr float kDepthResidualWeight ... | the_stack |
#include "cunumeric/fft/fft.h"
#include "cunumeric/fft/fft_template.inl"
#include "cunumeric/cuda_help.h"
#include "cunumeric/pitches.h"
namespace cunumeric {
using namespace Legion;
using namespace legate;
using dim_t = long long int32_t;
template <int32_t DIM, typename TYPE>
__global__ static void copy_kernel(si... | the_stack |
#include <ops/meta_ops.h>
#include <loops/legacy_ops.h>
#define GRID_WIDTH 19 // number of pointers within single grid row
template <typename T>
__device__ inline static void metaPredicateShapeGeneric(const int opTypeA, const int opNumA, const int opTypeB, const int opNumB,
... | the_stack |
#include "boolean3.cuh"
// TODO: make this runtime configurable for quicker debug
constexpr bool kVerbose = false;
using namespace manifold;
namespace {
// These two functions (Interpolate and Intersect) are the only places where
// floating-point operations take place in the whole Boolean function. These are
// ca... | the_stack |
using namespace std;
#ifndef MAP_FILE
#define MAP_FILE MAP_SHARED
#endif
long fsize(int fd) {
struct stat stat;
int res = fstat(fd, &stat);
return stat.st_size;
}
int printll(char *s) {
while (*s != '\n' && *s != ',' && *s != '\t') {
putchar(*s++);
}
return 0;
}
long hash(char *str0, int len) {
unsigned cha... | the_stack |
#include <iostream>
#include <thrust/sort.h>
#ifdef _WIN32
typedef unsigned int uint32_t;
//typedef unsigned short uint32_t;
#endif
using namespace std;
#define PROFILE 1
#define USE_GRID 1
#define USE_BOX_PRUNING 0
#define kRadius 0.05f
#define kMaxRadius (kRadius)// + 0.2f*kRadius)
#define kInvCellEdge (0.5f/kMax... | the_stack |
#include "common.h"
#include "transformerKernels.h"
/**
@file
Implemented the cuda kernel function and its launcher
that required by transformer model.
Currently, fp16 and fp32 versions are provided
*/
namespace lightseq {
namespace cuda {
__forceinline__ __device__ int8_t float2int8(float x, float quant_scale) {
fl... | the_stack |
#include <nbla/array.hpp>
#include <nbla/cuda/common.hpp>
#include <nbla/cuda/function/warp_by_grid.hpp>
#include <nbla/cuda/utils/atomic_add.cuh>
#include <nbla/cuda/utils/nd_index.cuh>
#include <nbla/variable.hpp>
namespace nbla {
template <typename T, bool align_corners = false>
__forceinline__ __device__ T unnorm... | the_stack |
/** Fast integer multiplication */
#define FMUL(x,y) (__mul24(x,y))
//#define FMUL(x,y) ((x)*(y))
// X block count which will be processed by one thread block
#define GPUJPEG_DCT_BLOCK_COUNT_X 4
// Y block count which will be processed by one thread block
#define GPUJPEG_DCT_BLOCK_COUNT_Y 4
// Thread ... | the_stack |
#include <algorithm>
namespace faiss {
namespace gpu {
//
// IVF list metadata aupdate
//
// Updates the device-size array of list start pointers for codes and indices
__global__ void runUpdateListPointers(
Tensor<int, 1, true> listIds,
Tensor<int, 1, true> newListLength,
Tensor<void*, 1, tru... | the_stack |
* \file
* AgentRadixSortDownsweep implements a stateful abstraction of CUDA thread blocks for participating in device-wide radix sort downsweep .
*/
#pragma once
#include <stdint.h>
#include "../thread/thread_load.cuh"
#include "../block/block_load.cuh"
#include "../block/block_store.cuh"
#include "../block/block... | the_stack |
#include "LearningFilter.h"
#include "Matrix.h"
#include "LinearFilter.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
// Kernel 函数:_matToImg(类型转换)
// 将 MatrixCuda 数... | the_stack |
#include "mask/seamFinder.hpp"
#include "backend/common/imageOps.hpp"
#include "backend/cuda/deviceBuffer.hpp"
#include "backend/cuda/deviceStream.hpp"
#include "cuda/util.hpp"
#include "core/rect.hpp"
#include "gpu/vectorTypes.hpp"
#include "gpu/memcpy.hpp"
#include "mask/mergerMaskConstant.hpp"
namespace VideoStitc... | the_stack |
namespace fastertransformer {
#define TOPK_FP16_STORAGE 0
template <typename T, int MAX_K, int THREADBLOCK_SIZE>
__launch_bounds__(THREADBLOCK_SIZE) __global__
void beam_topK_kernel(const T* log_probs,
int* topk_tmp_id_buf,
T* topk_tmp_val_buf,
... | the_stack |
#include "ImageDrawer.h"
// 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y
// 定义了默认的线程块的尺寸。
#define DEF_BLOCK_X 32
#define DEF_BLOCK_Y 8
// 宏:DEF_BLOCK_1D
// 定义了默认的 1D Block 尺寸。
#define DEF_BLOCK_1D 512
// Kernel 函数:_brushAllImageKer(涂满整幅图像)
// 将整幅图像使用同一种颜色涂满。
static __global__ void // Kernel 函数无返回值
_brushAllImageKer(
... | the_stack |
//#include <gunrock/util/array_utils.cuh>
//#include <gunrock/oprtr/1D_oprtr/for_all.cuh>
//#include <gunrock/oprtr/1D_oprtr/for_each.cuh>
//#include <gunrock/oprtr/1D_oprtr/1D_scalar.cuh>
//#include <gunrock/oprtr/1D_oprtr/1D_1D.cuh>
//#include <gunrock/graph/csr.cuh>
//#include <gunrock/graph/coo.cuh>
//#include <gun... | the_stack |
#include "octnet/gpu/pool.h"
#include "octnet/gpu/gpu.h"
#include <cstdio>
#include <cstdlib>
template <int level>
__global__ void kernel_pool2x2x2_struct(octree out, int n_blocks, const octree in, ot_size_t feature_size) {
CUDA_KERNEL_LOOP(grid_idx, n_blocks) {
ot_tree_t* in_tree = octree_get_tree(&in, grid_i... | the_stack |
#include "common.cuh"
#include <kat/on_device/miscellany.cuh>
#include <kat/utility.hpp>
// #include <gsl/span>
#include <limits>
template <typename T>
KAT_DEV bool single_swap_test(T x, T y)
{
T x_ { x };
T y_ { y };
kat::swap<T>(x_, y_);
return (x == y_) and (y == x_);
}
struct copy_testcase_spec {
std::size... | the_stack |
// TEST make sure boost isn't included in nvcc code
#if defined(BOOST_COMPILER)
int bla[-1];
#endif
namespace PyCA {
__global__ void SubVol_kernel(float* d_o, const float* d_i,
int osizeX, int osizeY, int osizeZ,
int isizeX, int isizeY, int isizeZ,
int startX, int startY, int startZ)
{
... | the_stack |
#include <thrust/execution_policy.h>
#include <algorithm>
#include <map>
#include <stack>
#include "impl.cuh"
namespace {
using namespace manifold;
__host__ __device__ void AtomicAddVec3(glm::vec3& target,
const glm::vec3& add) {
for (int i : {0, 1, 2}) {
#ifdef __CUDA_ARCH_... | the_stack |
#include "atomics/missing_in_cuda.cuh"
#include <kat/on_device/common.cuh>
#include <kat/on_device/builtins.cuh>
#include <kat/on_device/math.cuh>
#include <device_atomic_functions.h>
#if (CUDART_VERSION >= 8000)
#include <sm_60_atomic_functions.h>
#include <cuda_fp16.h>
#endif
#include <kat/detail/pointers.cuh>
#inc... | the_stack |
#include <claraparabricks/genomeworks/utils/cudautils.hpp> //GW_CU_CHECK_ERR
#include <claraparabricks/genomeworks/utils/signed_integer_utils.hpp> //get_size
#include "gtest/gtest.h"
namespace claraparabricks
{
namespace genomeworks
{
namespace cudapoa
{
class BasicGenerateConsensus
{
public:
Basic... | the_stack |
* Note:
* PME_Common. This is an experimental interface that is subject to change and/or deletion.
*/
#ifndef MINDSPORE_CCSRC_KERNEL_GPU_CUDA_IMPL_SPONGE_PME_PME_COMMON_H_
#define MINDSPORE_CCSRC_KERNEL_GPU_CUDA_IMPL_SPONGE_PME_PME_COMMON_H_
#include "backend/kernel_compiler/gpu/cuda_impl/sponge/common_sponge... | the_stack |
#include "boolean3.cuh"
#include "impl.cuh"
namespace {
using namespace manifold;
using namespace thrust::placeholders;
struct MakeTri {
const Halfedge* halfedges;
__host__ __device__ void operator()(thrust::tuple<glm::ivec3&, int> inOut) {
glm::ivec3& tri = thrust::get<0>(inOut);
const int face = 3 * th... | the_stack |
// -----------------------------------------------------------------------------------------
// NVEnc by rigaya
// -----------------------------------------------------------------------------------------
//
// The MIT License
//
// Copyright (c) 2014-2016 rigaya
//
// Permission is hereby granted, free of cha... | the_stack |
#define XTALK_CONST_FRAC 0.25f
#define XTALK_CONST_FRAC_REF 0.86f
#define XTALK_CONST_FRAC_REF_COMP 0.14f
#define XTALK_MAGIC_FLOW 32.0f
#define XTALK_MAGIC_LAMBDA 1.425f
#define XTALK_MAGIC_DISCOUNT 0.33f
#define POLYCLONAL_PPF_CUTOFF 0.84f
#define PO... | the_stack |
#include <nvbio/basic/types.h>
#include <nvbio/basic/exceptions.h>
#include "bam_io.h"
using namespace nvbio;
/** ---- Read Functionality ---- **/
BAMReader::BAMReader(const char *fname) : eof(false)
{
fp = gzopen(fname, "rb");
if (fp == NULL) {
throw nvbio::runtime_error("Could not open %s", fname);
}
if (!... | the_stack |
#include <feature-transform.h>
#include <cnn-utility.h>
#include <cuda_profiler_api.h>
using namespace std;
#define DEBUG_STR(x) ("\33[33m"#x"\33[0m = " + to_string(x) + "\t")
#define VECTOR std::vector
#define WHERE std
#include <operators.inl>
#undef VECTOR
#undef WHERE
#define __CUDA_CONSTANTS__ \
const int nTh... | the_stack |
* \file
* cub::AgentSegmentFixup implements a stateful abstraction of CUDA thread blocks for participating in device-wide reduce-value-by-key.
*/
#pragma once
#include <iterator>
#include "single_pass_scan_operators.cuh"
#include "../block/block_load.cuh"
#include "../block/block_store.cuh"
#include "../block/bloc... | the_stack |
#pragma once
#include <gunrock/util/io/modified_store.cuh>
#include <gunrock/util/operators.cuh>
namespace gunrock {
namespace util {
namespace io {
/**
* Scatter a tile of data items using the corresponding tile of scatter_offsets
*/
template <int LOG_LOADS_PER_TILE, // Number of vector loads (log)
int... | the_stack |
#include "error_correct.h"
#include "utils.h"
#include <nvbio/basic/pipeline_context.h>
#include <nvbio/basic/numbers.h>
#include <nvbio/basic/atomics.h>
#include <nvbio/basic/bloom_filter.h>
#include <nvbio/basic/primitives.h>
#include <nvbio/basic/console.h>
#include <nvbio/basic/timer.h>
#include <nvbio/basic/thread... | the_stack |
// HistogramSpec.cu
// 实现直方图规定化算法
#include "HistogramSpec.h"
#include "Histogram.h"
#include <iostream>
using namespace std;
#include "ErrorCode.h"
// 宏:HISTOGRAM_LEVEL
// 输入图像直方图的灰度级,默认为 256。
#ifndef HISTOGRAM_LEVEL
#define HISTOGRAM_LEVEL 256
#endif
// 宏:HISTSPEC_LEVEL
// 规定化后输出图像的灰度级,默认为 256。
#ifndef HIST... | the_stack |
#define MOD_NAMESPACE
#define MOD_NAMESPACE_BEGIN namespace bowtie2 { namespace driver {
#define MOD_NAMESPACE_END }}
#define MOD_NAMESPACE_NAME bowtie2::driver
#include <nvBowtie/bowtie2/cuda/compute_thread.h>
#include <nvBowtie/bowtie2/cuda/defs.h>
#include <nvBowtie/bowtie2/cuda/fmindex_def.h>
#include <nvBowtie/... | the_stack |
extern "C" {
#include "ccv.h"
}
#include <ctype.h>
#define CASE_TESTS // so that we don't include public available methods
#include "../lib/cuda/cwc_convnet.cu"
#include "../lib/ccv_convnet.c"
extern "C" void cwc_bench_runtime(ccv_convnet_t* convnet, ccv_array_t* categorizeds, ccv_convnet_train_param_t params)
{
int ... | the_stack |
#include <array/NDArrayFactory.h>
#include <exceptions/cuda_exception.h>
#include <helpers/ConstantTadHelper.h>
#include <helpers/PointersManager.h>
#include <helpers/ShapeUtils.h>
#include <helpers/TAD.h>
#include <ops/declarable/helpers/segment.h>
#include <ops/declarable/helpers/segment_common.h>
namespace sd {
nam... | the_stack |
// 1. Removed compute3.0 and lower compute capability
// 2. Replaced 64bit shifts with byte permutations
// 3. Removed pointer fetching from constant memory
// 4. Better loop unrolling factors for cp5.0/5.2
// 6. More precomputations
// 7. Increased default intensity (?)
// 8. Restored Second nonce buffer
// 9. Use vid... | the_stack |
#include <atomic>
#include <iostream>
#include <string>
#include <torch/csrc/utils/python_numbers.h>
#include <unordered_map>
namespace quiver
{
#define CHECK_CPU(x) AT_ASSERTM(!x.device().is_cuda(), #x " must be CPU tensor")
class ShardTensorItem
{
public:
int device;
cudaIpcMemHandle_t mem_handle;
std:... | the_stack |
// check if A+B is faster than just B
// check if loading affineBias into shared memory is faster than loading
// multiple times (if not try 64,16 backwards case)
template <typename T, Int K, Int V>
__global__ void dAffineReluTrivialConvolution_forwardA(
T *inFeatures, T *outFeatures, T *affineWeight, T *affineBia... | the_stack |
#include "caffe/filler.hpp"
#include "caffe/layers/class_distance_layer.hpp"
#include "caffe/util/math_functions.hpp"
namespace caffe {
//////////////////////////////////////////
template <typename Dtype>
static __global__ void compute_top_l2(const int nthreads, const int N_, const int K_,
const Dtype *bottom_dat... | the_stack |
namespace tensorflow {
#define FINAL_MASK 0xffffffff
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 <typename T>
__inline__ __device__ T warpReduceSum(T val) {
for(int mask = 16; ma... | the_stack |
namespace timemachine {
template <int D>
double reduce_born_forces_jvp(
const std::vector<Surreal<double>> &coords,
const std::vector<double> ¶ms,
const std::vector<int> &atomic_radii_idxs,
const std::vector<Surreal<double>> &born_radii,
const std::vector<Surreal<double>> &obc_chain,
const ... | the_stack |
#include "ConvSingleInputExecution.hpp"
namespace MNN {
namespace CUDA {
template <typename T>
__global__ void Pad(const size_t size, const T* input, const int old_height,
const int old_width, const int padded_height, const int padded_width, const int pad_top,
const int pad_lef... | the_stack |
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/time.h>
#include "determinant_update.h"
#include "../../CUDA/gpu_misc.h"
template<typename T, int BS>
__global__ void
update_inverse_cuda1 (updateJob *updateList,
int N, int rowstride)
{
__shared__ T *A, *Ainv, *u, *Ainv... | the_stack |
#include <algorithm>
#include <cstdint>
#include <mutex>
#include <type_traits>
#include "chainerx/cuda/cuda.h"
#include "chainerx/cuda/cuda_runtime.h"
#include "chainerx/cuda/data_type.cuh"
#include "chainerx/macro.h"
#include "chainerx/reduction_kernel_arg.h"
namespace chainerx {
namespace cuda {
namespace reduce_d... | the_stack |
#include "cudapoa_limits.hpp"
#include "cudapoa_batch.cuh"
#include <claraparabricks/genomeworks/cudapoa/batch.hpp>
namespace claraparabricks
{
namespace genomeworks
{
namespace cudapoa
{
/// constructor- set other parameters based on a minimum set of input arguments
BatchConfig::BatchConfig(int32_t max_seq_sz /*=... | the_stack |
#include <torch/extension.h>
#include <ATen/ATen.h>
#include "fast_lsh_cumulation.h"
#include "fast_lsh_cumulation_cuda.h"
#include "common_cuda.h"
#include "common.h"
#include <vector>
//////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////... | the_stack |
namespace amgx
{
template <typename index_type, typename value_type>
__global__ void shift_diagonal(index_type num_rows,
const index_type *row_offsets,
const index_type *col_indices,
value_type *values,
... | the_stack |
#include <exceptions/cuda_exception.h>
#include <helpers/PointersManager.h>
#include <math/templatemath.h>
#include <ops/declarable/helpers/convolutions.h>
namespace sd {
namespace ops {
//////////////////////////////////////////////////////////////////////////
template <typename X, typename Z>
static SD_KERNEL void ... | the_stack |
#include "cuda_helper.h"
#include "miner.h"
#ifdef __INTELLISENSE__
#define __CUDA_ARCH__ 500
#define __funnelshift_r(x,y,n) (x >> n)
#define atomicExch(p,x) x
#endif
// 64 Registers Variant for Compute 3.0
#include "quark/groestl_functions_quad.h"
#include "quark/groestl_transf_quad.h"
// globaler Speicher für alle... | the_stack |
// CUDA libraries
#include <hip/hip_runtime.h>
/** Problem size along one side; total number of cells is this squared */
#define NUM 512
// block size
#define BLOCK_SIZE 128
/** Double precision */
#define DOUBLE
#ifdef DOUBLE
#define Real double
#define ZERO 0.0
#define ONE 1.0
#define TWO 2.0
#define FOUR 4.0
#... | 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 "..\Activation\ActivationFunction.cu"
#include <stdio.h>
extern "C"
{
__device__ int indexFromXY... | the_stack |
template <typename T, typename S>
__global__ void ScatterNdUpdate(const size_t unit_size, const size_t index_depth, const size_t updates_size,
const S *out_strides, const S *indices, const T *updates, T *input) {
int i, j;
for (size_t read_index = blockIdx.x * blockDim.x + threadIdx.... | the_stack |
namespace AggMIS {
namespace MergeSplitCPU {
MergeSplitConditionerCPU::MergeSplitConditionerCPU(AggMIS::Types::Graph_h &graph,
AggMIS::Types::IntVector_h &aggregation) {
this->graph = &graph;
this->aggregation.assign(aggregation.begin(), aggregation.end());
inducedGraph = GraphHelpers::Get... | the_stack |
#ifdef WITH_FULL_W_MATRIX
#define R_W_MATRICES_SMEM_SLOTS 15
#else
#define R_W_MATRICES_SMEM_SLOTS 12
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define CHECK_CUDA(call) do { \
cudaError_t status = call; \
if( status != cudaSucces... | the_stack |
#ifdef __cplusplus
extern "C" {
#endif
#include <float.h>
#include <stdio.h>
#include "highway_lstm_kernel.h"
#define BLOCK 256
// Define some error checking macros.
#define cudaErrCheck(stat) { cudaErrCheck_((stat), __FILE__, __LINE__); }
void cudaErrCheck_(cudaError_t stat, const char *file, int line) {
if (sta... | the_stack |
inline __device__ void operator+=(float4 &a, float4 b)
{
a.x += b.x;
a.y += b.y;
a.z += b.z;
a.w += b.w;
}
inline __device__ float4 operator+(float4 a, float4 b)
{
return make_float4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
}
inline __device__ int4 operator+(int4 a, int4 b)
{
return make_... | the_stack |
#include <amgx_types/util.h>
#include <amgx_types/io.h>
#include <amgx_types/math.h>
namespace amgx
{
template <class T_Config>
void MatrixAnalysis<T_Config>::valueDistribution(double *minAbs, double *maxAbs)
{
const int bx = A->get_block_dimx();
const int by = A->get_block_dimy();
const int n... | the_stack |
* Kernel utilities for loading tiles of data through global memory
* with cache modifiers, marking discontinuities between consecutive elements
******************************************************************************/
#pragma once
#include <b40c/util/operators.cuh>
#include <b40c/util/vector_types.cuh>
#inclu... | the_stack |
#include <ATen/ATen.h>
#include <ATen/cuda/CUDAContext.h>
// #include <THC/THC.h>
#include <THC/THCAtomics.cuh>
// #include <THC/THCDeviceUtils.cuh>
#define CUDA_KERNEL_LOOP(i, n) \
for (int i = blockIdx.x * blockDim.x + threadIdx.x; \
i < (n); ... | the_stack |
#define PSROIALIGNAVEROTATEDPOOLING_CUDA_CHECK(condition) \
/* Code block avoids redefinition of cudaError_t error */ \
do { \
cudaError_t error = condition; \
CHECK_EQ(error, cudaSuccess) << " " << cudaGetErrorString(error); \
} while (0)
#define CUDA_KERNEL_LOOP(i, n) \
for (int i = blockIdx.x * blockDi... | the_stack |
#include <cuda.h>
#include <cuda_runtime.h>
const auto THREADS_PER_BLOCK_1D = 16u;
//const auto THREADS_PER_BLOCK = 512u;
// Max/min functions
template<class T>
inline __device__ T fastMaxCuda(const T a, const T b)
{
return (a > b ? a : b);
}
template<class T>
inline __device__ T fastMinCuda(const T a, const T b)... | the_stack |
#include "../../util_math.cuh"
#include "../../util_device.cuh"
#include "../../util_namespace.cuh"
#include "../../agent/agent_merge_sort.cuh"
#include <thrust/system/cuda/detail/core/triple_chevron_launch.h>
#include <thrust/detail/integer_math.h>
CUB_NAMESPACE_BEGIN
template <bool UseVShmem,
typename A... | the_stack |
#include <cuda_helper.h>
#include <cuda_vectors.h>
#include <miner.h>
__constant__ static uint32_t _ALIGN(16) c_midstate112[8];
__constant__ static uint32_t _ALIGN(16) c_midbuffer112[8];
__constant__ static uint32_t _ALIGN(16) c_dataEnd112[12];
__constant__ const uint32_t c_H256[8] = {
0x6A09E667, 0xBB67AE85, 0x3C... | the_stack |
#include "cuda-align.cuh"
#include "../../../include/librealsense2/rsutil.h"
#include "../../cuda/rscuda_utils.cuh"
// CUDA headers
#include <cuda_runtime.h>
#ifdef _MSC_VER
// Add library dependencies if using VS
#pragma comment(lib, "cudart_static")
#endif
#define RS2_CUDA_THREADS_PER_BLOCK 32
using namespace li... | the_stack |
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may ... | the_stack |
// host-no-diagnostics
#include "Inputs/cuda.h"
int func();
struct A {
int x;
static int host_var;
};
int A::host_var; // dev-note {{host variable declared here}}
namespace X {
int host_var; // dev-note {{host variable declared here}}
}
// struct with non-empty ctor.
struct B1 {
int x;
B1() { x = 1; }
}... | the_stack |
namespace anakin {
namespace saber {
template <typename Dtype>
__global__ void cal_lstm_kernel_batch_with_peephole_anyactivate(
const Dtype* w_x, const Dtype* b_i, const Dtype* b_f, const Dtype* b_c, const Dtype* b_o,
const Dtype* w_ci, const Dtype* w_cf, const Dtype* w_co, Dtype* cell,const int hidd... | the_stack |
#pragma once
#include "cuda/Complex.cuh"
#include "cuda/ComputeCapabilities.cuh"
#include "cuda/CudaUtils.cuh"
#include "cuda/DeviceTensor.cuh"
#include "cuda/fbfft/FBFFTCommon.cuh"
#include "cuda/fbfft/FBFFTParameters.h"
#include "cuda/fbfft/FFT2D32.cuh"
#include "cuda/util/CachedDeviceProperties.h"
#include <cuda_r... | the_stack |
#ifdef _MSC_VER
#define UINT2(x,y) { x, y }
#else
#define UINT2(x,y) (uint2) { x, y }
#endif
__constant__ static __align__(16) uint32_t c_E8_bslice32[42][8] = {
// Round 0 (Function0)
{ 0xa2ded572, 0x90d6ab81, 0x67f815df, 0xf6875a4d, 0x0a15847b, 0xc54f9f4e, 0x571523b7, 0x402bd1c3 },
{ 0xe03a98ea, 0xb4960266, 0x9c... | the_stack |
*
* This example demostrates how to use textures bound to pitch linear memory.
* It performs a shift of matrix elements using wrap addressing mode (aka
* periodic boundary conditions) on two arrays, a pitch linear and a CUDA array,
* in order to highlight the differences in using each.
*
* Textures binding to ... | the_stack |
#define FMI_ALIGNMENT 4u
namespace nvbio {
namespace io {
///@addtogroup IO
///@{
///@addtogroup FMIndexIO
///@{
namespace { // anonymous namespace
///@addtogroup FMIndexIODetail
///@{
template <typename T>
uint64 block_fread(T* dst, const uint64 n, FILE* file)
{
#if defined(WIN32)
// use blocked reads on Win... | the_stack |
#include "common.h"
/* SFILE_END */
// #include "./polyquotient.cu"
__host__ __device__ void cross_prod (
double a11[], int deg11,
double a12[], int deg12,
double a21[], int deg21,
double a22[], int deg22,
double a00[], double toep[], int deg00,
double res[], int &dres,
... | the_stack |
__global__ void
conv_full_patch_split( float* img, float* kern, float* out, int img_len, int img_wid, int kern_len, int kern_wid, int nb_split)
{
int __shared__ out_len, out_wid, nb_thread_id;
out_len = img_len + kern_len - 1;
out_wid = img_wid + kern_wid - 1;
nb_thread_id = blockDim.z*blockDim.y*blockDim.x;
... | the_stack |
* How to compile (assume cuda is installed at /usr/local/cuda/)
* nvcc -c -I/usr/local/cuda/include svd_example.cpp
* g++ -fopenmp -o a.out svd_example.o -L/usr/local/cuda/lib64 -lcudart -lcublas -lcusolver
*
* EY : 20170627 This also worked for me
* nvcc -std=c++11 -arch='sm_52' -lcudart -lcublas -lcusolver ... | the_stack |
#pragma once
#include <gunrock/app/enactor_base.cuh>
#include <gunrock/app/enactor_iteration.cuh>
#include <gunrock/app/enactor_loop.cuh>
#include <gunrock/oprtr/oprtr.cuh>
#include <gunrock/app/geo/geo_problem.cuh>
#include <gunrock/app/geo/geo_spatial.cuh>
namespace gunrock {
namespace app {
namespace geo {
/**
... | the_stack |
#if !defined(ENABLE_GPU) | !defined(ENABLE_CUDNN)
#error "nnconv_cudnn.hpp cannot be compiled without GPU and CUDNN support."
#endif
#include "nnconv.hpp"
#include "datacu.hpp"
#include "impl/cudnnhelper.hpp"
#include <cassert>
#include <algorithm>
using namespace vl ;
using namespace vl::nn ;
using namespace vl::imp... | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.