{"commit":"8cd91b3df0035899b6cb33a96ab44c1a19d1c2cc","old_file":"snippets\/tst_cuda_function_ptrs\/tst_fptrs.cu","new_file":"snippets\/tst_cuda_function_ptrs\/tst_fptrs.cu","old_contents":"#include \"tst_fptrs.h\"\n#include \"user_f.h\"\n\n#include \n\nvoid assign_cuda_ptr(fc2d_cuda_t* h_f, fc2d_cuda_t f)\n{\n cudaError_t ce = cudaMemcpyFromSymbol(h_f, f, sizeof(fc2d_cuda_t));\n if(ce != cudaSuccess)\n {\n printf(\"ERROR: %s\\n\",cudaGetErrorString(ce));\n exit(0);\n } \n else\n {\n printf(\"Success!\\n\");\n }\n}\n\n\n__global__ void kernel(fc2d_cuda_t f,float x, float *y)\n{\n *y = f(x);\n return;\n}\n\nint main()\n{\n float x;\n float y, *y_dev;\n fc2d_assign_cuda_ptr_t f_assign_user;\n\n fc2d_cuda_t h_f;\n\n \/* User definitions *\/\n x = 5;\n f_assign_user = assign_cuda_ptr2; \/* Function pointer stored in a v-table *\/\n\n\n \/* Code *\/\n f_assign_user(&h_f); \n\n cudaMalloc((void**) &y_dev, sizeof(float));\n\n kernel<<<1,1>>>(h_f,x,y_dev);\n\n cudaMemcpy(&y, y_dev, sizeof(float), cudaMemcpyDeviceToHost);\n\n printf(\"x = %f; y = %f\\n\",x,y);\n\n return 0;\n}\n\n","new_contents":"#include \"tst_fptrs.h\"\n#include \"user_f.h\"\n\n#include \n\n__global__ void kernel(fc2d_cuda_t f,float x, float *y)\n{\n *y = f(x);\n return;\n}\n\nint main()\n{\n float x;\n float y, *y_dev;\n fc2d_assign_cuda_ptr_t f_assign_user;\n\n fc2d_cuda_t h_f;\n\n \/* User definitions *\/\n x = 5;\n f_assign_user = assign_cuda_ptr2; \/* Function pointer stored in a v-table *\/\n\n\n \/* Code *\/\n f_assign_user(&h_f); \n\n cudaMalloc((void**) &y_dev, sizeof(float));\n\n kernel<<<1,1>>>(h_f,x,y_dev);\n\n cudaMemcpy(&y, y_dev, sizeof(float), cudaMemcpyDeviceToHost);\n\n printf(\"x = %f; y = %f\\n\",x,y);\n\n return 0;\n}\n\n","subject":"Update cuda snippet illustrating Cuda function pointers","message":"Update cuda snippet illustrating Cuda function pointers\n","lang":"Cuda","license":"bsd-2-clause","repos":"ForestClaw\/forestclaw,ForestClaw\/forestclaw,ForestClaw\/forestclaw,ForestClaw\/forestclaw,ForestClaw\/forestclaw,ForestClaw\/forestclaw"} {"commit":"ca49b5dad4d243f6188dc45d7de312b51080ba8a","old_file":"unittests\/device_properties\/test_device_properties.cu","new_file":"unittests\/device_properties\/test_device_properties.cu","old_contents":"#include \n#include \n#include \n\nint main(int argc, char** argv) {\n using namespace std;\n using namespace gunrock::cuda;\n using namespace gunrock::cuda::properties;\n\n int cc_ver = (argc > 1) ? stoi(argv[1]) : 30;\n compute_capability_t cc = make_compute_capability(cc_ver);\n const char *arch = arch_name(cc);\n\n cout << \"Compute Capability Version Major: \" << cc.major << endl;\n cout << \"Compute Capability Version Minor: \" << cc.minor << endl;\n\n if (arch != nullptr)\n cout << \"Compute Capability Architecture: \" << arch << endl;\n\n cout << endl;\n cout << \"cta_max_threads: \" << cta_max_threads() << endl;\n cout << \"warp_max_threads: \" << warp_max_threads() << endl;\n cout << \"sm_max_ctas: \" << sm_max_ctas(cc) << endl;\n cout << \"sm_max_threads: \" << sm_max_threads(cc) << endl;\n cout << \"sm_registers: \" << sm_registers(cc) << endl;\n cout << \"sm_max_smem_bytes: \" << sm_max_smem_bytes(cc) << endl;\n cout << \"shared_memory_banks: \" << shared_memory_banks() << endl;\n cout << \"shared_memory_bank_stride: \" << shared_memory_bank_stride() << endl;\n}\n","new_contents":"#include \n#include \n#include \n\nint main(int argc, char** argv) {\n using namespace std;\n using namespace gunrock::cuda;\n using namespace gunrock::cuda::properties;\n\n int cc_ver = (argc > 1) ? stoi(argv[1]) : 30;\n compute_capability_t cc = make_compute_capability(cc_ver);\n const char *arch = arch_name(cc);\n\n cout << \"Compute Capability Version Major: \" << cc.major << endl;\n cout << \"Compute Capability Version Minor: \" << cc.minor << endl;\n\n if (arch != nullptr)\n cout << \"Compute Capability Architecture: \" << arch << endl;\n\n cout << endl;\n cout << \"cta_max_threads: \" << cta_max_threads() << endl;\n cout << \"warp_max_threads: \" << warp_max_threads() << endl;\n cout << \"sm_max_ctas: \" << sm_max_ctas(cc) << endl;\n cout << \"sm_max_threads: \" << sm_max_threads(cc) << endl;\n cout << \"sm_registers: \" << sm_registers(cc) << endl;\n cout << \"sm_max_smem_bytes: \" << sm_max_smem_bytes(cc) << endl;\n cout << \"shared_memory_banks: \" << shared_memory_banks() << endl;\n cout << \"shared_memory_bank_stride: \" << shared_memory_bank_stride() << endl;\n}\n","subject":"Change indentation to 2 spaces","message":"Change indentation to 2 spaces\n","lang":"Cuda","license":"apache-2.0","repos":"gunrock\/gunrock,gunrock\/gunrock,gunrock\/gunrock"} {"commit":"3d6af3f0b119303e5299c9155ffe8d4fb285bb72","old_file":"testing\/backend\/cuda\/memory.cu","new_file":"testing\/backend\/cuda\/memory.cu","old_contents":"#include \n#include \n\ntemplate\nbool is_same(const T1 &, const T2 &)\n{\n return false;\n}\n\ntemplate\nbool is_same(const T &, const T &)\n{\n return true;\n}\n\nvoid TestSelectSystemCudaToCpp()\n{\n using thrust::system::detail::generic::select_system;\n\n \/\/ select_system(cuda::tag, cpp::tag) should return cuda_to_cpp\n bool is_cuda_to_cpp = is_same(thrust::system::cuda::detail::cuda_to_cpp(), select_system(thrust::cuda::tag(), thrust::cpp::tag()));\n ASSERT_EQUAL(true, is_cuda_to_cpp);\n}\nDECLARE_UNITTEST(TestSelectSystemCudaToCpp);\n\n","new_contents":"#include \n#include \n\ntemplate\nbool is_same(const T1 &, const T2 &)\n{\n return false;\n}\n\ntemplate\nbool is_same(const T &, const T &)\n{\n return true;\n}\n\nvoid TestSelectSystemCudaToCpp()\n{\n using thrust::system::detail::generic::select_system;\n\n \/\/ select_system(cuda::tag, thrust::host_system_tag) should return cuda_to_cpp\n bool is_cuda_to_cpp = is_same(thrust::system::cuda::detail::cuda_to_cpp(), select_system(thrust::cuda::tag(), thrust::host_system_tag()));\n ASSERT_EQUAL(true, is_cuda_to_cpp);\n}\nDECLARE_UNITTEST(TestSelectSystemCudaToCpp);\n\n","subject":"Test host_system_tag rather than cpp::tag","message":"Test host_system_tag rather than cpp::tag\n","lang":"Cuda","license":"apache-2.0","repos":"zeryx\/thrust,thrust\/thrust,xiongzhanblake\/thrust_src,raygit\/thrust,zhenglaizhang\/thrust,egaburov\/thrust,arnabgho\/thrust,dachziegel\/thrust,sarvex\/thrust,zeryx\/thrust,sdalton1\/thrust,jaredhoberock\/thrust,GrimDerp\/thrust,thrust\/thrust,dachziegel\/thrust,mohamed-ali\/thrust,marksantos\/thrust,thrust\/thrust,jaredhoberock\/thrust,sdalton1\/thrust,sarvex\/thrust,raygit\/thrust,jaredhoberock\/thrust,GrimDerp\/thrust,zeryx\/thrust,xiongzhanblake\/thrust,xiongzhanblake\/thrust,egaburov\/thrust,jaredhoberock\/thrust,zhenglaizhang\/thrust,raygit\/thrust,arnabgho\/thrust,arnabgho\/thrust,dachziegel\/thrust,Ricardo666666\/thrust,GrimDerp\/thrust,mohamed-ali\/thrust,sdalton1\/thrust,xiongzhanblake\/thrust_src,thvasilo\/thrust,mohamed-ali\/thrust,thvasilo\/thrust,marksantos\/thrust,Ricardo666666\/thrust,andrewcorrigan\/thrust-multi-permutation-iterator,andrewcorrigan\/thrust-multi-permutation-iterator,thvasilo\/thrust,thrust\/thrust,zhenglaizhang\/thrust,andrewcorrigan\/thrust-multi-permutation-iterator,thrust\/thrust,Ricardo666666\/thrust,marksantos\/thrust,xiongzhanblake\/thrust,egaburov\/thrust,xiongzhanblake\/thrust_src,jaredhoberock\/thrust,sarvex\/thrust"} {"commit":"b5abb749a381c08fd499743871896b620f133d3b","old_file":"cuda_grid.cu","new_file":"cuda_grid.cu","old_contents":"#include \n#include \n\nstruct kernel\n{\n __device__\n void operator()(agency::parallel_group& self)\n {\n printf(\"hello from {%d, %d}\\n\", (int)self.outer().index(), (int)self.inner().index());\n }\n};\n\n\nauto grid(size_t num_blocks, size_t num_threads)\n -> decltype(\n agency::cuda::par(num_blocks, agency::cuda::con(num_threads))\n )\n{\n return agency::cuda::par(num_blocks, agency::cuda::con(num_threads));\n}\n\n\nint main()\n{\n bulk_invoke(grid(2,32), kernel());\n\n return 0;\n}\n\n","new_contents":"#include \n#include \n\n\nstruct kernel\n{\n __device__\n void operator()(agency::parallel_group& self)\n {\n printf(\"hello from {%d, %d}\\n\", (int)self.outer().index(), (int)self.inner().index());\n }\n\n __device__\n void operator()(agency::parallel_group_2d& self)\n {\n }\n};\n\n\nauto grid(size_t num_blocks, size_t num_threads)\n -> decltype(\n agency::cuda::par(num_blocks, agency::cuda::con(num_threads))\n )\n{\n return agency::cuda::par(num_blocks, agency::cuda::con(num_threads));\n}\n\n\n\/\/using parallel_execution_policy_2d = agency::cuda::detail::basic_execution_policy;\n\/\/const parallel_execution_policy_2d par_2d{};\n\/\/\n\/\/using concurrent_execution_policy_2d = agency::cuda::detail::basic_execution_policy;\n\/\/const concurrent_execution_policy_2d con_2d{};\n\/\/\n\/\/\/\/ XXX eliminate the need for these specializations\n\/\/namespace agency\n\/\/{\n\/\/\n\/\/template<>\n\/\/struct is_execution_policy : std::true_type {};\n\/\/\n\/\/template<>\n\/\/struct is_execution_policy : std::true_type {};\n\/\/\n\/\/}\n\/\/\n\/\/\n\/\/auto grid(agency::size2 num_blocks, agency::size2 num_threads)\n\/\/ -> decltype(\n\/\/ par_2d(num_blocks, con_2d(num_threads))\n\/\/ )\n\/\/{\n\/\/ return par_2d(num_blocks, con_2d(num_threads));\n\/\/}\n\n\nint main()\n{\n bulk_invoke(grid(2,32), kernel());\n\n \/\/ XXX this takes too long to compile\n \/\/agency::cuda::bulk_invoke(grid({1,2}, {1,32}), kernel());\n\n return 0;\n}\n\n","subject":"Implement 2-dimensional grids, but leave commented out","message":"Implement 2-dimensional grids, but leave commented out\n","lang":"Cuda","license":"bsd-3-clause","repos":"egaburov\/agency,egaburov\/agency"} {"commit":"715ac3629830367768419ba4f9c1b4057430ece9","old_file":"MS6\/kernel\/nvidia\/gridder\/halide_api.cu","new_file":"MS6\/kernel\/nvidia\/gridder\/halide_api.cu","old_contents":"#include \"grid_gpu.cuh\"\n#include \"halide_buf.h\"\n\nextern \"C\"\nint nvGridder(const double _scale, const int32_t _grid_size, buffer_t *_vis_buffer, buffer_t *_gcf_buffer, buffer_t *_uvg_buffer){\n gridGPUc( _scale\n , reinterpret_cast(_uvg_buffer->host)\n , reinterpret_cast(_vis_buffer->host)\n , _vis_buffer->extent[1]\n , _grid_size \n , reinterpret_cast(_gcf_buffer->host)\n );\n return 0;\n}\n","new_contents":"#include \"grid_gpu.cuh\"\n#include \"halide_buf.h\"\n\nextern \"C\"\nint nvGridder(const double _scale, const int32_t _grid_size, buffer_t *_vis_buffer, buffer_t *_gcf_buffer, buffer_t *_uvg_buffer){\n \/\/ FIXME: make gridGPUx respect buffers locations, i.e.\n \/\/ to check if they already are on GPU and skip allocation and marshaling then\n gridGPUc( _scale\n , reinterpret_cast(_uvg_buffer->host)\n , reinterpret_cast(_vis_buffer->host)\n , _vis_buffer->extent[1]\n , _grid_size \n , reinterpret_cast(_gcf_buffer->host)\n );\n _vis_buffer->dev = 0;\n _vis_buffer->host_dirty = false;\n _gcf_buffer->dev = 0;\n _gcf_buffer->host_dirty = false;\n\n _uvg_buffer->dev = 0;\n _uvg_buffer->host_dirty = false;\n _uvg_buffer->dev_dirty = false;\n\n return 0;\n}\n","subject":"Prepare NVidia gridder's Halide veneer to be used as drop-in replacement for the true Halide kernels.","message":"Prepare NVidia gridder's Halide veneer to be used as drop-in replacement for the true Halide kernels.\n","lang":"Cuda","license":"apache-2.0","repos":"SKA-ScienceDataProcessor\/RC,SKA-ScienceDataProcessor\/RC,SKA-ScienceDataProcessor\/RC,SKA-ScienceDataProcessor\/RC,SKA-ScienceDataProcessor\/RC"} {"commit":"a778de45d2d44a6fe116810919ad82f72691325c","old_file":"source\/basic_path_tracer\/cuda_kernel_call_wrapper.cu","new_file":"source\/basic_path_tracer\/cuda_kernel_call_wrapper.cu","old_contents":"\/* rapt - RichieSam's Adventures in Path Tracing\n *\n * rapt is the legal property of Adrian Astley\n * Copyright Adrian Astley 2015\n *\/\n\n#include \"basic_path_tracer\/path_trace.cuh\"\n\n\nuint32 WangHash(uint32 a) {\n a = (a ^ 61) ^ (a >> 16);\n a = a + (a << 3);\n a = a ^ (a >> 4);\n a = a * 0x27d4eb2d;\n a = a ^ (a >> 15);\n return a;\n}\n\nvoid PathTraceNextFrame(void *buffer, uint width, uint height, size_t pitch, DeviceCamera *camera, Scene::SceneObjects *sceneObjects, uint frameNumber) {\n\tcudaError_t error = cudaSuccess;\n\n\tdim3 Db = dim3(16, 16); \/\/ block dimensions are fixed to be 256 threads\n\tdim3 Dg = dim3((width + Db.x - 1) \/ Db.x, (height + Db.y - 1) \/ Db.y);\n\n\tPathTraceKernel<<>>((unsigned char *)buffer, width, height, pitch, camera, sceneObjects, WangHash(frameNumber));\n\n\terror = cudaGetLastError();\n\tif (error != cudaSuccess) {\n\t\t\/\/exit(error);\n\t}\n}\n","new_contents":"\/* rapt - RichieSam's Adventures in Path Tracing\n *\n * rapt is the legal property of Adrian Astley\n * Copyright Adrian Astley 2015\n *\/\n\n#include \"basic_path_tracer\/path_trace.cuh\"\n\n\nuint32 WangHash(uint32 a) {\n a = (a ^ 61) ^ (a >> 16);\n a = a + (a << 3);\n a = a ^ (a >> 4);\n a = a * 0x27d4eb2d;\n a = a ^ (a >> 15);\n return a;\n}\n\n\/**\n * Any code that uses CUDA semantics has to be a .cu\/.cuh file. Instead of forcing\n * the entire project to be .cu\/.cuh files, we can just wrap each cuda kernel launch\n * in a function. We forward declare the function in other parts of the project and\n * implement the functions here, in this .cu file.\n *\/\nvoid PathTraceNextFrame(void *buffer, uint width, uint height, size_t pitch, DeviceCamera *camera, Scene::SceneObjects *sceneObjects, uint frameNumber) {\n\tcudaError_t error = cudaSuccess;\n\n\tdim3 Db = dim3(16, 16); \/\/ block dimensions are fixed to be 256 threads\n\tdim3 Dg = dim3((width + Db.x - 1) \/ Db.x, (height + Db.y - 1) \/ Db.y);\n\n\t\/\/ The actual kernel launch call\n\tPathTraceKernel<<>>((unsigned char *)buffer, width, height, pitch, camera, sceneObjects, WangHash(frameNumber));\n\n\terror = cudaGetLastError();\n\tif (error != cudaSuccess) {\n\t\t\/\/exit(error);\n\t}\n}\n","subject":"Add comments to further explain the file arraignment of the kernel code","message":"BASIC_PATH_TRACER: Add comments to further explain the file arraignment of the kernel code\n","lang":"Cuda","license":"apache-2.0","repos":"RichieSams\/rapt,RichieSams\/rapt"} {"commit":"f6dcbc04a3dc5a0e3e3401927f2496bde5913eb2","old_file":"example\/cuda\/prac5.cu","new_file":"example\/cuda\/prac5.cu","old_contents":"\n\/* originally from http:\/\/people.maths.ox.ac.uk\/gilesm\/ and modified *\/\n\n\/\/\n\/\/ include files\n\/\/\n\n#include \n#include \n#include \n#include \n\n#include \n\n#include \"prac5.h\"\n\n\/\/\n\/\/ kernel routine\n\/\/\n\n__global__ void my_first_kernel(float *x)\n{\n int tid = threadIdx.x + blockDim.x*blockIdx.x;\n\n x[tid] = threadIdx.x;\n}\n\n\n\/\/\n\/\/ CUDA routine to be called by main code\n\/\/\n\nint prac5(int nblocks, int nthreads)\n{\n float *h_x, *d_x;\n int nsize, n;\n\n \/\/ allocate memory for arrays\n\n nsize = nblocks*nthreads ;\n\n h_x = (float *)malloc(nsize*sizeof(float));\n cudaMalloc((void **)&d_x, nsize*sizeof(float));\n\n \/\/ execute kernel\n\n my_first_kernel<<>>(d_x);\n\n \/\/ copy back results and print them out\n\n cudaMemcpy(h_x,d_x,nsize*sizeof(float),cudaMemcpyDeviceToHost);\n\n for (n=0; n\n#include \n#include \n#include \n\n#include \n#include \"prac5.h\"\n\n\/\/\n\/\/ kernel routine\n\/\/\n\n__global__ void my_first_kernel(float *x)\n{\n int tid = threadIdx.x + blockDim.x*blockIdx.x;\n\n x[tid] = threadIdx.x;\n}\n\n\n\/\/\n\/\/ CUDA routine to be called by main code\n\/\/\n\nint prac5(int nblocks, int nthreads)\n{\n float *h_x, *d_x;\n int nsize, n;\n\n \/\/ allocate memory for arrays\n\n nsize = nblocks*nthreads ;\n\n h_x = (float *)malloc(nsize*sizeof(float));\n cudaMalloc((void **)&d_x, nsize*sizeof(float));\n\n \/\/ execute kernel\n\n my_first_kernel<<>>(d_x);\n\n \/\/ copy back results and print them out\n\n cudaMemcpy(h_x,d_x,nsize*sizeof(float),cudaMemcpyDeviceToHost);\n\n for (n=0; n *tlist,\n const unsigned int *dihedral_ABCD,\n const unsigned int pitch,\n const unsigned int *n_dihedrals_list,\n Scalar5 *d_params,\n unsigned int n_dihedral_types,\n int block_size);\n\n#endif\n","new_contents":"\/\/ Copyright (c) 2009-2019 The Regents of the University of Michigan\n\/\/ This file is part of the HOOMD-blue project, released under the BSD 3-Clause License.\n\n\n\/\/ Maintainer: dnlebard\n\n#include \"hoomd\/ParticleData.cuh\"\n#include \"hoomd\/HOOMDMath.h\"\n#include \"hoomd\/BondedGroupData.cuh\"\n\n\/*! \\file HarmonicDihedralForceGPU.cuh\n \\brief Declares GPU kernel code for calculating the harmonic dihedral forces. Used by HarmonicDihedralForceComputeGPU.\n*\/\n\n#ifndef __HARMONICDIHEDRALFORCEGPU_CUH__\n#define __HARMONICDIHEDRALFORCEGPU_CUH__\n\n\/\/! Kernel driver that computes harmonic dihedral forces for HarmonicDihedralForceComputeGPU\ncudaError_t gpu_compute_harmonic_dihedral_forces(Scalar4* d_force,\n Scalar* d_virial,\n const unsigned int virial_pitch,\n const unsigned int N,\n const Scalar4 *d_pos,\n const BoxDim& box,\n const group_storage<4> *tlist,\n const unsigned int *dihedral_ABCD,\n const unsigned int pitch,\n const unsigned int *n_dihedrals_list,\n Scalar4 *d_params,\n unsigned int n_dihedral_types,\n int block_size);\n\n#endif\n","subject":"Revert datatype for scalar d_params","message":"Revert datatype for scalar d_params\n","lang":"Cuda","license":"bsd-3-clause","repos":"joaander\/hoomd-blue,joaander\/hoomd-blue,joaander\/hoomd-blue,joaander\/hoomd-blue,joaander\/hoomd-blue,joaander\/hoomd-blue"} {"commit":"74f6cf4f1180ae2a1e4b74266842d9b43c607d61","old_file":"MS6\/kernel\/nvidia\/gridder\/halide_api.cu","new_file":"MS6\/kernel\/nvidia\/gridder\/halide_api.cu","old_contents":"#include \"grid_gpu.cuh\"\n#include \"halide_buf.h\"\n\nextern \"C\"\nint nvGridder(const double _scale, const int32_t _grid_size, buffer_t *_vis_buffer, buffer_t *_gcf_buffer, buffer_t *_uvg_buffer){\n \/\/ FIXME: make gridGPUx respect buffers locations, i.e.\n \/\/ to check if they already are on GPU and skip allocation and marshaling then\n gridGPUc( _scale\n , reinterpret_cast(_uvg_buffer->host)\n , reinterpret_cast(_vis_buffer->host)\n , _vis_buffer->extent[1]\n , _grid_size \n , reinterpret_cast(_gcf_buffer->host)\n );\n _vis_buffer->dev = 0;\n _vis_buffer->host_dirty = false;\n _gcf_buffer->dev = 0;\n _gcf_buffer->host_dirty = false;\n\n _uvg_buffer->dev = 0;\n _uvg_buffer->host_dirty = false;\n _uvg_buffer->dev_dirty = false;\n\n return 0;\n}\n","new_contents":"#include \"grid_gpu.cuh\"\n#include \"halide_buf.h\"\n\nextern \"C\"\nEXPORT\nint nvGridder(const double _scale, const int32_t _grid_size, buffer_t *_vis_buffer, buffer_t *_gcf_buffer, buffer_t *_uvg_buffer){\n #define visptr reinterpret_cast(_vis_buffer->host)\n #define visnum _vis_buffer->extent[1]\n bin_sort5(visptr, visnum);\n \/\/ FIXME: make gridGPUx respect buffers locations, i.e.\n \/\/ to check if they already are on GPU and skip allocation and marshaling then\n gridGPUc( _scale\n , reinterpret_cast(_uvg_buffer->host)\n , visptr\n , visnum\n , _grid_size \n , reinterpret_cast(_gcf_buffer->host)\n );\n _vis_buffer->dev = 0;\n _vis_buffer->host_dirty = false;\n _gcf_buffer->dev = 0;\n _gcf_buffer->host_dirty = false;\n\n _uvg_buffer->dev = 0;\n _uvg_buffer->host_dirty = false;\n _uvg_buffer->dev_dirty = false;\n\n return 0;\n}\n","subject":"Add forgotten sort to Halide API.","message":"Add forgotten sort to Halide API.\n","lang":"Cuda","license":"apache-2.0","repos":"SKA-ScienceDataProcessor\/RC,SKA-ScienceDataProcessor\/RC,SKA-ScienceDataProcessor\/RC,SKA-ScienceDataProcessor\/RC,SKA-ScienceDataProcessor\/RC"} {"commit":"bb92e4542d41d8626004b933feb6298d63e82b65","old_file":"src\/cuIBM.cu","new_file":"src\/cuIBM.cu","old_contents":"\/***************************************************************************\/\/**\n* \\mainpage cuIBM\n*\n*\t\tA GPU-based Immersed Boundary Method\n*\n* \\author Krishnan, A. (anush@bu.edu)\n*\/\n\n\/***************************************************************************\/\/**\n* \\file cuIBM.cu\n* \\author Krishnan, A. (anush@bu.edu)\n* \\brief Main source-file of cuIBM<\/B>\n*\/\n\n\n#include \"types.h\"\n#include \"helpers.h\"\n#include \"domain.h\"\n#include \"io\/io.h\"\n#include \"solvers\/NavierStokes\/createSolver.h\"\n\n\nint main(int argc, char **argv)\n{\n\t\/\/ initialize the computational domain\n\tdomain dom_info;\n\n\t\/\/ initialize the parameters of the simulation\n\tparameterDB paramDB;\n\n\t\/\/ read input files\n\tio::readInputs(argc, argv, paramDB, dom_info);\n\t\n\tio::printSimulationInfo(paramDB, dom_info);\n\n\t\/\/ create and initialize the appropriate flow solver\n\tNavierStokesSolver *solver = createSolver(paramDB, dom_info);\n\tsolver->initialise();\n\n\tio::printDeviceMemoryUsage(\"Initialisation complete\");\n\t\n\tio::writeInfoFile(paramDB, dom_info);\n\t\n\t\/\/ time-step loop\n\twhile (!solver->finished())\n\t{\n\t\tsolver->stepTime();\n\t\tsolver->writeData();\n\t}\n\n\tsolver->shutDown();\n}\n","new_contents":"\/***************************************************************************\/\/**\n * \\mainpage cuIBM\n *\n *\t\tA GPU-based Immersed Boundary Method\n *\n * \\author Anush Krishnan (anush@bu.edu)\n *\/\n\n\/***************************************************************************\/\/**\n * \\file cuIBM.cu\n * \\author Anush Krishnan (anush@bu.edu)\n * \\brief Main source-file of cuIBM<\/B>.\n *\/\n\n\n#include \"types.h\"\n#include \"helpers.h\"\n#include \"domain.h\"\n#include \"io\/io.h\"\n#include \"solvers\/NavierStokes\/createSolver.h\"\n\n\nint main(int argc, char **argv)\n{\n\t\/\/ initialize the computational domain\n\tdomain dom_info;\n\n\t\/\/ initialize the parameters of the simulation\n\tparameterDB paramDB;\n\n\t\/\/ read input files\n\tio::readInputs(argc, argv, paramDB, dom_info);\n\t\n\tio::printSimulationInfo(paramDB, dom_info);\n\n\t\/\/ create and initialize the appropriate flow solver\n\tNavierStokesSolver *solver = createSolver(paramDB, dom_info);\n\tsolver->initialise();\n\n\tio::printDeviceMemoryUsage(\"Initialisation complete\");\n\t\n\tio::writeInfoFile(paramDB, dom_info);\n\t\n\t\/\/ time-step loop\n\twhile (!solver->finished())\n\t{\n\t\tsolver->stepTime();\n\t\tsolver->writeData();\n\t}\n\n\tsolver->shutDown();\n}\n","subject":"Update Doxygen documentation with conventions","message":"Update Doxygen documentation with conventions\n","lang":"Cuda","license":"mit","repos":"barbagroup\/cuIBM,barbagroup\/cuIBM,barbagroup\/cuIBM"} {"commit":"8ca3a0ca80293baa3af205db69a8eeee8dd736be","old_file":"test\/Driver\/cuda-no-sanitizers.cu","new_file":"test\/Driver\/cuda-no-sanitizers.cu","old_contents":"\/\/ Check that -fsanitize=foo doesn't get passed down to device-side\n\/\/ compilation.\n\/\/\n\/\/ REQUIRES: clang-driver\n\/\/\n\/\/ RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 -fsanitize=address %s 2>&1 | \\\n\/\/ RUN: FileCheck %s\n\n\/\/ CHECK-NOT: error:\n\/\/ CHECK-DAG: \"-fcuda-is-device\"\n\/\/ CHECK-NOT: \"-fsanitize=address\"\n\/\/ CHECK-DAG: \"-triple\" \"x86_64--linux-gnu\"\n\/\/ CHECK: \"-fsanitize=address\"\n","new_contents":"\/\/ Check that -fsanitize=foo doesn't get passed down to device-side\n\/\/ compilation.\n\/\/\n\/\/ REQUIRES: clang-driver\n\/\/\n\/\/ RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 -fsanitize=address %s 2>&1 | \\\n\/\/ RUN: FileCheck %s\n\n\/\/ CHECK-NOT: error: unsupported option '-fsanitize=address'\n\/\/ CHECK-DAG: \"-fcuda-is-device\"\n\/\/ CHECK-NOT: \"-fsanitize=address\"\n\/\/ CHECK-DAG: \"-triple\" \"x86_64--linux-gnu\"\n\/\/ CHECK: \"-fsanitize=address\"\n","subject":"Fix faulty test from rL288448","message":"[CUDA] Fix faulty test from rL288448\n\nSummary:\nThe test introduced by rL288448 is currently failing because\nunimportant but unexpected errors appear as output from a test compile\nline. This patch looks for a more specific error message, in order to\navoid false positives.\n\nReviewers: jlebar\n\nSubscribers: cfe-commits\n\nDifferential Revision: https:\/\/reviews.llvm.org\/D27328\n\nSwitch to more specific error\n\ngit-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@288453 91177308-0d34-0410-b5e6-96231b3b80d8\n","lang":"Cuda","license":"apache-2.0","repos":"apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang"} {"commit":"c5640dbb916b0a2130f4fbe508b04d3c45bc4053","old_file":"testing\/cuda\/test_future_cast.cu","new_file":"testing\/cuda\/test_future_cast.cu","old_contents":"#include \n#include \n#include \n#include \n\nstruct empty {};\n\nint main()\n{\n {\n \/\/ construction of future from empty types\n\n using future_type1 = agency::cuda::future;\n future_type1 f1 = agency::cuda::make_ready_future(empty());\n\n using future_type2 = agency::cuda::future;\n future_type2 f2(std::move(f1));\n\n assert(!f1.valid());\n assert(f2.valid());\n }\n\n {\n \/\/ empty -> void\n using future_type1 = agency::cuda::future;\n future_type1 f1 = agency::cuda::make_ready_future(empty());\n\n using future_type2 = agency::cuda::future;\n future_type2 f2 = agency::future_traits::cast(f1);\n }\n\n\/\/ {\n\/\/ using future_type1 = agency::cuda::future;\n\/\/ future_type1 f1 = agency::cuda::make_ready_future(0u);\n\/\/\n\/\/ using future_type2 = agency::cuda::future;\n\/\/ future_type2 f2 = agency::future_traits::cast(f1);\n\/\/ } \n\n std::cout << \"OK\" << std::endl;\n\n return 0;\n}\n\n","new_contents":"#include \n#include \n#include \n#include \n\nstruct empty {};\n\nint main()\n{\n {\n \/\/ construction of future from empty types\n\n using future_type1 = agency::cuda::future;\n future_type1 f1 = agency::cuda::make_ready_future(empty());\n\n using future_type2 = agency::cuda::future;\n future_type2 f2(std::move(f1));\n\n assert(!f1.valid());\n assert(f2.valid());\n }\n\n {\n \/\/ empty -> void\n using future_type1 = agency::cuda::future;\n future_type1 f1 = agency::cuda::make_ready_future(empty());\n\n using future_type2 = agency::cuda::future;\n future_type2 f2 = agency::future_traits::cast(f1);\n\n assert(!f1.valid());\n assert(f2.valid());\n }\n\n {\n using future_type1 = agency::cuda::future;\n future_type1 f1 = agency::cuda::make_ready_future(13u);\n\n using future_type2 = agency::cuda::future;\n future_type2 f2 = agency::future_traits::cast(f1);\n\n \/\/ XXX fut.then() needs to invalidate fut\n \/\/assert(!f1.valid());\n assert(f2.get() == 13);\n } \n\n std::cout << \"OK\" << std::endl;\n\n return 0;\n}\n\n","subject":"Add a test for future_traits::cast()","message":"Add a test for future_traits::cast()\n","lang":"Cuda","license":"bsd-3-clause","repos":"egaburov\/agency,egaburov\/agency"} {"commit":"21a942db0ede30549404e0a4f6f2c4ede91075e8","old_file":"hoomd\/md\/TWFDriverPotentialPairGPU.cu","new_file":"hoomd\/md\/TWFDriverPotentialPairGPU.cu","old_contents":"\/*! \\file TWFDriverPotentialPairGPU.cu\n \\brief Defines the driver functions for computing all types of pair forces\n on the GPU\n*\/\n\n#include \"EvaluatorPairTWF.h\"\n#include \"AllDriverPotentialPairGPU.cuh\"\nhipError_t gpu_compute_twftemp_forces(\n const pair_args_t& pair_args, const EvaluatorPairTWF::param_type *d_params)\n {\n return gpu_compute_pair_forces(pair_args,\n d_params);\n }\n\n\n","new_contents":"\/*! \\file TWFDriverPotentialPairGPU.cu\n \\brief Defines the driver functions for computing all types of pair forces\n on the GPU\n*\/\n\n#include \"EvaluatorPairTWF.h\"\n#include \"AllDriverPotentialPairGPU.cuh\"\nhipError_t gpu_compute_twf_forces(\n const pair_args_t& pair_args, const EvaluatorPairTWF::param_type *d_params)\n {\n return gpu_compute_pair_forces(pair_args,\n d_params);\n }\n\n\n","subject":"Fix typo in GPU TWF force compute function","message":"Fix typo in GPU TWF force compute function\n","lang":"Cuda","license":"bsd-3-clause","repos":"joaander\/hoomd-blue,joaander\/hoomd-blue,joaander\/hoomd-blue,joaander\/hoomd-blue,joaander\/hoomd-blue,joaander\/hoomd-blue"} {"commit":"4ed5f7dbb994f19355eb861966fef6e9760c0fce","old_file":"paddle\/cuda\/include\/hl_matrix_type.cuh","new_file":"paddle\/cuda\/include\/hl_matrix_type.cuh","old_contents":"\/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License. *\/\n\n#ifndef HL_MATRIX_TYPE_CUH_\n#define HL_MATRIX_TYPE_CUH_\n\n#include \"hl_base.h\"\n\n#ifdef __CUDA_ARCH__\n\/**\n * CUDA kernel inline function\n *\/\n#define INLINE __device__ inline\n#else\n\/**\n * CPP inline function\n *\/\n#define INLINE inline\n#endif\n\n#ifdef __CUDA_ARCH__\n#include \n#ifndef PADDLE_TYPE_DOUBLE\ntypedef float4 vecType;\n#else\ntypedef double2 vecType;\n#endif\n#elif defined(__SSE3__)\n#include \"hl_cpu_simd_sse.cuh\"\n#elif defined(__ARM_NEON) || defined(__ARM_NEON__)\n#include \"hl_cpu_simd_neon.cuh\"\n#else\n#include \"hl_cpu_scalar.cuh\"\n#endif\n\n#endif \/\/ HL_MATRIX_TYPE_CUH_\n","new_contents":"\/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License. *\/\n\n#ifndef HL_MATRIX_TYPE_CUH_\n#define HL_MATRIX_TYPE_CUH_\n\n#include \"hl_base.h\"\n\n#ifdef __CUDA_ARCH__\n\/**\n * CUDA kernel inline function\n *\/\n#define INLINE __device__ inline\n#else\n\/**\n * CPP inline function\n *\/\n#define INLINE inline\n#endif\n\n#ifdef __CUDA_ARCH__\n#include \n#ifndef PADDLE_TYPE_DOUBLE\ntypedef float4 vecType;\n#else\ntypedef double2 vecType;\n#endif\n#elif defined(__SSE3__)\n#include \"hl_cpu_simd_sse.cuh\"\n#elif (defined(__ARM_NEON) || defined(__ARM_NEON__)) && !defined(__NVCC__)\n#include \"hl_cpu_simd_neon.cuh\"\n#else\n#include \"hl_cpu_scalar.cuh\"\n#endif\n\n#endif \/\/ HL_MATRIX_TYPE_CUH_\n","subject":"Disable neon when enable gpu.","message":"Disable neon when enable gpu.\n","lang":"Cuda","license":"apache-2.0","repos":"reyoung\/Paddle,lispc\/Paddle,lispc\/Paddle,PaddlePaddle\/Paddle,tensor-tang\/Paddle,Canpio\/Paddle,chengduoZH\/Paddle,putcn\/Paddle,PaddlePaddle\/Paddle,baidu\/Paddle,chengduoZH\/Paddle,chengduoZH\/Paddle,luotao1\/Paddle,hedaoyuan\/Paddle,putcn\/Paddle,hedaoyuan\/Paddle,hedaoyuan\/Paddle,lcy-seso\/Paddle,pengli09\/Paddle,Canpio\/Paddle,hedaoyuan\/Paddle,tensor-tang\/Paddle,QiJune\/Paddle,luotao1\/Paddle,lcy-seso\/Paddle,pkuyym\/Paddle,jacquesqiao\/Paddle,yu239\/Paddle,Canpio\/Paddle,pkuyym\/Paddle,QiJune\/Paddle,pengli09\/Paddle,putcn\/Paddle,jacquesqiao\/Paddle,pkuyym\/Paddle,PaddlePaddle\/Paddle,pengli09\/Paddle,Canpio\/Paddle,yu239\/Paddle,chengduoZH\/Paddle,tensor-tang\/Paddle,chengduoZH\/Paddle,jacquesqiao\/Paddle,luotao1\/Paddle,jacquesqiao\/Paddle,yu239\/Paddle,hedaoyuan\/Paddle,PaddlePaddle\/Paddle,lispc\/Paddle,pkuyym\/Paddle,lcy-seso\/Paddle,baidu\/Paddle,lispc\/Paddle,reyoung\/Paddle,pengli09\/Paddle,Canpio\/Paddle,reyoung\/Paddle,lcy-seso\/Paddle,luotao1\/Paddle,reyoung\/Paddle,luotao1\/Paddle,hedaoyuan\/Paddle,putcn\/Paddle,putcn\/Paddle,tensor-tang\/Paddle,Canpio\/Paddle,lispc\/Paddle,hedaoyuan\/Paddle,luotao1\/Paddle,yu239\/Paddle,QiJune\/Paddle,yu239\/Paddle,lcy-seso\/Paddle,baidu\/Paddle,pengli09\/Paddle,baidu\/Paddle,reyoung\/Paddle,pkuyym\/Paddle,lispc\/Paddle,lispc\/Paddle,baidu\/Paddle,QiJune\/Paddle,pkuyym\/Paddle,Canpio\/Paddle,pengli09\/Paddle,yu239\/Paddle,yu239\/Paddle,jacquesqiao\/Paddle,lispc\/Paddle,yu239\/Paddle,reyoung\/Paddle,PaddlePaddle\/Paddle,tensor-tang\/Paddle,lcy-seso\/Paddle,QiJune\/Paddle,hedaoyuan\/Paddle,Canpio\/Paddle,PaddlePaddle\/Paddle,jacquesqiao\/Paddle,putcn\/Paddle,PaddlePaddle\/Paddle,luotao1\/Paddle,pengli09\/Paddle,pengli09\/Paddle,QiJune\/Paddle"} {"commit":"ff84e8a02ba8989a098bf7b5dccc6a9ebfb0ab17","old_file":"testing\/caching_allocator.cu","new_file":"testing\/caching_allocator.cu","old_contents":"","new_contents":"#include \n\n#include \n#include \n\ntemplate\nvoid test_implementation(Allocator alloc)\n{\n typedef typename thrust::detail::allocator_traits Traits;\n typedef typename Allocator::pointer Ptr;\n\n Ptr p = Traits::allocate(alloc, 123);\n Traits::deallocate(alloc, p, 123);\n\n Ptr p2 = Traits::allocate(alloc, 123);\n ASSERT_EQUAL(p, p2);\n}\n\nvoid TestSingleDeviceTLSCachingAllocator()\n{\n test_implementation(thrust::detail::single_device_tls_caching_allocator());\n};\nDECLARE_UNITTEST(TestSingleDeviceTLSCachingAllocator);\n","subject":"Add a unit test for the convenient caching allocator in detail.","message":"Add a unit test for the convenient caching allocator in detail.\n\nReviewed-by: Bryce Adelstein Lelbach aka wash <2f0f95f95a80179c2180af4c82f6ea311b6bd2c8@gmail.com>\n","lang":"Cuda","license":"apache-2.0","repos":"thrust\/thrust,jaredhoberock\/thrust,thrust\/thrust,thrust\/thrust,jaredhoberock\/thrust,jaredhoberock\/thrust,thrust\/thrust,jaredhoberock\/thrust,jaredhoberock\/thrust,andrewcorrigan\/thrust-multi-permutation-iterator,andrewcorrigan\/thrust-multi-permutation-iterator,thrust\/thrust,andrewcorrigan\/thrust-multi-permutation-iterator"} {"commit":"43c7b6f21c172b9707e73b0595ab26572ea1309b","old_file":"testing\/memory.cu","new_file":"testing\/memory.cu","old_contents":"","new_contents":"#include \n#include \n\nstruct my_tag : thrust::device_system_tag {};\n\ntemplate\nbool is_same(const T1 &, const T2 &)\n{\n return false;\n}\n\ntemplate\nbool is_same(const T &, const T &)\n{\n return true;\n}\n\nvoid TestSelectSystemDifferentTypes()\n{\n \/\/ XXX different systems handle this differently, so it's impossible to test it right now\n KNOWN_FAILURE;\n}\nDECLARE_UNITTEST(TestSelectSystemDifferentTypes);\n\n\nvoid TestSelectSystemSameTypes()\n{\n using thrust::system::detail::generic::select_system;\n\n \/\/ select_system(device_system_tag, device_system_tag) should return device_system_tag\n bool is_device_system_tag = is_same(thrust::device_system_tag(), select_system(thrust::device_system_tag(), thrust::device_system_tag()));\n ASSERT_EQUAL(true, is_device_system_tag);\n\n \/\/ select_system(my_tag, my_tag) should return my_tag\n bool is_my_tag = is_same(my_tag(), select_system(my_tag(), my_tag()));\n ASSERT_EQUAL(true, is_my_tag);\n}\nDECLARE_UNITTEST(TestSelectSystemSameTypes);\n\n","subject":"Add unit tests for select_system, with one KNOWN_FAILURE","message":"Add unit tests for select_system, with one KNOWN_FAILURE\n\nFixes #169\n","lang":"Cuda","license":"apache-2.0","repos":"thrust\/thrust,xiongzhanblake\/thrust,thvasilo\/thrust,Ricardo666666\/thrust,Ricardo666666\/thrust,thrust\/thrust,thvasilo\/thrust,xiongzhanblake\/thrust_src,jaredhoberock\/thrust,raygit\/thrust,sdalton1\/thrust,thrust\/thrust,GrimDerp\/thrust,marksantos\/thrust,xiongzhanblake\/thrust_src,Ricardo666666\/thrust,sdalton1\/thrust,andrewcorrigan\/thrust-multi-permutation-iterator,egaburov\/thrust,mohamed-ali\/thrust,GrimDerp\/thrust,dachziegel\/thrust,jaredhoberock\/thrust,sarvex\/thrust,dachziegel\/thrust,thrust\/thrust,GrimDerp\/thrust,sarvex\/thrust,egaburov\/thrust,jaredhoberock\/thrust,andrewcorrigan\/thrust-multi-permutation-iterator,mohamed-ali\/thrust,raygit\/thrust,xiongzhanblake\/thrust,jaredhoberock\/thrust,zeryx\/thrust,thrust\/thrust,jaredhoberock\/thrust,dachziegel\/thrust,sarvex\/thrust,zhenglaizhang\/thrust,andrewcorrigan\/thrust-multi-permutation-iterator,thvasilo\/thrust,zeryx\/thrust,marksantos\/thrust,mohamed-ali\/thrust,zhenglaizhang\/thrust,sdalton1\/thrust,xiongzhanblake\/thrust,zeryx\/thrust,zhenglaizhang\/thrust,arnabgho\/thrust,egaburov\/thrust,xiongzhanblake\/thrust_src,marksantos\/thrust,arnabgho\/thrust,raygit\/thrust,arnabgho\/thrust"} {"commit":"c8b5d37350a09fc57307697e6428872f61c0f220","old_file":"test\/CodeGenCUDA\/launch-bounds.cu","new_file":"test\/CodeGenCUDA\/launch-bounds.cu","old_contents":"","new_contents":"\/\/ RUN: %clang_cc1 %s -triple nvptx-unknown-unknown -fcuda-is-device -emit-llvm -o - | FileCheck %s\n\n#include \"..\/SemaCUDA\/cuda.h\"\n\n#define MAX_THREADS_PER_BLOCK 256\n#define MIN_BLOCKS_PER_MP 2\n\n\/\/ Test both max threads per block and Min cta per sm.\nextern \"C\" {\n__global__ void\n__launch_bounds__( MAX_THREADS_PER_BLOCK, MIN_BLOCKS_PER_MP )\nKernel1()\n{\n}\n}\n\n\/\/ CHECK: !{{[0-9]+}} = metadata !{void ()* @Kernel1, metadata !\"maxntidx\", i32 256}\n\/\/ CHECK: !{{[0-9]+}} = metadata !{void ()* @Kernel1, metadata !\"minctasm\", i32 2}\n\n\/\/ Test only max threads per block. Min cta per sm defaults to 0, and\n\/\/ CodeGen doesn't output a zero value for minctasm.\nextern \"C\" {\n__global__ void\n__launch_bounds__( MAX_THREADS_PER_BLOCK )\nKernel2()\n{\n}\n}\n\n\/\/ CHECK: !{{[0-9]+}} = metadata !{void ()* @Kernel2, metadata !\"maxntidx\", i32 256}\n","subject":"Add test case for r206302","message":"Add test case for r206302\n\n\ngit-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@206303 91177308-0d34-0410-b5e6-96231b3b80d8\n","lang":"Cuda","license":"apache-2.0","repos":"apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,apple\/swift-clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang"} {"commit":"9a535c806294ca22c3b153b16e355e442907b882","old_file":"test\/Driver\/cuda-not-found.cu","new_file":"test\/Driver\/cuda-not-found.cu","old_contents":"","new_contents":"\/\/ REQUIRES: clang-driver\n\n\/\/ Check that we raise an error if we're trying to compile CUDA code but can't\n\/\/ find a CUDA install, unless -nocudainc was passed.\n\n\/\/ RUN: %clang -### --sysroot=%s\/no-cuda-there %s 2>&1 | FileCheck %s --check-prefix ERR\n\/\/ RUN: %clang -### --cuda-path=%s\/no-cuda-there %s 2>&1 | FileCheck %s --check-prefix ERR\n\/\/ ERR: cannot find CUDA installation\n\n\/\/ RUN: %clang -### -nocudainc --sysroot=%s\/no-cuda-there %s 2>&1 | FileCheck %s --check-prefix OK\n\/\/ RUN: %clang -### -nocudainc --cuda-path=%s\/no-cuda-there %s 2>&1 | FileCheck %s --check-prefix OK\n\/\/ OK-NOT: cannot find CUDA installation\n","subject":"Add a test for r266496 (raise an error if a CUDA installation isn't found)","message":"[CUDA] Add a test for r266496 (raise an error if a CUDA installation isn't found)\n\ngit-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@266796 91177308-0d34-0410-b5e6-96231b3b80d8\n","lang":"Cuda","license":"apache-2.0","repos":"llvm-mirror\/clang,apple\/swift-clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang"} {"commit":"7251e7a3e78e8315acad03c1a346a2eb3eb78587","old_file":"testing\/cuda\/test_then_execute.cu","new_file":"testing\/cuda\/test_then_execute.cu","old_contents":"","new_contents":"#include \n#include \n#include \n\n\n__managed__ int increment_me;\n\nstruct increment_and_return_void\n{\n template\n __device__\n void operator()(const Index&, int& past)\n {\n atomicAdd(&increment_me, past);\n }\n};\n\n\ntemplate\nvoid test()\n{\n using executor_type = Executor;\n\n using traits = agency::executor_traits;\n\n {\n \/\/ then_execute returning user-specified container\n \n executor_type exec;\n\n typename executor_type::shape_type shape{10,10};\n\n auto past = traits::template make_ready_future(exec, 13);\n\n using container_type = typename executor_type::template container;\n\n using index_type = typename executor_type::index_type;\n\n auto fut = traits::template then_execute(exec, [] __device__ (index_type idx, int& past)\n {\n return past;\n },\n shape,\n past);\n\n auto got = fut.get();\n\n assert(got == std::vector(got.size(), 13));\n }\n\n {\n \/\/ then_execute returning default container\n \n executor_type exec;\n\n typename executor_type::shape_type shape{10,10};\n\n auto past = traits::template make_ready_future(exec, 13);\n\n using index_type = typename traits::index_type;\n\n auto fut = traits::then_execute(exec, [] __device__ (index_type idx, int& past)\n {\n return past;\n },\n shape,\n past);\n\n auto result = fut.get();\n\n std::vector ref(result.size(), 13);\n assert(std::equal(ref.begin(), ref.end(), result.begin()));\n }\n\n {\n \/\/ then_execute returning void\n \n executor_type exec;\n\n typename executor_type::shape_type shape{10,10};\n\n auto past = traits::template make_ready_future(exec, 13);\n\n increment_me = 0;\n\n using index_type = typename traits::index_type;\n\n \/\/ XXX don't use a __device__ lambda here because we can't reliably compute its return type\n auto fut = traits::then_execute(exec, increment_and_return_void(), shape, past);\n\n fut.wait();\n\n assert(increment_me == shape[0] * shape[1] * 13);\n }\n}\n\nint main()\n{\n \/\/ a completely empty executor\n test();\n\n std::cout << \"OK\" << std::endl;\n\n return 0;\n}\n\n","subject":"Test multi-agent then_execute without shared parameters with nvcc","message":"Test multi-agent then_execute without shared parameters with nvcc\n","lang":"Cuda","license":"bsd-3-clause","repos":"egaburov\/agency,egaburov\/agency"} {"commit":"ee11343df0c27159e881b4226047f01fe815a44f","old_file":"examples\/monte_carlo_disjoint_sequences.cu","new_file":"examples\/monte_carlo_disjoint_sequences.cu","old_contents":"","new_contents":"#include \n#include \n#include \n#include \n\n#include \n\n\/\/ The technique demonstrated in the example monte_carlo.cu \n\/\/ assigns an independently seeded random number generator to each\n\/\/ of 30K threads, uses a simple hashing scheme based on thread index to\n\/\/ seed each RNG. This technique, while simple, may be succeptible\n\/\/ to correlation among the streams of numbers generated by each RNG\n\/\/ because there is no guarantee that the streams are not disjoint.\n\/\/ This example demonstrates a slightly more sophisticated technique\n\/\/ which ensures that the subsequences generated in each thread are\n\/\/ disjoint with no overlap. To achieve this, we use a single common stream\n\/\/ of random numbers, but partition it among threads to ensure no overlap\n\/\/ of substreams. The substreams are generated procedurally using\n\/\/ default_random_engine's discard(n) member function, which skips\n\/\/ past n states of the RNG. This function is accelerated and executes\n\/\/ in O(lg n) time.\n\n\/\/ use 30K subsequences of random numbers\nconst int M = 30000;\n\nstruct estimate_pi : public thrust::unary_function\n{\n __host__ __device__\n float operator()(unsigned int thread_id)\n {\n float sum = 0;\n unsigned int N = 5000; \/\/ samples per stream\n\n \/\/ note that M * N <= default_random_engine::max,\n \/\/ which is also the period of this particular RNG\n \/\/ this ensures the substreams are disjoint\n\n \/\/ create a random number generator\n \/\/ note that each thread uses an RNG with the same seed\n thrust::default_random_engine rng;\n\n \/\/ jump past the numbers used by the subsequences before me\n rng.discard(N * thread_id);\n\n \/\/ create a mapping from random numbers to [0,1)\n thrust::uniform_real_distribution u01(0,1);\n\n \/\/ take N samples in a quarter circle\n for(unsigned int i = 0; i < N; ++i)\n {\n \/\/ draw a sample from the unit square\n float x = u01(rng);\n float y = u01(rng);\n\n \/\/ measure distance from the origin\n float dist = sqrtf(x*x + y*y);\n\n \/\/ add 1.0f if (u0,u1) is inside the quarter circle\n if(dist <= 1.0f)\n sum += 1.0f;\n }\n\n \/\/ multiply by 4 to get the area of the whole circle\n sum *= 4.0f;\n\n \/\/ divide by N\n return sum \/ N;\n }\n};\n\nint main(void)\n{\n float estimate = thrust::transform_reduce(thrust::counting_iterator(0),\n thrust::counting_iterator(M),\n estimate_pi(),\n 0.0f,\n thrust::plus());\n estimate \/= M;\n\n std::cout << \"pi is around \" << estimate << std::endl;\n\n return 0;\n}\n\n","subject":"Add an example of Monte Carlo using disjoint subsequences of random numbers from a common stream.","message":"Add an example of Monte Carlo using disjoint subsequences of random numbers from a common stream.\n","lang":"Cuda","license":"apache-2.0","repos":"h1arshad\/thrust,levendlee\/thrust,julianromera\/thrust,Vishwa07\/thrust,malenie\/thrust,julianromera\/thrust,hemmingway\/thrust,malenie\/thrust,google-code-export\/thrust,rdmenezes\/thrust,google-code-export\/thrust,rdmenezes\/thrust,bfurtaw\/thrust,levendlee\/thrust,hemmingway\/thrust,rdmenezes\/thrust,allendaicool\/thrust,hemmingway\/thrust,rdmenezes\/thrust,UIKit0\/thrust,UIKit0\/thrust,julianromera\/thrust,julianromera\/thrust,bfurtaw\/thrust,lishi0927\/thrust,Vishwa07\/thrust,lishi0927\/thrust,allendaicool\/thrust,h1arshad\/thrust,google-code-export\/thrust,Vishwa07\/thrust,h1arshad\/thrust,google-code-export\/thrust,malenie\/thrust,lishi0927\/thrust,Vishwa07\/thrust,lishi0927\/thrust,bfurtaw\/thrust,hemmingway\/thrust,allendaicool\/thrust,levendlee\/thrust,bfurtaw\/thrust,h1arshad\/thrust,UIKit0\/thrust,UIKit0\/thrust,malenie\/thrust,levendlee\/thrust,allendaicool\/thrust"} {"commit":"56c6f5e7a1ef48adc300c26254c07b28e7de9c53","old_file":"test\/Driver\/cuda-output-asm.cu","new_file":"test\/Driver\/cuda-output-asm.cu","old_contents":"","new_contents":"\/\/ Tests CUDA compilation with -S.\n\n\/\/ REQUIRES: clang-driver\n\/\/ REQUIRES: x86-registered-target\n\/\/ REQUIRES: nvptx-registered-target\n\n\/\/ RUN: %clang -### -S -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 %s 2>&1 \\\n\/\/ RUN: | FileCheck -check-prefix HOST -check-prefix SM20 %s\n\/\/ RUN: %clang -### -S -target x86_64-linux-gnu --cuda-host-only -o foo.s %s 2>&1 \\\n\/\/ RUN: | FileCheck -check-prefix HOST %s\n\/\/ RUN: %clang -### -S -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 \\\n\/\/ RUN: --cuda-device-only -o foo.s %s 2>&1 \\\n\/\/ RUN: | FileCheck -check-prefix SM20 %s\n\/\/ RUN: %clang -### -S -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 \\\n\/\/ RUN: --cuda-gpu-arch=sm_30 --cuda-device-only %s 2>&1 \\\n\/\/ RUN: | FileCheck -check-prefix SM20 -check-prefix SM30 %s\n\n\/\/ HOST-DAG: \"-cc1\" \"-triple\" \"x86_64--linux-gnu\"\n\/\/ SM20-DAG: \"-cc1\" \"-triple\" \"nvptx64-nvidia-cuda\"\n\/\/ SM20-same: \"-target-cpu\" \"sm_20\"\n\/\/ SM30-DAG: \"-cc1\" \"-triple\" \"nvptx64-nvidia-cuda\"\n\/\/ SM30-same: \"-target-cpu\" \"sm_30\"\n\n\/\/ RUN: %clang -### -S -target x86_64-linux-gnu -o foo.s %s 2>&1 \\\n\/\/ RUN: | FileCheck -check-prefix MULTIPLE-OUTPUT-FILES %s\n\/\/ RUN: %clang -### -S -target x86_64-linux-gnu --cuda-device-only \\\n\/\/ RUN: --cuda-gpu-arch=sm_20 --cuda-gpu-arch=sm_30 -o foo.s %s 2>&1 \\\n\/\/ RUN: | FileCheck -check-prefix MULTIPLE-OUTPUT-FILES %s\n\/\/ MULTIPLE-OUTPUT-FILES: error: cannot specify -o when generating multiple output files\n","subject":"Add test for compiling CUDA code with -S.","message":"[CUDA] Add test for compiling CUDA code with -S.\n\nReviewers: tra\n\nSubscribers: cfe-commits, jhen\n\nDifferential Revision: http:\/\/reviews.llvm.org\/D16081\n\ngit-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@257810 91177308-0d34-0410-b5e6-96231b3b80d8\n","lang":"Cuda","license":"apache-2.0","repos":"llvm-mirror\/clang,apple\/swift-clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,llvm-mirror\/clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang"} {"commit":"162f75a4686bd32c053d7b5dc5100001fdae4567","old_file":"test_shared.cu","new_file":"test_shared.cu","old_contents":"","new_contents":"#include \n#include \n#include \n#include \n#include \n\n\ntemplate\n__device__\nT fetch_and_add(T* ptr, T value)\n{\n#ifdef __NVCC__\n return atomicAdd(ptr, value);\n#else\n return __sync_fetch_and_add(ptr, value);\n#endif\n}\n\n\nusing cuda_thread = agency::parallel_group;\n\n\nstruct functor\n{\n __device__\n void operator()(cuda_thread& self, int* outer_result, int& outer_shared, int& inner_shared)\n {\n printf(\"idx: {%d, %d}\\n\", self.outer().index(), self.inner().index());\n printf(\"outer_shared: %d\\n\", outer_shared);\n printf(\"inner_shared: %d\\n\", inner_shared);\n\n fetch_and_add(&inner_shared, 1);\n self.inner().wait();\n\n assert(inner_shared == self.inner().group_size() + 2);\n\n auto result = fetch_and_add(&outer_shared, 1);\n\n \/\/ exactly one agent will see this result\n if(result == (2 * 2))\n {\n *outer_result = result + 1;\n }\n }\n};\n\n\nint main()\n{\n using cuda_thread = agency::parallel_group;\n\n auto policy = agency::cuda::par(2, agency::cuda::con(2));\n\n thrust::device_vector outer_result(1);\n\n agency::cuda::bulk_invoke(policy, functor(), thrust::raw_pointer_cast(outer_result.data()), agency::share<0>(1), agency::share<1>(2));\n\n assert(outer_result[0] == (2 * 2 + 1));\n\n std::cout << \"OK\" << std::endl;\n\n return 0;\n}\n\n","subject":"Add CUDA test for shared variables","message":"Add CUDA test for shared variables\n","lang":"Cuda","license":"bsd-3-clause","repos":"egaburov\/agency,egaburov\/agency"} {"commit":"e67019651a55ea09a21159701924518e673441d7","old_file":"MS3\/Sketches\/GCF_new\/dbl_max.cu","new_file":"MS3\/Sketches\/GCF_new\/dbl_max.cu","old_contents":"","new_contents":"#include \"threadFenceReduction_kernel.cuh\"\n\nstruct doubleMax {\n TASKCFG double init() {return 0.0;}\n TASKCFG double reduce(double x, double acc){return x > acc ? x : acc;}\n TASKCFG double f(double c){return fabs(c);}\n};\n\nextern \"C\" __global__ void max_512_e2(const double *g_idata, double *g_odata, unsigned int n) {\n retirementCount = 0;\n reduceSinglePass_devGen<512, true, double, double, doubleMax>(g_idata, g_odata, n);\n}\n","subject":"Add abs maximum search (the code sits in the wrong directory ATM).","message":"Add abs maximum search (the code sits in the wrong directory ATM).\n","lang":"Cuda","license":"apache-2.0","repos":"SKA-ScienceDataProcessor\/RC,SKA-ScienceDataProcessor\/RC,SKA-ScienceDataProcessor\/RC,SKA-ScienceDataProcessor\/RC,SKA-ScienceDataProcessor\/RC"} {"commit":"e8cab6a94c1a7dc8070171254fdcd4ea6d60afe7","old_file":"include\/_kernels.cu","new_file":"include\/_kernels.cu","old_contents":"","new_contents":"#include \n\n\nvoid __device__\nsaxpy(float* X, const float* Y, float scale, int n)\n{\n for (int i=0; i < n; ++i) \/\/ Iterate over cols\n X[i] += Y[i] * scale;\n}\n\n\nvoid __global__ kernel_add_one(int* a, int length) {\n int gid = threadIdx.x + blockDim.x*blockIdx.x;\n\n while(gid < length) {\n \ta[gid] += 1;\n gid += blockDim.x*gridDim.x;\n }\n}\n\n\nvoid __global__\nmean_pool(float* means__bo,\n const float* X__to, const int* lengths__b, int B, int T, int O)\n{\n \/\/ Compute means of a batch of concatenated sequences, using the lengths.'''\n int b = blockIdx.x; \/\/ Batch-item we're averaging\n if (b >= B) return;\n\n \/\/ Go to the regions we're working on\n for (int i=0; i < b; ++i) {\n means__bo += O;\n\tX__to += lengths__b[i] * O;\n }\n\n int length = lengths__b[b];\n \/\/ Each invocation of the kernel averages one batch.\n float scale = 1. \/ length;\n for (int _=0; _ < length; ++_) \/\/ Iterate over rows\n {\n saxpy(means__bo, X__to, scale, O);\n X__to += O;\n }\n}\n\nvoid __global__\nbackprop_mean_pool(float* dX__to, const float* d_means__bo, const int* lengths__b,\n int B, int T, int O)\n{\n int b = blockIdx.x; \/\/ Batch-item we're averaging\n if (b >= B) return;\n\n int length = lengths__b[b];\n float scale = 1.\/ length;\n \n for (int _=0; _ < length; _++)\n {\n saxpy(dX__to, d_means__bo, scale, O);\n dX__to += O;\n d_means__bo += O;\n }\n}\n\n\n","subject":"Add kernel for mean pool","message":"Add kernel for mean pool\n","lang":"Cuda","license":"mit","repos":"spacy-io\/thinc,explosion\/thinc,explosion\/thinc,explosion\/thinc,spacy-io\/thinc,explosion\/thinc,spacy-io\/thinc"} {"commit":"c18f1c74f5b8b326b91ed34d90bddfa8ec82d7c1","old_file":"test\/Preprocessor\/cuda-preprocess.cu","new_file":"test\/Preprocessor\/cuda-preprocess.cu","old_contents":"","new_contents":"\/\/ Tests CUDA compilation with -E.\n\n\/\/ REQUIRES: clang-driver\n\/\/ REQUIRES: x86-registered-target\n\/\/ REQUIRES: nvptx-registered-target\n\n#ifndef __CUDA_ARCH__\n#define PREPROCESSED_AWAY\nclang_unittest_no_arch PREPROCESSED_AWAY\n#else\nclang_unittest_cuda_arch __CUDA_ARCH__\n#endif\n\n\/\/ CHECK-NOT: PREPROCESSED_AWAY\n\n\/\/ RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 %s 2>&1 \\\n\/\/ RUN: | FileCheck -check-prefix NOARCH %s\n\/\/ RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-host-only %s 2>&1 \\\n\/\/ RUN: | FileCheck -check-prefix NOARCH %s\n\/\/ NOARCH: clang_unittest_no_arch\n\n\/\/ RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-device-only %s 2>&1 \\\n\/\/ RUN: | FileCheck -check-prefix SM20 %s\n\/\/ SM20: clang_unittest_cuda_arch 200\n\n\/\/ RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_30 --cuda-device-only %s 2>&1 \\\n\/\/ RUN: | FileCheck -check-prefix SM30 %s\n\/\/ SM30: clang_unittest_cuda_arch 300\n\n\/\/ RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-gpu-arch=sm_30 \\\n\/\/ RUN: --cuda-device-only %s 2>&1 \\\n\/\/ RUN: | FileCheck -check-prefix SM20 -check-prefix SM30 %s\n","subject":"Add tests for compiling CUDA files with -E.","message":"[CUDA] Add tests for compiling CUDA files with -E.\n\nReviewers: tra\n\nSubscribers: cfe-commits, jhen\n\nDifferential Revision: http:\/\/reviews.llvm.org\/D16080\n\ngit-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@257807 91177308-0d34-0410-b5e6-96231b3b80d8\n","lang":"Cuda","license":"apache-2.0","repos":"llvm-mirror\/clang,llvm-mirror\/clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang,llvm-mirror\/clang,apple\/swift-clang,apple\/swift-clang"}