text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
#include "caffe/layers/winograd_layer.hpp"
#include "caffe/util/winograd.hpp"
namespace caffe {
template <typename Dtype>
__global__ void winograd_input_im2col_gpu_kernel(
const int n,
const Dtype *data, Dtype *col_buff,
int height, int width,
int pad_h, int pad_w,
int ntiles_h, int ntiles_w,
int tile_h_i... | the_stack |
#include<ops/declarable/helpers/batchnorm.h>
#include <helpers/ShapeUtils.h>
#include <helpers/OmpLaunchHelper.h>
#include <helpers/ConstantTadHelper.h>
#include <helpers/PointersManager.h>
namespace sd {
namespace ops {
namespace helpers {
//////////////////////////////////////////////////////////////////////... | the_stack |
//
// This file contains dimension reduction operation functions and
// kernels that work on both contiguous and non-contiguous tensor
// arguments of arbitrary (up to MAX_CUTORCH_DIMS) dimensioned
// arguments without copying or temporary storage.
//
#include <THC/THCTensorTypeUtils.cuh>
#include <THC/THCReduceApplyU... | the_stack |
// add_QKV_bias kernel code modified from Nvidia's DeepLearningExamples
// https://github.com/NVIDIA/DeepLearningExamples/blob/master/FasterTransformer/v3.1/fastertransformer/cuda/open_attention.cu#L1342-L1395
template<typename T>
__global__
void add_QKV_bias_opt(T* Q, const T* bias_Q, T* K, const T* bias_K, T* V, con... | the_stack |
// Pseudo-random number generator
namespace amgx
{
__host__ __device__ unsigned int hash(unsigned int a, unsigned int seed)
{
a ^= seed;
a = (a + 0x7ed55d16) + (a << 12);
a = (a ^ 0xc761c23c) + (a >> 19);
a = (a + 0x165667b1) + (a << 5);
a = (a ^ 0xd3a2646c) + (a << 9);
a = (a + 0xfd7046c5) + (... | the_stack |
#include "FreckleFilter.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
// Device 函数:_getMaxMatchValueDev(得到两个直方图的 length 长度
// 相似度匹配最大值)
// 对圆周和园内两直方图进行长度为 length 的相似度匹配,返回最大值
static __d... | the_stack |
#include <ops/declarable/helpers/roll.h>
#include <helpers/ConstantTadHelper.h>
#include <helpers/PointersManager.h>
namespace sd {
namespace ops {
namespace helpers {
template <typename T>
static void _CUDA_D rollKernelLinearStage1Dev(const void *vx, const Nd4jLong *xShapeInfo, void *vz, const Nd4jLong *zSha... | the_stack |
* @file TopKSort.cu
* @author Minggang Yu <miyu@mapd.com>
* @brief Top-k sorting on streaming top-k heaps on VRAM
*
* Copyright (c) 2017 MapD Technologies, Inc. All rights reserved.
*/
#include "BufferEntryUtils.h"
#include "GpuMemUtils.h"
#include "ResultSetBufferAccessors.h"
#include "SortUtils.cuh"
#incl... | the_stack |
#if defined (__i386__)
static __inline__ unsigned long long GetCycleCount(void)
{
unsigned long long int x;
__asm__ volatile ("rdtsc":"=A"(x));
return x;
}
#elif defined (__x86_64__)
static __inline__ unsigned long long GetCycleCount(void)
{
unsigned hi, lo;
__asm__ volatile("rdtsc":"=a"(lo), "=d"(h... | the_stack |
Copyright (C) 2016 Andrea Vedaldi.
All rights reserved.
This file is part of the VLFeat library and is made available under
the terms of the BSD license (see the COPYING file).
*/
#include "bits/mexutils.h"
#include "bits/datamex.hpp"
#include "bits/data.hpp"
#if ENABLE_GPU
#include "bits/datacu.hpp"
#endif
#includ... | the_stack |
// Optimize nchw2nhwc && nhwc2nchw with tiling and shared memory.
// Firstly, combined 2 dims hw together, treat input and output as 3D tensor.
// Secondly, determine whether a matrix is a large matrix or a narrow matrix,
// which determines the chosen TileSize.
// Reason: tiling and shared memory can avoid uncoalesced... | the_stack |
namespace cuHE {
// Pre-computation
static ZZ* crtPrime; // decreasing?
static ZZ* coeffModulus; // decreasing
void genCrtPrimes() {
int pnum = param.numCrtPrime;
crtPrime = new ZZ[pnum];
unsigned* h_p = new unsigned[pnum];
int logmid = param.logCoeffMin-(pnum-param.depth)*param.logCrtPrime;
// after cutting, fai... | the_stack |
// On pytorch 1.10 and CUDA 10.2, I get compilation errors on torch/csrc/api/include/torch/nn/cloneable.h
// So we'll only include torch/python.h instead of torch/extension.h
// Similar to https://github.com/getkeops/keops/blob/3efd428b55c724b12f23982c06de00bc4d02d903/pykeops/torch_headers.h.in#L8
// #include <torch/ex... | the_stack |
texture<huffman_indx_t> huffman_indx_texture;
texture<huffman_code_t> huffman_code_texture;
texture<huffman_point_t> huffman_point_texture;
texture<window_t> context_range_texture;
texture<word> corpus_texture;
__global__ void cbow_neural_network_async_validation_kernel(real* likelihood,
const real* w... | the_stack |
template <typename scalar_t>
__device__ scalar_t modulated_deform_conv2d_im2col_bilinear(
const scalar_t *bottom_data, const int data_width,
const int height, const int width, scalar_t h, scalar_t w)
{
int h_low = floor(h);
int w_low = floor(w);
int h_high = h_low + 1;
int w_high = w_low + 1;
scala... | the_stack |
#include <iostream>
using std::cout;
using std::cerr;
using std::endl;
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <mpi.h>
#include <unistd.h> // for gethostname
namespace etics {
namespace scf {
extern __constant__ CacheStruct Cache;
extern Compl... | the_stack |
#include "bnorm.hpp"
#include "../datacu.hpp"
#include "blashelper.hpp"
#include <assert.h>
#include <float.h>
#include <stdint.h>
// MSB_WARP = log2(WARP_SIZE)
#define WARP_SIZE 32
#define MSB_WARP 5
// macro function
#define min(a,b) (a > b ? b : a);
/* -------------------------------------------------------------... | the_stack |
#include "DouglasPeucker.h"
// 宏:DEF_BLOCK_1D
// 定义了默认的 1D Block 尺寸。
#define DEF_BLOCK_1D 512
// 宏:CH_LARGE_ENOUGH
// 定义了一个足够大的正整数,该整数在使用过程中被认为是无穷大。
#define CH_LARGE_ENOUGH ((1 << 30) - 1)
// Kernel 函数:_initLabelAryKer(初始化 LABEL 数组)
// 在迭代前初始化 LABEL 数组,初始化后的 LABEL 数组要求除最后一个元素为 1
// 以外,其他的元素皆为 0。
static __global__... | the_stack |
// gvdbBrickFunc ( gvdb, channel, nodeid, t, pos, dir, hit, norm, clr )
typedef void(*gvdbBrickFunc_t)( VDBInfo*, uchar, int, float3, float3, float3, float3&, float3&, float4& );
static const int MAXLEV = 5;
static const int MAX_ITER = 256;
// Gets the value of a given floating-point channel at a point inside a brick... | the_stack |
* Software License Agreement (BSD License)
*
* Copyright (c) 2009, Willow Garage, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must r... | the_stack |
extern "C" {
#include <ccv.h>
#include <ccv_internal.h>
#include <nnc/ccv_nnc.h>
#include <nnc/ccv_nnc_easy.h>
#include <nnc/ccv_nnc_internal.h>
}
#include <nnc/gpu/ccv_nnc_compat.h>
#ifdef HAVE_CUDA
#ifdef USE_SYSTEM_CUB
#include <cub/util_type.cuh>
#include <cub/device/device_radix_sort.cuh>
#include <cub/thread/th... | the_stack |
#include "lbann/utils/gpu/helpers.hpp"
#ifdef LBANN_HAS_CUDA
namespace lbann {
namespace gpu_lib {
// -------------------------------------------------------------
// Device properties
// -------------------------------------------------------------
dim3 max_grid_dims() {
static dim3 max_grid_dims_(0,0,0);
if (... | the_stack |
#include "cuda_error.h"
#include "cuda_runtime.h"
#include "StreamingKernels.h"
#include "MultiFitStream.h"
#include "JobWrapper.h"
#include "GpuMultiFlowFitControl.h"
#include "SignalProcessingFitterQueue.h"
using namespace std;
#define DEBUG_SIZE 0
int SimpleMultiFitStream::_bpb = 128;
int SimpleMultiFitStream::... | the_stack |
#pragma once
#include <gunrock/app/problem_base.cuh>
namespace gunrock {
namespace app {
namespace geo {
/**
* @brief Speciflying parameters for Geo Problem
* @param parameters The util::Parameter<...> structure holding all parameter
* info \return cudaError_t error message(s), if any
*/
cudaError_t UseParamet... | the_stack |
#define CUB_STDERR
#include <thrust/device_vector.h>
#include <thrust/distance.h>
#include <thrust/host_vector.h>
#include <thrust/mismatch.h>
#include <thrust/scan.h>
#include <cub/device/device_spmv.cuh>
#include <cub/util_debug.cuh>
#include <iostream>
#include <type_traits>
#include <typeinfo>
#include "test_ut... | the_stack |
#pragma once
extern "C"
{
__device__ unsigned int debugCounters[1024];
}
#include <math/vector.h>
#include <math/matrix.h>
#include "triangle_buffer.cuh"
#include "index_queue.cuh"
#include "bin_raster.cuh"
#include "tile_raster.cuh"
#include "bitmask.cuh"
#include "config.h"
#include "utils.c... | the_stack |
#include <nvbench/axes_metadata.cuh>
#include <nvbench/axis_base.cuh>
#include <nvbench/benchmark.cuh>
#include <nvbench/callable.cuh>
#include "test_asserts.cuh"
#include <fmt/format.h>
// Mock up a benchmark for testing:
void dummy_generator(nvbench::state &) {}
NVBENCH_DEFINE_CALLABLE(dummy_generator, dummy_calla... | the_stack |
#include "Device/Util/Basic.cuh" //xlib::shfl
#include "Device/Util/DeviceProperties.cuh" //xlib::WARP_SIZE
namespace xlib {
namespace detail {
template<int SIZE, int INDEX = 0>
struct Unroll {
template<typename Lambda>
__device__ __forceinline__
static void apply(const Lambda& lambda) {
... | the_stack |
template<typename T>
struct row_length : public thrust::unary_function<T, T>
{
__host__ __device__ T operator()(const T &x) const
{
const T *next_ptr = &x;
next_ptr++;
return (*next_ptr) - x;
}
};
namespace amgx
{
__global__ void computeRowOffsetsKernel(INDEX_TYPE num_rows, INDEX_T... | the_stack |
#include <cudf/column/column_device_view.cuh>
#include <cudf/column/column_factories.hpp>
#include <cudf/detail/get_value.cuh>
#include <cudf/detail/null_mask.hpp>
#include <cudf/detail/nvtx/ranges.hpp>
#include <cudf/strings/detail/replace.hpp>
#include <cudf/strings/detail/utilities.cuh>
#include <cudf/strings/detail... | the_stack |
#include <LightGBM/cuda/cuda_tree.hpp>
namespace LightGBM {
__device__ void SetDecisionTypeCUDA(int8_t* decision_type, bool input, int8_t mask) {
if (input) {
(*decision_type) |= mask;
} else {
(*decision_type) &= (127 - mask);
}
}
__device__ void SetMissingTypeCUDA(int8_t* decision_type, int8_t input)... | the_stack |
* which demonstrates the use of CUDA in a multi phase sorting
* computation.
* Device code.
*/
#ifndef _RADIXSORT_KERNEL_H_
#define _RADIXSORT_KERNEL_H_
#include <stdio.h>
#include "radixsort.cuh"
#define SYNCIT __syncthreads()
static const int NUM_SMS = 16;
static const int NUM_THREADS_PER_SM = 192;
static con... | the_stack |
namespace caffe2 {
namespace {
template <typename T>
__global__ void LRNFillScaleNCHW(const int nthreads, const T* in,
const int num, const int channels, const int height,
const int width, const int size, const T alpha_over_size,
const T bias, T* scale) {
CUDA_1D_KERNEL_LOOP(index, nthreads) {
// fin... | the_stack |
#pragma once
#include <math/vector.h>
#include <ptx_primitives.cuh>
#include "shader.cuh"
namespace internal
{
template <unsigned int i, unsigned int j, typename... T>
struct PackedBufferAttribute;
template <unsigned int i, typename... Tail>
struct PackedBufferAttribute<i, 0, float, Tail...>
... | the_stack |
#include <iostream>
#include <chrono>
#include <algorithm>
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include "bbcu/bbcu.h"
#include "bbcu/bbcu_util.h"
#include "Common.cuh"
#include "StochasticLut.cuh"
// -------------------------------------------------
// Forward
// ----------------------... | the_stack |
#define FULL_MASK 0xffffffff
#define WARP_SIZE 32
/* Utility: Compute Offset Within Matrix From Addr [0,0]
*/
template<typename data_t, typename index_t>
__device__ __forceinline__
data_t* pointerOffset(data_t * base_pointer,
size_t const ld,
index_t const row,
... | the_stack |
/// Should the implementation use streams to schedule kernels in parallel if possible?
#define ENOKI_CUDA_USE_STREAMS 1
/// Synchronize with the device after each kernel launch (useful for debugging)
#define ENOKI_CUDA_LAUNCH_BLOCKING 0
#if defined(NDEBUG)
# define ENOKI_CUDA_DEFAULT_LOG_LEVEL 0
#else
# define ENOK... | the_stack |
#ifdef __CDT_PARSER__
#define __global__
#define __device__
#define __host__
#define __shared__
#endif
#define THREADS_PER_BLOCK 1024
/*****************************************************************************/
/* HELPER FUNCTIONS */
/***********************... | the_stack |
__constant__ float kPi = 3.141592654;
__constant__ float kTwoPi = 6.283185308;
__constant__ float kEpsilon = 1.0e-10; // to prevent indeterminate cases
extern "C" {
// Device helper function to compute distances between two agents
__device__ float ComputeDistance(
float * loc_x_arr,
float * loc_y_arr,
... | the_stack |
LegionRuntime::Logger::Category log_optimizer("optimizer");
__global__
void sgd_update(size_t count, float lr, float weight_decay,
float momentum, bool nesterov,
const float* WGrad, float* V, float* W)
{
// Refernce https://pytorch.org/docs/stable/_modules/torch/optim/sgd.html#SGD
C... | the_stack |
#include "octnet/gpu/conv.h"
#include "octnet/gpu/gpu.h"
#include <cstdlib>
#include <cstdio>
#include <cstring>
template <int rdc_fcn>
__global__ void kernel_conv3x3x3(octree grid, int n_blocks, const octree grid_in, const ot_data_t* weights, const ot_data_t* bias, ot_size_t channels_out, ot_size_t channels_in) {
... | the_stack |
#include <cub/cub.cuh>
#include <cub/device/device_scan.cuh>
#include <libvis/cuda/cuda_auto_tuner.h>
#include <math_constants.h>
#include "badslam/cuda_util.cuh"
#include "badslam/surfel_projection.cuh"
#include "badslam/util_nvcc_only.cuh"
namespace vis {
template <bool downsample_color>
__global__ void CalibrateA... | the_stack |
typedef uint8_t uint8;
#define TB 128
#define DISP_MAX 256
#define BLOCK_SIZE 32
#define XDIM_MAX_THREADS 1024
#define BLOCK_D_SIZE 64
#define COLOR_DIFF(x, i, j) (abs(x[i] - x[j]))
struct postparams{
float pi1;
float pi2;
float tau_so;
float alpha1;
float sgm_q1;
float sgm_q2;
float alpha2;... | the_stack |
#include <dgl/runtime/device_api.h>
#include "../../array/cuda/dgl_cub.cuh"
#include "../../runtime/cuda/cuda_common.h"
#include "../../runtime/workspace.h"
using namespace dgl::runtime;
namespace dgl {
namespace partition {
namespace impl {
namespace {
/**
* @brief Kernel to map global element IDs to partition ID... | the_stack |
#include <assert.h>
#include <stdint.h>
#include "rxmesh/context.h"
#include "rxmesh/kernels/collective.cuh"
#include "rxmesh/kernels/loader.cuh"
#include "rxmesh/kernels/util.cuh"
#include "rxmesh/types.h"
namespace rxmesh {
template <uint32_t rowOffset,
uint32_t blockThreads,
uint32_t itemPerThr... | the_stack |
//------------------------------------------------------------------------
// Forward TensorFlow op.
struct AntialiasFwdOp : public OpKernel
{
AntialiasKernelParams m_attribs;
AntialiasFwdOp(OpKernelConstruction* ctx): OpKernel(ctx)
{
memset(&m_attribs, 0, sizeof(m_attribs));
OP_REQUIRES_O... | the_stack |
* \file
* cub::DeviceReorder provides device-wide operations for partitioning and filtering lists of items residing within global memory.
*/
#pragma once
#include <stdio.h>
#include <iterator>
#include "device_scan.cuh"
#include "block/block_partition_tiles.cuh"
#include "../grid/grid_queue.cuh"
#include "../util_... | the_stack |
using namespace ONNXPlugin;
#define cublasCheck(op) \
do { \
auto ret = (op); \
if (ret != CUBLAS_STATUS_SUCCESS) { \
INFOF("%s fail, %d != %d", #op, ret, CUBLAS_STATUS_SUCCESS); \
} \
} while (0);
__global__ void sigmoid... | the_stack |
#include <cuda_runtime.h>
#include <cvode/cvode.h> /* prototypes for CVODE fcts., consts. */
#include <sunlinsol/sunlinsol_spgmr.h> /* access to SPGMR SUNLinearSolver */
#include <sundials/sundials_types.h> /* definition of type realtype */
#include <sundials/sundials_math.h> /* definition of AB... | the_stack |
#define FULL_MASK 0xffffffff
/*
* OWN KERNELS
*/
template <unsigned int blockSize, bool nIsPow2>
__global__ void sobfu::device::reduce_data_kernel(float2 *g_idata_global, float2 *g_idata_n, float *g_odata,
unsigned int n) {
float *sdata = SharedMemory<float>();
... | the_stack |
#define IDX2(X, n1, n2, i1, i2) (X[(i2)*(n1) + (i1)])
#define IDX3(X, n1, n2, n3, i1, i2, i3) (X[(i3)*((n1)*(n2)) + (i2)*(n1) + (i1)])
#define IDX4(X, n1, n2, n3, n4, i1, i2, i3, i4) (X[(i4)*((n1)*(n2)*(n3)) + (i3)*((n1)*(n2)) + (i2)*(n1) + (i1)])
/* nnline_ker evaluate xvar with non-linear functions with control poin... | the_stack |
namespace cuml {
namespace genetic {
class GeneticProgramTest : public ::testing::Test {
public:
GeneticProgramTest()
: d_data(0, cudaStream_t(0)),
d_y(0, cudaStream_t(0)),
d_lYpred(0, cudaStream_t(0)),
d_lY(0, cudaStream_t(0)),
d_lunitW(0, cudaStream_t(0)),
d_lW(0, cudaStream_t(0)... | the_stack |
#pragma once
#include <gunrock/util/cta_work_distribution.cuh>
#include <gunrock/util/cta_work_progress.cuh>
#include <gunrock/util/kernel_runtime_stats.cuh>
#include <gunrock/oprtr/edge_map_partitioned/cta.cuh>
#include <gunrock/oprtr/advance/kernel_policy.cuh>
namespace gunrock {
namespace oprtr {
namespace edge_m... | the_stack |
#include <stdio.h>
__device__ int isinbox(real4 pos, double4 xlow, double4 xhigh)
{
if((pos.x < xlow.x)||(pos.x > xhigh.x))
return 0;
if((pos.y < xlow.y)||(pos.y > xhigh.y))
return 0;
if((pos.z < xlow.z)||(pos.z > xhigh.z))
return 0;
return 1;
}
... | the_stack |
// #define DEBUG_RESULT
namespace lightseq {
namespace cuda {
template <OperationType OpType_>
GptEncoder<OpType_>::GptEncoder(int max_batch_size, const int *p_d_token_id,
float *p_d_ppl, int *p_d_sample_id,
const GptWeight<OpType_> &tw,
... | the_stack |
#include <cuda.h>
#include "LBM.h"
const int nThreads = 32;
__device__ __forceinline__ size_t gpu_field0_index(unsigned int x, unsigned int y)
{
return NX*y+x;
}
__device__ __forceinline__ size_t gpu_scalar_index(unsigned int x, unsigned int y)
{
return NX*y+x;
}
__device__ __forceinline__ size_t gpu_field... | the_stack |
// Use 1024 threads per block, which requires cuda sm_2x or above
const int CUDA_NUM_THREADS = 512;
const int BLOCK_SIZE_LIMIT = 32768;
// CUDA: number of blocks for threads.
inline int GET_BLOCKS(const int N)
{
int ret = (N + CUDA_NUM_THREADS - 1) / CUDA_NUM_THREADS;
return (ret > BLOCK_SIZE_LIMIT) ? BLOCK_SIZE_L... | the_stack |
#include <vector>
#include <claraparabricks/genomeworks/types.hpp>
#include <claraparabricks/genomeworks/utils/cudautils.hpp>
#include <claraparabricks/genomeworks/utils/device_preallocated_allocator.cuh>
namespace claraparabricks
{
namespace genomeworks
{
TEST(TestDevicePreallocatedAllocator, allocations_do_not_ov... | the_stack |
#define BLOCK_DIM 16
#define MAX_FILTER_LENGTH 128
#define RESULT_VERIFICATION 1 // change 1 if you want to verify the result
__global__ void
convolution_kernel_v1(float *d_output, float *d_input, float *d_filter, int num_row, int num_col, int filter_size)
{
int idx_x = blockDim.x * blockIdx.x + threadIdx.x;
... | the_stack |
namespace cgbn {
template<uint32_t tpi, uint32_t limbs>
__device__ __forceinline__ bool dequals(const uint32_t sync, const uint32_t a[limbs], const uint32_t b[limbs]) {
static const uint32_t TPI_ONES=(1ull<<tpi)-1;
uint32_t group_thread=threadIdx.x & tpi-1, warp_thread=threadIdx.x & warpSize-1;
uint32_t lor, ... | the_stack |
namespace lightseq {
namespace cuda {
/**
@brief: ker_split_multilg_request
the format of request in multilingual:
e.g. <en> <de> <hello> <world> <.>
request shape: [batch_size, src_seq_len + 2]
request = numpy.concatenate((src_lang_id, trg_lang_id, src_token_id), axis=1)
@thread
gridDim.x = (nele + MAX_THREADS ... | the_stack |
void process_error(int severity, string err); // this should probably live in a utils header file
bool fh_equal_to(const float_type x, const float_type y)
{
return (((x-y) < EPSILON) && ((x-y) > -EPSILON));
}
bool fh_less(const float_type x, const float_type y)
{
return ((y-x) > EPSILON);
}
bool fh_greater(con... | the_stack |
#include <system/op_boilerplate.h>
#include <atomic>
#include <stdio.h>
#include <stdlib.h>
#include "../Workspace.h"
#include <helpers/logger.h>
#include <math/templatemath.h>
#include <cstring>
#include <exceptions/cuda_exception.h>
#include <cuda.h>
#include <cuda_runtime.h>
namespace sd {
namespace memory {
... | the_stack |
#include "dynet/dynet.h"
#include "dynet/virtual-cudnn.h"
#include "tensor-eigen.h"
#include "dynet/cudnn-ops.h"
using namespace cudnn;
namespace dynet {
CudnnConvOp::CudnnConvOp(const std::vector<unsigned>& s, const bool padding_type) {
stride_.resize(s.size());
for (unsigned i = 0; i < stride_.size(); ++i) {
... | the_stack |
#include "caffe2/utils/GpuDefs.cuh"
#include "caffe2/utils/GpuScanUtils.cuh"
#include "caffe2/utils/math.h"
#include <cuda_runtime.h>
namespace caffe2 {
// From the cutorch library
template <typename T>
struct AddOp {
__device__ __forceinline__ T operator()(T &lhs, T &rhs) {
return lhs + rhs;
}
};
template ... | the_stack |
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <sys/time.h>
#include <errno.h>
#include <mpi.h>
#include <hip/hip_runtime.h>
#include <hipblas.h>
//=============================================================================
#define ASSERT(condition) \
(void)((condition) || (a... | the_stack |
namespace hvvr {
uint32_t pixelFormatSize(PixelFormat pixelFormat) {
switch (pixelFormat) {
case PixelFormat::RGBA8_SRGB:
return 4;
case PixelFormat::RGBA16:
return 8;
case PixelFormat::RGBA32F:
return 16;
default:
assert(false);
... | the_stack |
#include <df/optimization/icp.h>
#include <df/optimization/linearSystems.h>
#include <df/util/cudaHelpers.h>
#include <df/util/debugHelpers.h>
#include <df/util/eigenHelpers.h>
#include <df/util/globalTimer.h>
#include <thrust/device_vector.h>
#include <thrust/transform.h>
#include <thrust/transform_reduce.h>
#inclu... | the_stack |
#include <rmm/cuda_stream_view.hpp>
#include <rmm/device_uvector.hpp>
#include <rmm/exec_policy.hpp>
#include <thrust/binary_search.h>
#include <thrust/copy.h>
#include <thrust/transform.h>
namespace cudf {
namespace lists {
namespace detail {
namespace {
template <typename Type>
struct has_negative_nans_fn {
colum... | the_stack |
int visited[5000];
int count[5000];
int visited_index = 0;
int nstate;
State matchstate = { Match }; /* matching state */
List l1, l2;
static int listid;
void addstate(List*, State*);
void step(List*, int, List*);
/* Compute initial state list */
List*
startlist(State *start, List *l)
{
l->n = 0;
listid++;
... | the_stack |
#include "CUFLU.h"
#if ( MODEL == HYDRO && defined DUAL_ENERGY )
// internal functions
#if ( DUAL_ENERGY == DE_ENPY && defined __CUDACC__ )
GPU_DEVICE
static real Hydro_DensPres2Entropy( const real Dens, const real Pres, const real Gamma_m1 );
GPU_DEVICE
static real Hydro_DensEntropy2Pres( const real Dens, cons... | the_stack |
__device__ __forceinline__ float atomicMin(float *address, float val)
{
int ret = __float_as_int(*address);
while(val < __int_as_float(ret))
{
int old = ret;
if((ret = atomicCAS((int *)address, old, __float_as_int(val))) == old)
break;
}
return __int_as_float(ret);
}
__device__ void min_dim_1(
... | the_stack |
#include <cuda.h>
#include <cuda_runtime.h>
namespace{
__device__ __forceinline__ float atomicMin(float* address, float val)
{
int* address_as_i = (int*) address;
int old = *address_as_i, assumed;
do {
assumed = old;
old = atomicCAS(address_as_i, assumed,
__float_as_int(fminf(v... | the_stack |
#include "flowprojection_cuda_kernel.cuh"
#include <ATen/ATen.h>
#include <ATen/NativeFunctions.h>
#include <ATen/Dispatch.h>
#include <ATen/cuda/CUDAApplyUtils.cuh>
#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... | the_stack |
///////////////////////////////////////////////////////////////////////////////////
#if (defined(_MSC_VER) && defined(_WIN64)) || defined(__LP64__)
#define __LDG_PTR "l"
#else
#define __LDG_PTR "r"
#endif
#include "cuda_helper.h"
//typedef __device_builtin__ struct ulong16 ulong16;
typedef struct __align__(32) ... | the_stack |
FEMSolver::FEMSolver(
std::string fname, bool isTetMesh, bool verbose) :
verbose_(verbose), // output verbosity
filename_(fname), // mesh file name
maxLevels_(100), // the maximum number of levels
maxIters_(100), // the maximum solve it... | the_stack |
// SelectShape.cu
// 实现形状选择算法
#include "SelectShape.h"
#include <iostream>
using namespace std;
// 宏:MAX_LABEL
// 特征值数组中标记的最大值,默认为 256。
#ifndef MAX_LABEL
#define MAX_LABEL 256
#endif
// 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y
// 定义了默认的线程块的尺寸。
#define DEF_BLOCK_X 32
#define DEF_BLOCK_Y 8
// Kernel 函数: _selectShapeByI... | 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/util/reduce_device.cuh>
#include <gunrock/app/hits/hits_problem.cuh>
namespace gunrock {
namespace app {
namespace hits {
/**... | the_stack |
#include <cuda.h>
#include <cuda_runtime.h>
#include <cuda_runtime_api.h>
#include "cuda_util.h"
#include <iostream>
#include "mat.h"
#include "convolution_cuda.h"
static __device__ inline signed char float2int8(float v)
{
int int32 = static_cast<int>(round(v));
if (int32 > 127) return 127;
if (int32 ... | the_stack |
#include <stdio.h>
#include <cutil_inline.h>
// Each block transposes/copies a tile of TILE_DIM x TILE_DIM elements
// using TILE_DIM x BLOCK_ROWS threads, so that each thread transposes
// TILE_DIM/BLOCK_ROWS elements. TILE_DIM must be an integral multiple of BLOCK_ROWS
#define TILE_DIM 32
#define BLOCK_ROWS 8
// ... | the_stack |
// Enabled to print a bunch of junk during solving
#define DEBUG_PRINT_SOLVER_INFO 0
#include "WarpingSolverParameters.h"
#include "WarpingSolverState.h"
#include "WarpingSolverUtil.h"
#include "WarpingSolverEquations.h"
#include <assert.h>
#include <stdio.h>
#include <stdint.h>
#include "CUDATimer.h"
#ifdef _WIN32... | the_stack |
#include <torch/types.h>
#include <ATen/ATen.h>
#include <ATen/AccumulateType.h>
#include <ATen/cuda/CUDAContext.h>
#include <ATen/cuda/CUDAApplyUtils.cuh>
#include <cuda.h>
#include <cuda_runtime.h>
#include <curand.h>
#include <curand_kernel.h>
#include <time.h>
//#include <pybind11/numpy.h>
#include <pybind11/pyb... | the_stack |
#include "common.h"
#include "dispatch.h"
#include "so3.h"
#include "rxso3.h"
#include "se3.h"
#include "sim3.h"
#define GPU_1D_KERNEL_LOOP(i, n) \
for (size_t i = blockIdx.x * blockDim.x + threadIdx.x; i<n; i += blockDim.x * gridDim.x)
#define NUM_THREADS 256
#define NUM_BLOCKS(batch_size) ((batch_size + NUM_THRE... | the_stack |
#include "cudakernel/nn/resize.h"
#include "ppl/common/types.h"
struct half8_ {
half x0;
half y0;
half z0;
half w0;
half x1;
half y1;
half z1;
half w1;
};
static inline __device__ float cudaComputeSourceIndexCubic(
float scale,
int dstIndex)
{
float srcIdx = scale * (dstInd... | the_stack |
#include <cmath>
#include <vector>
#include <ATen/ATen.h>
#include <ATen/cuda/CUDAApplyUtils.cuh> // at::cuda::getApplyGrid
#include <THC/THC.h>
#define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
#define CHECK_CONTIGUOUS(x) AT_CHECK(x.is_contiguous(), #x " must be contiguous")
#define CH... | the_stack |
#include "gpuTopo.h"
#include <isce3/core/Basis.h>
#include <isce3/core/DenseMatrix.h>
#include <isce3/core/Ellipsoid.h>
#include <isce3/core/LookSide.h>
#include <isce3/core/Pixel.h>
#include <isce3/error/ErrorCode.h>
#include <isce3/geometry/TopoLayers.h>
// isce3::cuda::core
#include <isce3/cuda/core/Orbit.h>
#inc... | the_stack |
#include "operator/jet_vector.h"
#include "operator/jet_vector_math_impl.cuh"
namespace MegBA {
namespace math {
namespace impl {
inline std::array<dim3, 2> fitGridAndBlock(const unsigned int nItem) {
std::array<dim3, 2> gridAndDim;
if (nItem < 256) {
gridAndDim[1] = dim3(nItem);
gridAndDim[0] = dim3(1);
... | the_stack |
#include "util.cuh"
#include "embedding.h"
// Memory & time efficient implementation of embedding score functions
// Much of the code is adapted from GraphVite
// https://github.com/DeepGraphLearning/graphvite
namespace at {
template <class scalar_t>
__global__
void transe_forward_out_cuda(const scalar_t *entity, co... | the_stack |
#include <stdio.h>
#include <math.h>
#include <curand.h>
#include <thrust/sort.h>
#include "helper_math.h"
#include "math_constants.h"
#include "kernel.cuh"
#include "shared_variables.cuh"
//#define X_BOUNDARY 7.f
//#define X_BOUNDARY 50.f
//#define Z_BOUNDARY 50.f
//#define
#define EPS 0.001f
////////////// fluid... | the_stack |
#include <type_traits> //std::remove_cv
namespace xlib {
#define Load_MACRO(CACHE_MOD, ptx_modifier) \
\
template<> \
__device__ __forc... | the_stack |
// Warp reduce kernels to reduce N groups of data into N numbers, where N = warpSize / width.
// width should be a power of 2 and should be less than warpSize.
template <typename scalar_t>
__device__ __forceinline__ scalar_t warpReduce(scalar_t x, int width=C10_WARP_SIZE){
for (unsigned offset = width/2; offset... | the_stack |
namespace arboretum_test {
TEST(SingleNodeHistSumFloatBin16, Naive) {
const size_t size = 1 << 5;
thrust::device_vector<float> grad(size);
thrust::device_vector<float> sum(size, 0.0);
thrust::device_vector<unsigned> count(size, 0);
thrust::device_vector<unsigned short> bin(size);
thrust::device_vector<unsi... | the_stack |
namespace sd {
namespace ops {
namespace helpers {
static SD_INLINE SD_HOST_DEVICE sd::LongType boundsAmp(sd::LongType const low, sd::LongType const high,
sd::LongType const value) {
if (high < value) return high;
if (value < low) return low;
return value;
}... | the_stack |
namespace cupoch {
namespace geometry {
namespace {
std::pair<float, float> TangentMinMax(float min_angle, float max_angle) {
float min_angle_tan = tan(min_angle);
float max_angle_tan = tan(max_angle);
// Correct sign of tan around singularity points
if (min_angle_tan < 0.0) min_angle_tan = -min_angle... | the_stack |
* Test of iterator utilities
******************************************************************************/
// Ensure printing of CUDA runtime errors to console
#define CUB_STDERR
#include <iterator>
#include <stdio.h>
#include <typeinfo>
#include <cub/iterator/arg_index_input_iterator.cuh>
#include <cub/iterator/... | the_stack |
#define AS_U32(addr) *((uint32_t*)(addr))
#define AS_UINT2(addr) *((uint2*)(addr))
#define AS_UINT4(addr) *((uint4*)(addr))
#define AS_UL2(addr) *((ulonglong2*)(addr))
#define t_fn0(x) (sharedMemory[x])
#define t_fn1(x) (sharedMemory[0x100U | (x)])
#define t_fn2(x) (sharedMemory[0x200U | (x)])
#define t_fn3(x) (shared... | the_stack |
namespace SCAMP {
/////////////////////////////////////////////////////////////////////////////////////
// THESE HEADERS DEFINE COMPUTE STRATEGIES USED TO COMPUTE VARIOUS
// PROFILE TYPES
///////////////////////////////////////////////////////////////////////////////////
#include "kernels_compute.h"
#include ... | the_stack |
#include "unit_test.h"
#include "matrix.h"
#include "csr_multiply.h"
namespace amgx
{
DECLARE_UNITTEST_BEGIN(CsrSparsityTests_Base);
std::string base_keywords()
{
return "csr";
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template< ty... | the_stack |
#pragma once
#include <gunrock/app/problem_base.cuh>
#include <gunrock/app/louvain/louvain_test.cuh>
namespace gunrock {
namespace app {
namespace louvain {
/**
* @brief Speciflying parameters for Louvain Problem
* @param parameters The util::Parameter<...> structure holding all parameter
* info \return cudaErr... | 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__
ScoreT4<ScoreT>
... | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.