source
stringlengths
3
92
c
stringlengths
26
2.25M
VolumetricAdaptiveAveragePooling.c
#ifndef TH_GENERIC_FILE #define TH_GENERIC_FILE "THNN/generic/VolumetricAdaptiveAveragePooling.c" #else #define START_IND(a,b,c) (int)floor((float)(a * c) / b) #define END_IND(a,b,c) (int)ceil((float)((a + 1) * c) / b) // #define START_IND(a,b,c) a * c / b // #define END_IND(a,b,c) (a + 1) * c / b + ((a + 1) * c % b ...
test.c
#include <omp.h> #include <stdio.h> #define N 1024 #define EXPLICIT_TARGET_TASK 0 #pragma omp requires unified_shared_memory int A[N]; int B[N]; int C[N]; #if EXPLICIT_TARGET_TASK #define LOMP_TASK_DEP_40 1 #define LOMP_TARGET_40 1 #define LOMP_PROC_BIND_40 1 #define LOMP_OS_LINUX 1 #define LOMP_CANCEL_...
colorspace.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
GB_binop__div_int8.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
GB_unaryop__identity_int32_int64.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
GB_unaryop__ainv_uint16_int32.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
cluster.c
#include "cluster.h" #include "rt/rt_api.h" #include "rt/rt_omp.h" void cluster_entry(void *arg) { // OpenMP runtime is not available by default and must be started rt_omp_start(); printf("(%d, %d) Enter cluster entry\n", rt_cluster_id(), rt_core_id()); #pragma omp parallel { printf("(%d, %d) Enter para...
GB_binop__bget_uint16.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
sgeqrf.c
/** * * @file * * PLASMA is a software package provided by: * University of Tennessee, US, * University of Manchester, UK. * * @generated from /home/luszczek/workspace/plasma/bitbucket/plasma/compute/zgeqrf.c, normal z -> s, Fri Sep 28 17:38:01 2018 * **/ #include "plasma.h" #include "plasma_async.h" #inc...
utils.h
/****************************************************************************** * Copyright (c) Intel Corporation - All rights reserved. * * This file is part of the LIBXSMM library. * * * ...
DRB059-lastprivate-orig-no.c
/* Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory Written by Chunhua Liao, Pei-Hung Lin, Joshua Asplund, Markus Schordan, and Ian Karlin (email: liao6@llnl.gov, lin32@llnl.gov, asplund1@llnl.gov, schordan1@llnl.gov, karlin1@llnl.gov) LLNL-CODE-73214...
declare_variant_if.c
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <omp.h> // --- start of saxpy header with variants --- int saxpy(int, float, float *, float *); int amdgcn_saxpy(int, float, float *, float *); int nvptx_saxpy(int, float, float *, float *); #pragma omp declare variant(nvptx_saxpy) \ match(device ...
eigrp_fmt_plug.c
/* * Cracker for EIGRP (Cisco's proprietary routing protocol) MD5 + HMAC-SHA-256 authentication. * http://tools.ietf.org/html/draft-savage-eigrp-00 * * This is dedicated to Darya. You inspire me. * * This software is Copyright (c) 2014, Dhiru Kholia <dhiru [at] openwall.com>, * and it is hereby released to the g...
StmtOpenMP.h
//===- StmtOpenMP.h - Classes for OpenMP directives ------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
GB_binop__div_int32.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
SpatialConvolutionMM.c
#ifndef TH_GENERIC_FILE #define TH_GENERIC_FILE "generic/SpatialConvolutionMM.c" #else static inline void THNN_(SpatialConvolutionMM_shapeCheck)( THTensor *input, THTensor *gradOutput, THTensor *weight, THTensor *bias, int kH, int kW, int dH, int dW, int padH, int padW, int weight_nullable) { THArgCheck(kW > 0 &...
run_dft_omp.c
#include "dft.h" #include <omp.h> #define MASTER 0 #define NTHREADS 8 int main(int argc, char* argv[]) { int_t len = 0, reps = 0; #ifdef N len = (int_t) N; #else if(argc > 1) { len = (int_t) atoi(argv[1]); } else { fprintf(stderr, "ERR...
subCycleHex3D.c
/* The MIT License (MIT) Copyright (c) 2017 Tim Warburton, Noel Chalmers, Jesse Chan, Ali Karakus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation t...
FirstProgram.c
#include<stdio.h> #include<omp.h> int main(){ const int T = 10000; int sum; sum = 0; // Simple accumulation loop // (Note in Fortran we can use a built-in for this, but // ignore that for this demo) #pragma omp parallel for reduction(+:sum) for(int i = 1; i <= T; i++){ sum = sum + i; } prin...
convolution_1x1_int8.h
// BUG1989 is pleased to support the open source community by supporting ncnn available. // // Copyright (C) 2019 BUG1989. All rights reserved. // // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy of the License at ...
GB_unop__atanh_fp32_fp32.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-Li...
tiling-1.c
/* matmul.c : Matrix Multiplication with tiling for openmp4 example */ #include <stdlib.h> #include <math.h> #define BLOCK_SIZE 16 /* #define BLOCK_SIZE 32 */ #define NSECPERSEC 1000000000L typedef struct { int width; int height; int stride; int hpad; float* elements; } Matrix; /* Correctly ex...
pr25990.c
/* { dg-do compile } */ /* { dg-options "-fopenmp -O2 -std=c99" } */ typedef __SIZE_TYPE__ size_t; typedef struct { int _flags; } FILE; extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes); extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FI...
openmp_demo.c
//------------------------------------------------------------------------------ // GraphBLAS/Demo/Program/openmp_demo: example of user multithreading //------------------------------------------------------------------------------ // This demo uses OpenMP, and should work if GraphBLAS is compiled to // use either Ope...
Example_SIMD.1.c
/* * @@name: SIMD.1c * @@type: C * @@compilable: yes * @@linkable: no * @@expect: success * @@version: omp_4.0 */ void star( double *a, double *b, double *c, int n, int *ioff ) { int i; #pragma omp simd for ( i = 0; i < n; i++ ) a[i] *= b[i] * c[i+ *ioff]; }
GxB_Monoid_identity.c
//------------------------------------------------------------------------------ // GxB_Monoid_identity: return the identity of a monoid //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-License-Ident...
prog1.c
/* Copyright (c) 2017 Rob Gillen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, subl...
nanopore_hdp.c
// // nanopore_hdp.c // // // Created by Jordan Eizenga on 1/8/16. // // // in 0-based index #define ALIGNMENT_KMER_COL 9 #define ALIGNMENT_STRAND_COL 4 #define ALIGNMENT_SIGNAL_COL 13 #define ASSIGNMENT_KMER_COL 0 #define ASSIGNMENT_STRAND_COL 1 #define ASSIGNMENT_SIGNAL_COL 2 // number of expected column in the ...
util.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/time.h> #include <math.h> #include <gsl/gsl_matrix.h> #include <gsl/gsl_blas.h> #include <gsl/gsl_rng.h> #include <gsl/gsl_randist.h> void read_matrix(int** index, int** matrix, double scaling, int N_kw, char* input_fileName) { FILE *fp = fop...
Wparentheses-2.c
/* PR c/70436 */ /* { dg-additional-options "-Wparentheses" } */ int a, b, c; void bar (void); void baz (void); void f1 (void); #pragma omp declare target to (bar, baz, f1, a, b, c) void f1 (void) { int i, j; if (a) /* { dg-warning "ambiguous" } */ #pragma omp distribute for (i = 0; i < 10; i++) if...
2945.c
/* POLYBENCH/GPU-OPENMP * * This file is a part of the Polybench/GPU-OpenMP suite * * Contact: * William Killian <killian@udel.edu> * * Copyright 2013, The University of Delaware */ #include <stdio.h> #include <unistd.h> #include <string.h> #include <math.h> /* Include polybench common header. */ #include <po...
modal_analysis_builder_and_solver.h
/* ============================================================================== Kratos A General Purpose Software for Multi-Physics Finite Element Analysis Version 1.0 (Released on march 05, 2007). Copyright 2007 Pooyan Dadvand, Riccardo Rossi pooyan@cimne.upc.edu rrossi@cimne.upc.edu CIMNE (International Center for...
hermm_c_dia_u_lo_col.c
#include "alphasparse/kernel.h" #include "alphasparse/util.h" #include "alphasparse/opt.h" #ifdef _OPENMP #include <omp.h> #endif #include <memory.h> #include <stdlib.h> alphasparse_status_t ONAME(const ALPHA_Complex alpha, const ALPHA_SPMAT_DIA *mat, const ALPHA_Complex *x, const ALPHA_INT columns, const ALPHA_INT ld...
csr.c
//#include <string.h> //#include <stdio.h> //#include <stdlib.h> //#include <stdint.h> //#include <omp.h> //#include "allocator.h" #include "geometry.h" #include "mesh2geo.h" #if 0 static void scan(const size_t nrows, unsigned int *array) { unsigned int sum = 0; for(unsigned int i = 0; i <= nrows; i++) { con...
GB_binop__div_fc64.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
sc_demo.c
/* main.c * Created by Mengyao Zhao on 06/23/11. * Version 0.1.5 * Last revision by Mengyao Zhao on 06/27/14. */ #include <stdlib.h> #include <stdint.h> #include <emmintrin.h> #include <zlib.h> #include <stdio.h> #include <time.h> #include <sys/time.h> #include <string.h> #include <math.h> #include <unistd.h...
GraphReconstructor.h
// // Copyright (C) 2015-2020 Yahoo Japan Corporation // // 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 applicab...
trmv_x_dia_u_lo_trans.c
#include "alphasparse/kernel.h" #include "alphasparse/opt.h" #include "alphasparse/util.h" #include <string.h> #ifdef _OPENMP #include <omp.h> #endif static alphasparse_status_t ONAME_omp(const ALPHA_Number alpha, const ALPHA_SPMAT_DIA* A, const ALPHA_Number* x, ...
GB_unop__identity_fp32_fc64.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX-Li...
Par-32-ParSectionsAssignments.c
int main(int argc, char **argv) { int a[4] = {1,2,3,4}; #pragma omp parallel { #pragma omp sections { #pragma omp section { a[0] = 2; a[3] = 1; } #pragma omp section { a[1] = 3; a[2] = 1; } #pragma omp section { a[2] = 10; a[0] = 2; } } } return 0; }
configurator.c
/* Simple tool to create config.h. * Would be much easier with ccan modules, but deliberately standalone. * * Copyright 2011 Rusty Russell <rusty@rustcorp.com.au>. MIT license. * * c12r_err, c12r_errx functions copied from ccan/err/err.c * Copyright Rusty Russell <rusty@rustcorp.com.au>. CC0 (Public domain) Lice...
common.h
#ifndef LIGHTGBM_UTILS_COMMON_FUN_H_ #define LIGHTGBM_UTILS_COMMON_FUN_H_ #include <LightGBM/utils/log.h> #include <LightGBM/utils/openmp_wrapper.h> #include <cstdio> #include <string> #include <vector> #include <sstream> #include <cstdint> #include <algorithm> #include <cmath> #include <functional> #include <memory>...
kmeans.c
/* ** © 2011-2016 by Kornel Lesiński. ** See COPYRIGHT file for license. */ #include "libimagequant.h" #include "pam.h" #include "kmeans.h" #include "nearest.h" #include <stdlib.h> #include <string.h> #ifdef _OPENMP #include <omp.h> #else #define omp_get_max_threads() 1 #define omp_get_thread_num() 0 ...
GB_binop__min_uint32.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
ab-totient-omp-7.c
// Distributed and parallel technologies, Andrew Beveridge, 03/03/2014 // To Compile: gcc -Wall -O -o ab-totient-omp -fopenmp ab-totient-omp.c // To Run / Time: /usr/bin/time -v ./ab-totient-omp range_start range_end #include <stdio.h> #include <omp.h> /* When input is a prime number, the totient is simply the prim...
solving_strategy.h
// | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: Riccardo Rossi // // #if !defined(KRATOS_SOLVING...
3d7pt_var.lbpar.c
#include <omp.h> #include <math.h> #define ceild(n,d) ceil(((double)(n))/((double)(d))) #define floord(n,d) floor(((double)(n))/((double)(d))) #define max(x,y) ((x) > (y)? (x) : (y)) #define min(x,y) ((x) < (y)? (x) : (y)) /* * Order-1, 3D 7 point stencil with variable coefficients * Adapted from PLUTO and Po...
spmmd_x_csc_col.c
#include "alphasparse/kernel.h" #include "alphasparse/util.h" #include "alphasparse/opt.h" #include <memory.h> #ifdef _OPENMP #include <omp.h> #endif alphasparse_status_t ONAME(const ALPHA_SPMAT_CSC *matA, const ALPHA_SPMAT_CSC *matB, ALPHA_Number *matC, const ALPHA_INT ldc) { if (matA->cols != matB->rows) ...
GB_unaryop__lnot_uint8_bool.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
DRB058-jacobikernel-orig-no.c
/* Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory Written by Chunhua Liao, Pei-Hung Lin, Joshua Asplund, Markus Schordan, and Ian Karlin (email: liao6@llnl.gov, lin32@llnl.gov, asplund1@llnl.gov, schordan1@llnl.gov, karlin1@llnl.gov) LLNL-CODE-73214...
rwalk.c
#include "rwalk.h" #include <omp.h> #include <stdlib.h> void random_walk(int const* starts, int const* ptr, int const* neighs, int n, int num_walks, int num_steps, int seed, int nthread, float restart_prop, int* walks) { if (nthread > 0) { omp_set_num_threads(nthread); } #pragma omp parallel ...
GB_bitmap_select_template.c
//------------------------------------------------------------------------------ // GB_bitmap_select_template: C=select(A,thunk) if A is bitmap or full //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPD...
seq_multivector.c
/****************************************************************************** * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) **************************************...
generator_gemm_common.c
/****************************************************************************** * Copyright (c) Intel Corporation - All rights reserved. * * This file is part of the LIBXSMM library. * * * ...
convolution_4x4.h
// Tencent is pleased to support the open source community by making ncnn available. // // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. // // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy ...
GB_unop__identity_fc64_fc32.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-Li...
soap.c
// SPDX-License-Identifier: BSD-2-Clause /* Copyright 1998-1999 Bernard Parent Copyright 2020-2021 Prasanna Thoguluva Rajendran Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain t...
simpleomp.h
// Tencent is pleased to support the open source community by making ncnn available. // // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. // // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except // in compliance with the License. You may obtain a ...
vision.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
image.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
bicg.c
/** * bicg.c: This file was adapted from PolyBench/GPU 1.0 test suite * to run on GPU with OpenMP 4.0 pragmas and OpenCL driver. * * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU * * Contacts: Marcio M Pereira <mpereira@ic.unicamp.br> * Rafael Cardoso F Sousa <rafael.cardos...
convolution_3x3.h
// Tencent is pleased to support the open source community by making ncnn available. // // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. // // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy ...
spmm.h
/*! * Copyright (c) 2020 by Contributors * \file array/cpu/spmm.h * \brief SPMM CPU kernel function header. */ #ifndef DGL_ARRAY_CPU_SPMM_H_ #define DGL_ARRAY_CPU_SPMM_H_ #include <dgl/array.h> #include <dgl/bcast.h> #include <dgl/runtime/parallel_for.h> #include <algorithm> #include <limits> #include <memory> #i...
GB_unop__asinh_fp64_fp64.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http://...
test_model.c
/***************************************************************************** * * test_model.c * * Unit test for the currently compiled model (D3Q15 or D3Q19). * * Edinburgh Soft Matter and Statistical Physics Group * Edinburgh Parallel Computing Centre * * (c) 2010-2021 The University of Edinburgh * *...
core.c
/* Generated by Cython 0.29.24 */ /* BEGIN: Cython Metadata { "distutils": { "name": "monotonic_align.core", "sources": [ "core.pyx" ] }, "module_name": "monotonic_align.core" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE...
segment.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
GB_binop__lt_int16.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
calculate_embedded_signed_distance_to_3d_skin_process.h
// | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: Pooyan Dadvand // Ruben Zorrill...
pr42942.c
/* PR libgomp/42942 */ /* { dg-do run } */ #include <omp.h> #include <stdlib.h> int main (void) { int e = 0; omp_set_dynamic (0); omp_set_nested (1); omp_set_max_active_levels (1); if (omp_get_max_active_levels () != 1) abort (); #pragma omp parallel num_threads(2) reduction(|:e) if (!omp_in_parallel ...
GB_unop__cos_fc64_fc64.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-Li...
triangle_mesh.h
/** * Copyright (c) 2021 Darius Rückert * Licensed under the MIT License. * See LICENSE file for more information. */ #pragma once #include "saiga/core/geometry/aabb.h" #include "saiga/core/geometry/triangle.h" #include "saiga/core/geometry/vertex.h" #include "saiga/core/math/math.h" #include "saiga/core/util/as...
GB_binop__bor_int16.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX...
matrix_oper.h
#ifndef MATRIX_OPER_H_ #define MATRIX_OPER_H_ namespace acspo { template <typename T> matrix<T> & operator+=(matrix<T> &mat1, const matrix<T> &mat2) { if (mat1.size() != mat2.size()) { throw std::runtime_error("dimension mismatch"); } unsigned int elem = mat1.elem(); T *m1ptr = mat1.ptr(); ...
IJMatrix_parcsr.c
/****************************************************************************** * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) **************************************...
LAGraph_cc_fastsv5b.c
//------------------------------------------------------------------------------ // LAGraph_cc_fastsv5b: connected components //------------------------------------------------------------------------------ /* LAGraph: graph algorithms based on GraphBLAS Copyright 2020 LAGraph Contributors. (see Contrib...
pragmas.h
/* File used to test the handling of the pragma pack*/ // Use default packing #pragma pack() // n defaults to 8; equivalent to /Zp8 // Change default packing #pragma pack(4) // n = 4 // Push and select custom packing #define PACKING 16 #pragma pack(push, r1, PACKING) // n = 16, pushed to stack // Change packi...
GB_binop__le_int16.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
gesummv.c
/** * gesummv.c: This file was adapted from PolyBench/GPU 1.0 test * suite to run on GPU with OpenMP 4.0 pragmas and OpenCL driver. * * http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU * * Contacts: Marcio M Pereira <mpereira@ic.unicamp.br> * Rafael Cardoso F Sousa <rafael.cardoso@students...
gsrb.c
/******************************************************************************* Copyright (c) 2016 Advanced Micro Devices, 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: 1. Redistributions of so...
collatzSieve2toK_FindPatterns_GPU.c
/* ****************************************** Find deltaN, count numbers to be tested, and find unique patterns for 2^k sieve. Patterns are compressed 4-to-1 by only looking at n%4==3. Not a huge amount of RAM is used. Compile and run via something like... clang -O3 collatzSieve2toK_FindPatterns_GPU.c -lOpenCL -f...
omp-taskgroup.c
#include <omp.h> #include <unistd.h> #include <stdio.h> #define THREADS 2 #define LEN 2 int main(void) { int counter[THREADS]={0}; #pragma omp parallel num_threads(THREADS) { #pragma omp taskgroup for (counter[omp_get_thread_num()]=0; counter[omp_get_thread_num()]<LEN; counter[omp_...
alloc_benchmark.c
/* * Copyright (C) 2016 - 2018 Intel Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice(s), * this li...
syncbench.c
/**************************************************************************** * * * OpenMP MicroBenchmark Suite - Version 3.0 * * * * ...
fs_csc_executor.h
/* ****** Parallel outer loop implementation using level set */ int fs_csc_executor(int n, int* Lp, int* Li, double* Lx, double *x, int levels, int *levelPtr, int *levelSet, int chunk){ if (!Lp || !Li || !x) return (0) ; /* check inputs */ for (int l = 0; l < levels; ++l) { int...
test_utils.h
/* * Copyright (c) 2019, NVIDIA CORPORATION. * * 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 ...
yescrypt-simd.c
/*- * Copyright 2009 Colin Percival * Copyright 2012-2014 Alexander Peslyak * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copy...
hsv.c
/* Generated by Cython 0.27.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython ...
evaluation.h
#pragma once #include <random> #include <algorithm> #include <gms/representations/sets/roaring_set.h> #include <gms/algorithms/set_based/vertex_similarity/vertex_similarity.h> #include "undirected_edge.h" #include "link_prediction.h" #include "edge_sampler.h" #include <gms/third_party/fast_statistics.h> #include <omp...
GB_unaryop__identity_fp64_bool.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http...
tune_so4.c
#define _POSIX_C_SOURCE 200809L #include "stdlib.h" #include "math.h" #include "sys/time.h" #include "xmmintrin.h" #include "pmmintrin.h" #include <stdio.h> #include "omp.h" #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) struct dataobj { void *restrict data; int *size; in...
softmax-inl.h
/*! * Copyright (c) 2017 by Contributors * \file softmax-inl.h * \brief */ #ifndef MXNET_OPERATOR_NN_SOFTMAX_INL_H_ #define MXNET_OPERATOR_NN_SOFTMAX_INL_H_ #include <vector> #include "../mxnet_op.h" #include "../operator_common.h" #include "../tensor/broadcast_reduce_op.h" namespace mxnet { namespace op { namesp...
configurator.c
/* Simple tool to create config.h. * Would be much easier with ccan modules, but deliberately standalone. * * Copyright 2011 Rusty Russell <rusty@rustcorp.com.au>. MIT license. * * c12r_err, c12r_errx functions copied from ccan/err/err.c * Copyright Rusty Russell <rusty@rustcorp.com.au>. CC0 (Public domain) Lice...
extract_image_patches.h
/* Copyright 2018 The Blueoil Authors. All Rights Reserved. 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 agre...
Cylinder.h
#ifndef CYLINDER_HEADER #define CYLINDER_HEADER #include "basic.h" #include <stdexcept> #include <utility> #include <MiscLib/Vector.h> #include "PointCloud.h" #include <ostream> #include <istream> #include <GfxTL/HyperplaneCoordinateSystem.h> #include <stdio.h> #include <MiscLib/NoShrinkVector.h> #include "...
parallel_for_loop_test.c
#include <stdio.h> #include <omp.h> int main(){ #pragma omp parallel num_threads(4) { #pragma omp for for (int i = 0; i < 12;i++){ int ID = omp_get_thread_num(); printf("CPU<%d>: %d\n",ID, i); } } printf("-------------------\n"); omp_set_num_threads...
eavlReduceOp_1.h
// Copyright 2010-2014 UT-Battelle, LLC. See LICENSE.txt for more information. #ifndef EAVL_REDUCE_OP_1_H #define EAVL_REDUCE_OP_1_H #include "eavlOperation.h" #include "eavlArray.h" #include "eavlOpDispatch_io1.h" #include "eavlTimer.h" #ifdef HAVE_OPENMP #include <omp.h> #endif #ifndef DOXYGEN #ifdef HAVE_OPENMP ...
enhance.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
ex7-imbalance-openmp.c
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <omp.h> #define VALIDATE 1 /* based on the unbalanced example found in * https://www.astro.auth.gr/~niksterg/courses/progtools/imbalance.c */ double *rand_vec(const size_t); void set_iterations(const size_t, const int, const int, double * restrict)...
search.h
// -*- C++ -*- // Copyright (C) 2007-2016 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms // of the GNU General Public License as published by the Free Software // Foundation; either version 3...