text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
extern "C" { #include "sph/sph_blake.h" #include "sph/sph_bmw.h" #include "sph/sph_groestl.h" #include "sph/sph_skein.h" #include "sph/sph_jh.h" #include "sph/sph_keccak.h" #include "sph/sph_luffa.h" #include "sph/sph_cubehash.h" #include "sph/sph_shavite.h" #include "sph/sph_simd.h" #include "sph/sph_echo.h" #includ...
the_stack
* \test Tests the two-dimensional FFT routines. **/ #include <iostream> #include <vector> #include <cmath> #include <complex> #include <algorithm> //#define VIENNACL_BUILD_INFO #include "viennacl/linalg/host_based/fft_operations.hpp" #ifdef VIENNACL_WITH_OPENCL #include "viennacl/linalg/opencl/fft_operations.hpp" ...
the_stack
using namespace megdnn; using namespace cuda; using namespace local_share; namespace { template <int unroll_ci_, int unroll_co_, int unroll_n_> struct UnrollConfig { static int const unroll_ci = unroll_ci_; static int const unroll_co = unroll_co_; static int const unroll_n = unroll_n_; }; template <int th...
the_stack
* See: https://www.piday.org/million/ */ #include "MonteCarloPi.h" #include <algorithm> #define CUDA_DRIVER_API #include <helper_cuda.h> #include <iostream> #define ROUND_UP_TO_GRANULARITY(x, n) (((x + n - 1) / n) * n) // `ipcHandleTypeFlag` specifies the platform specific handle type this sample // uses for import...
the_stack
#include <float.h> #include "hitables/bvh.h" #include "hitables/sphere.h" #include "hitables/movingsphere.h" #include "hitables/hitablelist.h" #include "materials/material.h" #include "materials/texture.h" #include "util/randomgenerator.h" #include "util/common.h" #ifdef CUDA_ENABLED CUDA_GLOBAL void simpleScene(...
the_stack
extern "C" { #include <sph/sph_blake.h> } /* threads per block */ #define TPB 768 #define NPT 192 #define maxResults 16 /* max count of found nonces in one call */ #define NBN 2 /* hash by cpu with blake 256 */ extern "C" void decred_hash(void *output, const void *input){ sph_blake256_context ctx; sph_blake256_set...
the_stack
void kernel_driver_aa(std::string filename, std::vector<std::string> &reads, std::vector<std::string> &contigs, short h_scoring_matrix[], short openGap, short extendGap) { unsigned maxContigSize = getMaxLength(contigs); unsigned maxReadSize = getMaxLength(reads); unsigned totalAlignments =...
the_stack
#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
#include "k2/csrc/array_ops.h" #include "k2/csrc/context.h" #include "k2/csrc/device_guard.h" #include "k2/csrc/fsa_algo.h" #include "k2/csrc/fsa_utils.h" #include "k2/csrc/thread_pool.h" namespace k2 { class Connector { public: /** Connector object. You should call Connect() after constructing it. Ple...
the_stack
#include <Core/CUDA/CUDAPCISPHSolver3.hpp> #include <Core/CUDA/CUDASPHKernels3.hpp> #include <thrust/extrema.h> using namespace CubbyFlow; namespace { class InitializeBuffersAndComputeForces { public: inline InitializeBuffersAndComputeForces( float m, float h, float4 gravity, float viscosity, co...
the_stack
* \file * dnn/src/cuda/convolution_helper/block_tile_consumer/iconv_imma_block_consumer.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 distribu...
the_stack
// The Ray Tracing in One Weekend scene. // See https://github.com/raytracing/InOneWeekend/releases/ for this free book. // public owl API #include <owl/owl.h> // our device-side data structures #include "GeomTypes.h" // external helper stuff for image output #define STB_IMAGE_WRITE_IMPLEMENTATION #include "stb/stb_im...
the_stack
typedef unsigned char BYTE; typedef unsigned int WORD; typedef unsigned long long LONG; #define BLAKE2B_ROUNDS 12 #define BLAKE2B_BLOCK_LENGTH 128 #define BLAKE2B_CHAIN_SIZE 8 #define BLAKE2B_CHAIN_LENGTH (BLAKE2B_CHAIN_SIZE * sizeof(int64_t)) #define BLAKE2B_STATE_SIZE 16 #define BLAKE2B_STATE_LENGTH (BLAKE2B_STATE_...
the_stack
#include <cuda.h> #include <cuda_runtime.h> #define eps 1e-15 // for the older gpus atomicAdd with double arguments does not exist #if __CUDA_ARCH__ < 600 and defined(__CUDA_ARCH__) static __inline__ __device__ double atomicAdd(double* address, double val) { unsigned long long int* address_as_ull = (unsigned long l...
the_stack
#define at(A, r, c, ch) A[(r)*A##_step + (c)*CH + (ch)] #define AB_BITS 10 #define AB_SCALE (1 << AB_BITS) #define INTER_BITS 5 #define INTER_TAB_SIZE (1 << INTER_BITS) #define INTER_REMAP_COEF_BITS 15 #define INTER_REMAP_COEF_SCALE (1 << INTER_REMAP_COEF_BITS) #...
the_stack
#ifdef _WIN32 #include <windows.h> #include <process.h> const char *empty = ""; const char *_COLOR_GREEN (bool suppress_color) { if (!suppress_color) { HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hStdout, FOREGROUND_GREEN | FOREGROUND_INTENSITY); } return e...
the_stack
//-------------------------------------------------------------------------------- // // 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 retain the above copyright notice, this ...
the_stack
#include "cupoch/camera/pinhole_camera_intrinsic.h" #include "cupoch/geometry/boundingvolume.h" #include "cupoch/geometry/geometry_utils.h" #include "cupoch/geometry/image.h" #include "cupoch/geometry/kdtree_flann.h" #include "cupoch/geometry/pointcloud.h" #include "cupoch/utility/console.h" #include "cupoch/utility/he...
the_stack
#include "unit_test.h" #include "matrix.h" #include "csr_multiply.h" #include "matrix_coloring/matrix_coloring.h" namespace amgx { DECLARE_UNITTEST_BEGIN(CsrSparsityILU1Tests_Base); std::string base_keywords() { return "csr"; } ////////////////////////////////////////////////////////////////////////////////////...
the_stack
#include <cuda.h> #include <cub/util_allocator.cuh> #include <algorithm> #include "sharedmem.cuh" using namespace std; using namespace cub; #define NUM_ELEM_PT 16 #define NUM_ELEM_BITSHIFT 4 //#define K 32 //#define KLog2 5 #define ORDERV(x,a,b) { bool swap = reverse ^ (x[a]<x[b]); \ T auxa = x[a]; \ i...
the_stack
/****************************************************************************** * 1D_scalar routines ******************************************************************************/ #pragma once #include <gunrock/oprtr/1D_oprtr/for_all.cuh> #include <gunrock/oprtr/1D_oprtr/for_each.cuh> namespace gunrock { namespace...
the_stack
#include "camera_calibration/bundle_adjustment/cuda_joint_optimization.cuh" #include <cub/cub.cuh> #include <cuda_runtime.h> #include <libvis/cuda/cuda_auto_tuner.h> #include <libvis/cuda/cuda_util.h> #include <math_constants.h> #include "camera_calibration/bundle_adjustment/joint_optimization_jacobians.h" #include "...
the_stack
#include <ops/declarable/helpers/convolutions.h> #include "cudnnUtils.h" namespace sd { namespace ops { namespace platforms { ////////////////////////////////////////////////////////////////////////// static void conv2dCUDNN(const LaunchContext* context, const NDArray* input, const NDArray* weights, const NDArray* b...
the_stack
#include <thrust/iterator/counting_iterator.h> #include <cstring> #include <algorithm> #include <exception> #include <cstdio> #include <cstdlib> #include "algorithm.hpp" #include "iterator.hpp" #include "memory.hpp" #include "query/time_series_aggregate.h" #include "concurrent_unordered_map.hpp" #include "utils.hpp" C...
the_stack
#include <Eigen/Dense> #include <limits> #include "cupoch/camera/pinhole_camera_intrinsic.h" #include "cupoch/geometry/image.h" #include "cupoch/geometry/laserscanbuffer.h" #include "cupoch/geometry/occupancygrid.h" #include "cupoch/geometry/pointcloud.h" #include "cupoch/geometry/rgbdimage.h" #include "cupoch/utility...
the_stack
#include "RGBDOdometryCudaDevice.cuh" #include <Cuda/Common/ReductionCuda.h> #include <math_constants.h> namespace open3d { namespace cuda { template<size_t N> __global__ void DoSingleIterationKernel(RGBDOdometryCudaDevice<N> odometry, size_t level) { /** Add more memory blocks if we have **/ /** TODO: check t...
the_stack
#include <logger.h> #include <amgx_types/util.h> using namespace std; namespace amgx { namespace block_jacobi_solver { template <typename ValueTypeA, typename ValueTypeB> struct jacobi_presmooth_functor { double omega; jacobi_presmooth_functor( double omega ) : omega( omega ) {} __host__ __device__ Value...
the_stack
#include <kat/on_device/common.cuh> ///@cond #include <kat/detail/execution_space_specifiers.hpp> ///@endcond #include <cassert> namespace kat { /** * A richer (kind-of-a-)wrapper for CUDA's `dim3` class, used * to specify dimensions for blocks and grid (up to 3 dimensions). * * @note same as `cuda::dimensions_...
the_stack
#include <thrust/device_ptr.h> #include <thrust/scan.h> #include <cuComplex.h> #include "../cuspreadinterp.h" #include "../memtransfer.h" using namespace std; int CUFINUFFT_SPREAD1D(int nf1, CUCPX* d_fw, int M, FLT *d_kx, CUCPX *d_c, CUFINUFFT_PLAN d_plan) /* This c function is written for only doing 1D spreading...
the_stack
namespace anakin{ namespace saber{ const int BLOCK_SIZE = 32; template <typename dtype> __global__ void concat_impl_cuda(const int nthreads, const dtype* in_data, const int num_concats, const int concat_size, const int top_concat_axis, const int bottom_concat_a...
the_stack
#include "HugeCTR/include/embeddings/hybrid_embedding/data.hpp" #include "HugeCTR/include/embeddings/hybrid_embedding/frequent_embedding.hpp" #include "HugeCTR/include/embeddings/hybrid_embedding/infrequent_embedding.hpp" #include "HugeCTR/include/embeddings/hybrid_embedding/model.hpp" #include "hybrid_embedding_cpu.hp...
the_stack
__global__ void kernel_baseToNumber(char *reads, const long length) { long index = blockIdx.x * blockDim.x + threadIdx.x; while (index < length) { switch (reads[index]) { case 'A': reads[index] = 0; break; case 'a': reads[index] = 0; break; case 'C': rea...
the_stack
* bisection. */ // includes, system #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include <float.h> // includes, project #include "cutil_inline.h" #include "config.h" #include "structs.h" #include "matlab.h" #include "util.h" #include "gerschgorin.h" #include "bisect_small.cuh" #inc...
the_stack
#include <stdio.h> #include <stdlib.h> #include <memory> #include <iostream> #include <cassert> #include <cuda.h> #include "helper_math.h" #include "main.h" #include "shrUtils.h" // Inline device function to convert 32-bit unsigned integer to floating point rgba color //***********************************************...
the_stack
#include <nvbench/create.cuh> #include <nvbench/type_list.cuh> #include "test_asserts.cuh" #include <fmt/format.h> //============================================================================== // Declare a couple benchmarks for testing: void DummyBench(nvbench::state &state) { state.skip("Skipping for testing.");...
the_stack
__device__ __constant__ real psifnb[22] = { 1.f,-.5f,.166666666666666667f, -.0333333333333333333f,.0238095238095238095f, -.0333333333333333333f,.0757575757575757576f, -.253113553113553114f,1.16666666666666667f,-7.09215686274509804f, 54.9711779448621554f,-529.124242424242424f,6192.1231884057971f, ...
the_stack
#include "Image.h" #include <iostream> #include <fstream> using namespace std; #include "ErrorCode.h" // Host 静态方法:newImage(创建图像) __host__ int ImageBasicOp::newImage(Image **outimg) { ImageCuda *resimgCud; // 对应于返回的 outimg 的 ImageCuda 型数据。 // 检查装载输出图像的指针是否为 NULL。 if (outimg == NULL) return NUL...
the_stack
#include <thrust/sort.h> //headers in local files #include "lidar_point_pillars/postprocess_cuda.h" __global__ void filter_kernel(const float* box_preds, const float* cls_preds, const float* dir_preds, const int* anchor_mask, const float* dev_anchors_px, const float* dev_anchors_py, cons...
the_stack
#include "imageProcessingGPUUtils.hpp" #include "backend/common/imageOps.hpp" #include "gpu/image/sampling.hpp" #include "gpu/image/imageOps.hpp" #include "gpu/image/blur.hpp" #include "cuda/util.hpp" #include "backend/cuda/deviceBuffer.hpp" #include "backend/cuda/deviceStream.hpp" #define INVALID_VALUE Image::RGBA::...
the_stack
#include <ops/declarable/helpers/BarnesHutTsne.h> namespace sd { namespace ops { namespace helpers { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // count rows kernel - count input pRows and pCols and put result onto pRowCounts // pRowCounts -...
the_stack
#include <shrUtils.h> #include <cutil_inline.h> // includes cuda.h and cuda_runtime_api.h #include <cutil_math.h> texture<float, 2> tex; texture<uchar4, 2, cudaReadModeNormalizedFloat> rgbaTex; cudaArray* d_array, *d_tempArray; /* Perform a fast box filter using the sliding window method. As the kernel m...
the_stack
#pragma once #include <cub/cub.cuh> template<int NUM_WARPS> class BlockWorkAssignmentBase { protected: static constexpr int NUM_THREADS = NUM_WARPS * WARP_SIZE; public: typedef cub::BlockScan<int, NUM_THREADS> SimpleScanT; protected: __device__ static void computeOffsets(int* work_sum, SimpleScanT:...
the_stack
#include <math.h> #include <stdio.h> #include <stdlib.h> #include "cublas_v2.h" #include "settings.h" #define MAX_SENTENCE_CHUNK 128 struct CudaStorageInner { cublasHandle_t* handle; cudaStream_t stream_data; }; void AssertCudaSuccess(cudaError_t stat, const char* message) { if (stat != cudaSuccess) { f...
the_stack
#include <ATen/ATen.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <ATen/cuda/CUDAApplyUtils.cuh> #include <stdio.h> #include <float.h> #include <math.h> using namespace at; // TODO make it in a common file #define CUDA_KERNEL_LOOP_X(i, n) \ for (int i = blockI...
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 updateA(int rowsA, int colsA, int pitchA, const float* d_Xx, const float* d_Xy, const float* d_Xz, c...
the_stack
#include <thrust/sequence.h> #include "impl.cuh" namespace { using namespace manifold; constexpr uint32_t kNoCode = 0xFFFFFFFFu; struct Extrema : public thrust::binary_function<Halfedge, Halfedge, Halfedge> { __host__ __device__ void MakeForward(Halfedge& a) { if (!a.IsForward()) { int tmp = a.startVert...
the_stack
#pragma once #include <gunrock/app/problem_base.cuh> namespace gunrock { namespace app { namespace vn { /** * @brief Speciflying parameters for VN Problem * @param parameters The util::Parameter<...> structure holding all parameter * info \return cudaError_t error message(s), if any */ cudaError_t UseParameter...
the_stack
#ifndef CPU_ONLY void Hamiltonian::initialize_gpu(Model& model) { n = model.number_of_atoms; max_neighbor = model.max_neighbor; energy_max = model.energy_max; grid_size = (model.number_of_atoms - 1) / BLOCK_SIZE + 1; CHECK(cudaMalloc((void**)&neighbor_number, sizeof(int) * n)); CHECK(cudaMalloc((void**)&ne...
the_stack
namespace TextEntity { void Objective::generate_labels( const EntityIdxType* const labels, const size_t num_labels, const size_t num_negative_labels, std::vector<EntityIdxType>* const instance_entities, RNG* const rng) const { PROFILE_FUNCTION(); CHECK(instance_entities...
the_stack
#ifndef ONEFLOW_CORE_KERNEL_UTIL_NUMERICS_H #define ONEFLOW_CORE_KERNEL_UTIL_NUMERICS_H #pragma once #include <limits.h> #include <math.h> #include <float.h> #include <cstdlib> #include <assert.h> #include "oneflow/core/device/cuda_util.h" #include "oneflow/core/framework/framework.h" #include "oneflow/core/kernel/ut...
the_stack
#include "nnnormalizelp.hpp" #include "impl/dispatcher.hpp" #include <iostream> #include <algorithm> #include <cmath> #include <cassert> #include <cstring> using namespace vl ; using namespace vl::nn ; using namespace vl::impl ; template<vl::DeviceType deviceType, vl::DataType dataType> struct NormalizeLpForward ; te...
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_HIP(call) do { \ hipError_t status = call; \ if( status != hipSuccess ) { \ fprintf(stderr, "HIP Error at line %d in %s: %s\n", __LINE__, __FILE__, hipGetErrorString(status)); \ exit((...
the_stack
THC_API void THCTensor_(calculateMode)(THCState *state, THCTensor *values, THCudaLongTensor *indices, THCTensor *input, THCudaLongStorage *sortBuffer, ...
the_stack
#include "kernels.h" #include <cooperative_groups.h> namespace cg = cooperative_groups; curandStatePhilox4_32_10_t *curandstate; /** * @brief element-wise activation function on device, like Relu, Gelu * * @tparam enum class ActivationType, kRelu, kGelu * @tparam input type * @param any shape of...
the_stack
#include "nnbnorm.hpp" #include "datacu.hpp" #include "impl/cudnnhelper.hpp" #include "impl/copy.hpp" #include <cassert> using namespace std ; using namespace vl ; using namespace vl::nn ; using namespace vl::impl ; #define CHECK(x) \ { \ cudnnError = x ; \ if (cudnnError != CUDNN_STATUS_SUCCESS) { \ error = op.conte...
the_stack
//#define MIN(x,y) (((x)>(y))?(y):(x)) #define MAX(x,y) (((x)>(y))?(x):(y)) #include "ssids/gpu/kernels/dtrsv.h" #define TRSM_TR_NBX 256 #define TRSM_TR_NBY 32 #define TRSM_TR_THREADSX 32 #define TRSM_TR_THREADSY 4 #define REDUCING_D_SOLVE_THREADS_PER_BLOCK 256 #define SCATTER_NB 256 #define GEMV_NX 32 #define GEMV_N...
the_stack
#pragma once #include <math.h> #include <time.h> #include <list> #include <random> #include <gunrock/graphio/utils.cuh> #include <gunrock/util/sort_omp.cuh> #include <gunrock/util/parameters.h> #include <gunrock/util/test_utils.h> namespace gunrock { namespace graphio { namespace rgg { typedef std::mt19937 Engine; t...
the_stack
/** \addtogroup cudpp_app * */ #include <cstdlib> #include <cstdio> #include <assert.h> #include "cuda_util.h" #include "cudpp.h" #include "cudpp_util.h" #include "cudpp_plan.h" #include "cudpp_globals.h" #include "kernel/spmvmult_kernel.cuh" extern "C" void cudppSegmentedScanDispatch (void *d_...
the_stack
#include <thrust/device_ptr.h> #include <thrust/logical.h> #include <thrust/reduce.h> #include <thrust/scan.h> #include "gtn/cuda/cuda.h" #include "gtn/hd_span.h" #include "gtn/cuda/functions.h" using namespace gtn::detail; namespace gtn { namespace cuda { namespace detail { namespace { typedef Graph::SharedGraph...
the_stack
#define RUN(TYPE, DIMS, REAL) \ THCudaTensor_gatherKernel<TYPE, REAL, DIMS> \ <<<grid, block, 0, THCState_getCurrentStream(state)>>>( \ tensorInfo, srcInfo, indexInfo, dim, (TYPE)totalElements); void THCTensor_(gather)(THCSt...
the_stack
#include <stdio.h> #include <iomanip> #include <thrust/extrema.h> #include "cm.h" using namespace std; //thrust::device_vector<unsigned char> scratch; bool phase_copy = 0; map<string, unsigned int> cnt_counts; string curr_file; map<string,bool> min_max_eq; template<typename T> struct type_to_int64 { const T *sourc...
the_stack
#include "../config.cuh" #include "../util_namespace.cuh" #include "dispatch/dispatch_merge_sort.cuh" CUB_NAMESPACE_BEGIN /** * @brief DeviceMergeSort provides device-wide, parallel operations for * computing a merge sort across a sequence of data items residing within * device-accessible memory. *...
the_stack
namespace vilib { static void harris_gpu_find_best_params(const int & cols, int & threadX, int & threadY) { int t_best = 128; for(int t=t_best,idle_threads_best = t_best;t>16;t>>=1) { int idle_threads_now = ((cols + t-1)/t)*t - col...
the_stack
#include <gtest/gtest.h> #include "serac/serac_config.hpp" #include "serac/numerics/mesh_utils_base.hpp" #include "serac/physics/utilities/quadrature_data.hpp" #include "serac/physics/utilities/state_manager.hpp" #include "serac/physics/utilities/functional/functional.hpp" using namespace serac; template <typename T...
the_stack
#include <gtest/gtest.h> #include <isce3/cuda/core/Interp1d.h> #include <isce3/cuda/core/Kernels.h> #include <isce3/cuda/except/Error.h> #include <isce3/except/Error.h> #include <isce3/math/Sinc.h> using namespace isce3::cuda::core; using namespace isce3::except; using thrust::complex; // Adapted from julia code at...
the_stack
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is d...
the_stack
// Copyright 2015-2019 Johns Hopkins University (author: Daniel Povey) // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // THIS CODE I...
the_stack
#include <cub/block/block_reduce.cuh> #include <cub/cub.cuh> #include "caffe2/core/context_gpu.h" #include "caffe2/utils/conversions.h" #include "caffe2/utils/math.h" #if THRUST_VERSION >= 100800 #define THRUST_SUPPORTS_PER_THREAD #endif // THRUST_VERSION >= 100800 namespace caffe2 { namespace math { #define DELEG...
the_stack
* \brief Implements PME force gathering in CUDA. * * \author Aleksei Iupinov <a.yupinov@gmail.com> */ #include "gmxpre.h" #include <cassert> #include "gromacs/gpu_utils/cuda_kernel_utils.cuh" #include "gromacs/gpu_utils/typecasts.cuh" #include "pme.cuh" #include "pme_gpu_calculate_splines.cuh" #include "pme_gr...
the_stack
#include <nvector/nvector_cuda.h> #include "VectorArrayKernels.cuh" #include "VectorKernels.cuh" #include "sundials_cuda.h" #include "sundials_debug.h" #define ZERO RCONST(0.0) #define HALF RCONST(0.5) extern "C" { using namespace sundials; using namespace sundials::cuda; using namespace sundials::nvector_cuda; /*...
the_stack
#pragma once #include <iostream> #include <gunrock/app/problem_base.cuh> namespace gunrock { namespace app { namespace bc { /** * @brief Speciflying parameters for BC Problem * @param parameters The util::Parameter<...> structure holding all parameter * info \return cudaError_t error message(s), if any */ cud...
the_stack
typedef unsigned int uint_t; /* native unsigned integer */ #define SKEIN_MODIFIER_WORDS ( 2) /* number of modifier (tweak) words */ #define SKEIN_256_STATE_WORDS ( 4) #define SKEIN_512_STATE_WORDS ( 8) #define SKEIN1024_STATE_WORDS (16) #define SKEIN_256_STATE_BYTES ( 8*SKEIN_256_STATE_WORDS...
the_stack
#include <cuda_runtime.h> #include <cuda_runtime_api.h> #include <device_launch_parameters.h> #include "ssids/gpu/kernels/datatypes.h" #include "cuda/cuda_check.h" #define min(x,y) ((x) < (y) ? (x) : (y)) #define BLOCK_SIZE 8 #define MAX_CUDA_BLOCKS 65535 //#define SM_3X (__CUDA_ARCH__ == 300 || __CUDA_ARCH__ == 35...
the_stack
#ifndef DALI_KERNELS_REDUCE_MEAN_STDDEV_GPU_IMPL_CUH_ #define DALI_KERNELS_REDUCE_MEAN_STDDEV_GPU_IMPL_CUH_ /** * @file * * This file contains the classes needed to implement reductions with pre- * and postprocessing: mean, root mean square, standard deviation (and its reciprocal). */ #include "dali/kernels/redu...
the_stack
#include <df/util/cudaHelpers.h> #include <df/util/macros.h> #include <df/voxel/color.h> #include <df/voxel/probability.h> #include <df/voxel/compositeVoxel.h> #include <df/voxel/tsdf.h> // TODO #include <Eigen/Geometry> namespace df { // TODO: maybe one thread per vertex, do a full-bandwidth read, // compute norma...
the_stack
#include "SmallestDirRect.h" #include "CoordiSet.h" #include <cmath> #include <iostream> #include <stdio.h> using namespace std; // 宏:SDR_BLOCKSIZE // 定义了核函数线程块的大小。 #define DEF_BLOCK_1D 512 // 宏:SDR_LARGE_ENOUGH // 定义了一个足够大的正整数,该整数在使用过程中被认为是无穷大。 #define SDR_LARGE_ENOUGH ((1 << 30) - 1) // 宏:SDR_DEBUG_KERNEL_PRINT(K...
the_stack
#include <stdio.h> #include <map> #include <algorithm> #include <unistd.h> // usleep #include <ctype.h> // tolower #include "cuda_helper.h" #include "salsa_kernel.h" #include "nv_kernel2.h" #include "titan_kernel.h" #include "nv_kernel.h" #include "kepler_kernel.h" #include "fermi_kernel.h" #include "test_kernel.h" ...
the_stack
#include <THC/THC.h> #include <THC/THCAtomics.cuh> #include <THC/THCDeviceUtils.cuh> #include <cuda.h> #include <cuda_runtime.h> #include <cfloat> #include <iostream> using std::cout; using std::endl; #define BLOCKSIZE 512 // TODO: // at::numeric_limits<scalar_t>::lowest; // implement like pytorch-softmax: two k...
the_stack
namespace paddle { namespace lite { namespace kernels { namespace cuda { template <typename Dtype> __global__ void topk_avg_pooling_kernel_by_row_improve( Dtype *output_data, const Dtype *input, const int *gpu_input_offset_l, const int *gpu_input_offset_r, const int row_max, const int col_max, ...
the_stack
#include <glog/logging.h> #include <cmath> #include <iostream> #include <vector> namespace dietgpu { template <FloatType FT, int Threads> struct JoinFloatNonAligned { static __device__ void join( const typename FloatTypeInfo<FT>::CompT* __restrict__ compIn, const typename FloatTypeInfo<FT>::NonCompT* __...
the_stack
* This sample implements a conjugate gradient solver on GPU using * Multi Block Cooperative Groups, also uses Unified Memory. * */ // includes, system #include <stdio.h> #include <stdlib.h> #include <string.h> #include <cuda_runtime.h> // Utilities and system includes #include <helper_cuda.h> // helper function ...
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 "../Observers/ColorHelpers.cu" extern "C" { __device__ float activationProbability(float x, flo...
the_stack
#if defined(THC_REAL_IS_HALF) #define _REAL(val) THC_float2half(val) #else #define _REAL(val) (val) #endif static int nn_(StepGRU_updateOutput)(lua_State *L) { THCState *state = getCudaState(L); THCTensor *weight = (THCTensor *)luaT_checkudata(L, 1, torch_Tensor); THCTensor *bias = (THCTensor *)luaT_checkudata(L...
the_stack
#define THREADS_PER_BLOCK 16 #define DIVUP(m, n) ((m) / (n) + ((m) % (n) > 0)) // int THREADS_PER_BLOCK_NMS = sizeof(unsigned long long) * 8 // #define DEBUG const float EPS = 1e-8; struct Point { float x, y; __device__ Point() {} __device__ Point(double _x, double _y){ x = _x, y = _y; } ...
the_stack
#include "dragon/core/context_cuda.h" #include "dragon/utils/math_functions.h" #include "dragon/utils/op_kernels.h" namespace dragon { namespace kernels { namespace { #define LDG(x, i) convert::To<AccT>(__ldg(x + i)) template <typename T, typename AccT> __global__ void _AvgPool2dNCHW( const int nthreads, c...
the_stack
// external functions and GPU-related set-up #ifdef __CUDACC__ #include "CUAPI.h" #include "CUFLU_Shared_FluUtility.cu" #include "CUDA_ConstMemory.h" #endif // #ifdef __CUDACC__ // local function prototypes #ifndef __CUDACC__ void Src_SetAuxArray_User_Template( double [], int [] ); void Src_SetConstMemory_User_Tem...
the_stack
namespace apollo { namespace perception { namespace inference { // Decode bbox. // boxes dims: [num_box, 4], deltas dims: [N, num_box, C, 4], // out_boxes dims: [N, num_box, C, 4] // nthreads = N * num_box * C __global__ void bbox_transform_inv_kernel( const int nthreads, const float *boxes, const float *deltas, ...
the_stack
#include <stdio.h> #include <iostream> #include <vector> #include <time.h> #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; \ } \ ...
the_stack
* \file * cub::BlockHistogramTilesSort implements a stateful abstraction of CUDA thread blocks for histogramming multiple tiles as part of device-wide histogram using local sorting */ #pragma once #include <iterator> #include "../../../block/block_radix_sort.cuh" #include "../../../block/block_discontinuity.cuh" #...
the_stack
#include <nvidia/helper_cuda.h> #include <cudaPcl/cudaSphereHelpers.h> #define BLOCK_WIDTH 16 #define BLOCK_SIZE BLOCK_WIDTH*BLOCK_WIDTH // step size of the normals // for PointXYZI #define X_STEP 8 #define X_OFFSET 0 // for PointXYZ //#define X_STEP 4 //#define X_OFFSET 0 // TODO: try to copy the points in the tan...
the_stack
#define LBANN_BATCH_NORMALIZATION_LAYER_INSTANTIATE #include "lbann/comm_impl.hpp" #include "lbann/layers/regularizers/batch_normalization.hpp" #include "lbann/weights/weights_helpers.hpp" #include "lbann/utils/gpu/helpers.hpp" namespace lbann { namespace { /** Functor for adding arrays. */ template <typename T, siz...
the_stack
#include "cuda_helper.h" uint32_t *d_gnounce[MAX_GPUS]; uint32_t *d_GNonce[MAX_GPUS]; //__constant__ uint32_t pTarget[8]; #define C32e(x) \ ((SPH_C32(x) >> 24) \ | ((SPH_C32(x) >> 8) & SPH_C32(0x0000FF00)) \ | ((SPH_C32(x) << 8) & SPH_C32(0x00FF0000)) \ | ((SPH_C32(x) << 24) & SPH_C32(0xFF000000))) #define ...
the_stack
#include "caffe/layers/pooling_layer.hpp" #include "caffe/util/math_functions.hpp" namespace caffe { template<typename Dtype, typename MItype, typename MOtype> void PoolingLayer<Dtype, MItype, MOtype>::GenerateProgram() { this->device_program_ = this->device_->CreateProgram(); stringstream ss; ss << this->devi...
the_stack
#include "common.h" #include "polish_E.cu" #include "kernel_functions.cu" /* * CUDA macros, constants and functions */ const int subset_size = 5; const unsigned long long seed = 1234; #define CudaErrorCheck(ans) {__CudaErrorCheck((ans), __FILE__, __LINE__);} void __CudaErrorCheck(cudaError_t code, const char* file,...
the_stack
extern "C" { #include "../cwc.h" #include "../cwc_internal.h" } #include "../../inc/ccv_convnet_internal.h" template <int input_per_thread> __global__ static void _cwc_kern_max_pool_forward_propagate(const int strides, const int border, const int size, const int batch, float* input, const int rows, const int cols, c...
the_stack
#include <thrust/count.h> #include <thrust/inner_product.h> #include <thrust/iterator/constant_iterator.h> #include <thrust/extrema.h> #include <thrust/reduce.h> #include <thrust/functional.h> #include <thrust/random.h> #include <thrust/transform.h> #include <thrust_wrapper.h> #include <solvers/block_common_solver.h> ...
the_stack
__global__ void BlochKernelCESTGPU(float Gyro, double *d_CS, float *d_Rho, float *d_T1, float *d_T2, float *d_K, float *d_Mz, float *d_My, float *d_Mx, float *d_Buffer, float *d_dB0, float *d_dWRnd, float *d_Gzgrid, float *d_Gygrid, float *d_Gxgrid, float *d_TxCoilmg, float *d_TxCoilpe, float *d_RxCoilx, float *...
the_stack
typedef float (*fntype)(float); typedef float (*optype)(float,float); __device__ float link_linear(float a) {return a;} __device__ float link_logistic(float a) {return log(a/(1.0f - a));} __device__ float mean_linear(float a) {return a;} __device__ float mean_logistic(float a) { if (a > 20.0f) { return...
the_stack
// ----------------------------------------------------------------------------------------- // NVEnc by rigaya // ----------------------------------------------------------------------------------------- // // The MIT License // // Copyright (c) 2014-2016 rigaya // // Permission is hereby granted, free of cha...
the_stack
#include "ew_op_gpu.h" #include <stdio.h> template <typename T, typename V> __global__ void __launch_bounds__(32) LSTM_Forward( T* C_next, T* H_next, const T* __restrict__ C_prev, const T* __restrict__ H_prev, float forget_bias, int K, int K4) { int tid = t...
the_stack