source
stringlengths
3
92
c
stringlengths
26
2.25M
mandelbrot.c
/* * Author: Pablololo12 */ /* * Order to compile with gcc: * gcc -O3 -o mandelbrot -fopenmp mandelbrot.c * * To execute first set number of threads * export OMP_NUM_THREADS=4 */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <math.h> const int SIZEX=4500; //const int SIZEY=3000; //const...
GB_binop__bxor_int16.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http:...
rootfinder_initial_guess_mex.c
#include "math.h" #include "mex.h" #include "matrix.h" #include "linequad.h" /* The gateway function */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { // Read input int n = mxGetNumberOfElements(prhs[0]); double* tj = mxGetPr(prhs[0]); double* xj = mxGetPr(pr...
mc.c
/** * mc.c * Authors: Yizhao Gao <yizhaotsccsj@gmail.com> * Date: {08/01/2017} */ #include <stdio.h> #include <stdlib.h> #include <random> #include <omp.h> #include "scan.h" using namespace std; void simulateCases(double * intensity, int * simCases, int locCount, int casCount) { static std::random_device rd; ...
GB_unop__identity_uint16_fp64.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...
cpu_adagrad.h
#pragma once #include <cuda_fp16.h> #include <cuda_runtime_api.h> #include <stdio.h> #include <cassert> #include "cuda.h" #include "custom_cuda_layers.h" #include "simd.h" #define STEP(SPAN) \ void Step_##SPAN(float* _params, \ float* gr...
laplace_par.h
#ifndef _LAPLACE_PAR_ #define _LAPLACE_PAR_ #include<omp.h> template<int SIZE> inline void initialize(double a[SIZE + 2][SIZE + 2], double b[SIZE + 2][SIZE + 2]) { #pragma omp parallel for schedule(static) proc_bind(spread) for (int i = 0; i < SIZE + 2; i++) for (int j = 0; j < SIZE + 2; j++) { ...
mmult.c
#include <stdio.h> #include <time.h> #include <sys/time.h> #include <stdlib.h> #define NRA 512 /* number of rows in matrix A */ #define NCA 512 /* number of columns in matrix A */ #define NCB 512 /* number of columns in matrix B */ struct timeval startTime; struct tim...
GB_unop__identity_int8_int8.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...
reduction-task-1.c
int v; extern void foo (int); void bar (void) { int i; #pragma omp for reduction (task, +: v) for (i = 0; i < 64; i++) foo (i); #pragma omp sections reduction (task, +: v) { foo (-2); #pragma omp section foo (-3); } #pragma omp parallel reduction (task, +: v) foo (-1); #pragma omp par...
st_naive_mask.c
#include <stdlib.h> #include <stdio.h> #include <math.h> #include <sys/time.h> #include <omp.h> /* multiprocessor support */ //#include "../PaulSwissPNG/png/mypng.h" #include "mypng.h" /***********************************************************************/ double* SteepestTangent(const uint8 *Image, const size_t N...
correlation.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 */ #define EXTRALARGE_DATASET #include <stdio.h> #include <unistd.h> #include <string.h> #include <math.h> /* Include polybench co...
matrix.c
#include <stdlib.h> #include <stdio.h> #include <assert.h> #include <string.h> #include <omp.h> #include "matrix.h" matrix_t *matrix_create(int rows, int cols) { matrix_t *ret = NULL; double *raw_data = NULL; double **data = NULL; int r; raw_data = (double *) malloc(sizeof(double) * rows * cols); d...
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 ...
opi.c
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <omp.h> int main(int argc, char **argv){ double ttime = omp_get_wtime(); long long int Ninside = 0; // number of random points inside 1/4 circle long long int Ntests = 1000000000; long long n; int Nthreads = atoi(argv[1]); omp_set_num_thread...
libomp_interface.h
// clang-format off // This file does not contain any code; it just contains additional text and formatting // for doxygen. //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICEN...
adjointadvection.h
//***************************************************************************** // Title : src/equation/adjointadvection.h // Author : Tanabe Yuta // Date : 2021/08/03 // Copyright : (C)2021 TanabeYuta //***************************************************************************** #prag...
GB_binop__minus_fp64.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
jan_example.c
#ifndef _CIVL #include <cassert> #include <cstdlib> #include <cmath> #include <iostream> #include <fstream> #include <vector> #include <cstdio> #include <string> #include <inttypes.h> #include <sys/time.h> #include <math.h> #include <omp.h> #endif #ifdef _CIVL #include <civlc.cvh> #include <stdio.h> #include <assert....
volumeramprecision.h
/********************************************************************************* * * Inviwo - Interactive Visualization Workshop * * Copyright (c) 2013-2017 Inviwo Foundation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided th...
DRB092-threadprivatemissing2-orig-yes.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...
system_energy.c
// for license information, see the accompanying LICENSE file /* Functions to handle the computation of the energy */ #include <stdio.h> #include <stdlib.h> #include <complex.h> #include <assert.h> #include <math.h> #include <mpi.h> #include "vars.h" #include "tdslda_func.h" double deform( double * rho , i...
black-scholes_mkl.c
/* * Copyright (C) 2014-2015, 2018 Intel Corporation * * SPDX-License-Identifier: MIT */ #include <omp.h> #include <mkl.h> #include "euro_opt.h" #ifdef __DO_FLOAT__ # define VDIV(n,a,b,r) vsDiv(n,a,b,r) # define VLOG(n,a,r) vsLn(n,a,r) # define VEXP(n,a,r) vsExp(n,a,r) # define VINVSQRT(n,a,r) v...
exact_rhs.c
//-------------------------------------------------------------------------// // // // This benchmark is an OpenMP C version of the NPB SP code. This OpenMP // // C version is developed by the Center for Manycore Programming at Seoul // // Nati...
3.race3.c
// RUN: clang %loadLLOV %s -o /dev/null 2>&1 | FileCheck %s #include <omp.h> #define N 20 int main() { int A[N][N][N]; for (int i = 1; i < N; i++) for (int j = 1; j < N; j++) #pragma omp parallel for for (int k = 1; k < N; k++) A[i][j][k] = A[i][j][k - 1]; } // CHECK: Data Race detected // END
calculate_water_fraction.h
#if !defined(KRATOS_CALCULATE_WATER_FRACTION_UTILITY_INCLUDED ) #define KRATOS_CALCULATE_WATER_FRACTION_UTILITY_INCLUDED // System includes #include <string> #include <iostream> #include <algorithm> // Project includes #include "includes/define.h" #include "pfem_2_application.h" #include "utilities/math_utils.h" #in...
meshtree.h
#ifndef VCGLIB_MESHTREE_H #define VCGLIB_MESHTREE_H #include <vcg/complex/algorithms/align_pair.h> #include <vcg/complex/algorithms/align_global.h> #include <vcg/complex/algorithms/occupancy_grid.h> #ifdef _OPENMP #include <omp.h> #endif namespace vcg { template<class MeshType, class ScalarType> class MeshT...
2229.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...
abstract_pivot_column.h
/* Copyright 2013 IST Austria Contributed by: Ulrich Bauer, Michael Kerber, Jan Reininghaus This file is part of PHAT. PHAT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either vers...
example4.c
// calculation example of far-field intensity distributions. // radar chart is output for a distant scattering field. #include "emf_mie_ms.h" int main(int argc,char *argv[]) { MSPD msp; FILE *fp1,*fp2; double complex e[3],h[3]; double th,ph,phd,dthd,dthr,dphr,dphd,ra,r[3],*ie,*ih,mf,iemax,ihmax; int i,j,sn...
GB_binop__first_bool.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX...
quantize.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
paint.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
solver-omp.c
#define lowerb(id, p, n) ( id * (n/p) + (id < (n%p) ? id : n%p) ) #define numElem(id, p, n) ( (n/p) + (id < (n%p)) ) #define upperb(id, p, n) ( lowerb(id, p, n) + numElem(id, p, n) - 1 ) #define min(a, b) ( (a < b) ? a : b ) #define max(a, b) ( (a > b) ? a : b ) #include "omp.h" // Function to copy one matrix into a...
schedule-openmp.c
/***************************************************************************** About: OpenMP program to see scheduling(static,dynamic,guided) of loop iterations among threads. export OMP_SCHEDULE=dynamic,4 //change chunksize to different values export OMP_NUM_THREADS=4 //change no. of th...
convolution_3x3_pack8to1_fp16.h
// Tencent is pleased to support the open source community by making ncnn available. // // Copyright (C) 2019 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 ...
functionCalls.c
int foobar() { int x; bar(1, 0); #pragma omp barrier x = 10; } int bar(int x, int y) { foobar(); } int foo() { int i = 10, j = 20; bar(i, j); // foobar(); } int main() { int p = 10, q = 30; foo(); // bar(p, q); // foobar(); }
factorize_gmp.c
/***************************************************************************************************************** * Compiling: mpicc fattor.c -lgmp -fopenmp -o fattor * Running: mpirun -n PROCNUM --bind-to none fattor NUMBER * Note: PROCNUM is the number of processes that will be ran, and it must be >=2, NUMBER is the...
rawKeccak_512_fmt_plug.c
/* Keccak-512 cracker patch for JtR. Hacked together during January of 2013 * by Dhiru Kholia <dhiru.kholia at gmail.com>. * * This file is part of John the Ripper password cracker, * Copyright (c) 2012 by Solar Designer * based on rawMD4_fmt.c code, with trivial changes by groszek. */ #if FMT_EXTERNS_H extern s...
convolution_1x1_bf16s.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 copy ...
simple.c
/* * Simple program for openmp without init constructor. This tests if * the runtime library creates threads on its own. * * Copyright (c) 2019, Rice University. * See the file LICENSE for details. * * Mark W. Krentel * September 2019 */ #include <sys/types.h> #include <dlfcn.h> #include <err.h> #inclu...
GB_unop__floor_fc32_fc32.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http://...
OnDiscMSExperiment.h
// -------------------------------------------------------------------------- // OpenMS -- Open-Source Mass Spectrometry // -------------------------------------------------------------------------- // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen, // ETH Zurich, and Freie Universit...
beta_projectors_gradient.h
/* * Beta_projectors_gradient.h * * Created on: Oct 14, 2016 * Author: isivkov */ #ifndef SRC_BETA_PROJECTORS_BETA_PROJECTORS_GRADIENT_H_ #define SRC_BETA_PROJECTORS_BETA_PROJECTORS_GRADIENT_H_ #include "beta_projectors.h" namespace sirius { /// Stores gradient components of beta over atomic positions d...
ab-totient-omp-1.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...
mandel_reduction.c
/* ** PROGRAM: Mandelbrot area (solution) ** ** PURPOSE: Program to compute the area of a Mandelbrot set. ** The correct answer should be around 1.510659. ** ** USAGE: Program runs without input ... just run the executable ** ** ADDITIONAL EXERCISES: Experiment with the schedule clause to fix ...
core_sttmlq.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/core_blas/core_zttmlq.c, normal z -> s, Fri Sep 28 17:38:25 2018 * **/ #include <plasma_core_blas.h> #include "pla...
vt_otf_trc.c
/** * VampirTrace * http://www.tu-dresden.de/zih/vampirtrace * * Copyright (c) 2005-2008, ZIH, TU Dresden, Federal Republic of Germany * * Copyright (c) 1998-2005, Forschungszentrum Juelich, Juelich Supercomputing * Centre, Federal Republic of Germany * * See the file COPYING in the pa...
__clang_cuda_cmath.h
/*===---- __clang_cuda_cmath.h - Device-side CUDA cmath support ------------=== * * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. * See https://llvm.org/LICENSE.txt for license information. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception * *===----------------------------...
cycle_share.c
// SPDX-License-Identifier: BSD-2-Clause /* Copyright 1998-2018 Bernard Parent Copyright 2020 Minindu Weerakoon Copyright 2001 Giovanni Fusina Copyright 2002 Thomas E. Schwartzentruber Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions ...
data.h
/*! * Copyright (c) 2015-2021 by Contributors * \file data.h * \brief The input data structure of xgboost. * \author Tianqi Chen */ #ifndef XGBOOST_DATA_H_ #define XGBOOST_DATA_H_ #include <dmlc/base.h> #include <dmlc/data.h> #include <dmlc/serializer.h> #include <xgboost/base.h> #include <xgboost/host_device_vec...
cvAdvDiff_bnd_omp.c
/* ----------------------------------------------------------------- * Programmer(s): Daniel Reynolds and Ting Yan @ SMU * Based on cvAdvDiff_bnd.c and parallelized with OpenMP * ----------------------------------------------------------------- * SUNDIALS Copyright Start * Copyright (c) 2002-2019, Lawrence Liv...
mixedulm_linear_solver.h
// KRATOS ______ __ __ _____ __ __ __ // / ____/___ ____ / /_____ ______/ /_/ ___// /________ _______/ /___ ___________ _/ / // / / / __ \/ __ \/ __/ __ `/ ___/ __/\__ \/ __/ ___/ / / / ___/ __/ / / / ___/ __ `/ / // / /___/ /_...
blake2sp.c
/* BLAKE2 reference source code package - reference C implementations Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at your option. The terms of these licenses can be found at: - CC0 1.0 Universal :...
GB_unop__abs_bool_bool.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...
GB_unaryop__abs_uint32_int8.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
blackscholes.c
#include "BullMoose_4.h" // Copyright (c) 2007 Intel Corp. // Black-Scholes // Analytical method for calculating European Options // // // Reference Source: Options, Futures, and Other Derivatives, 3rd Edition, // Prentice // Hall, John C. Hull, #include <stdio.h> #include <stdlib.h> #include <math.h> #include <strin...
GB_unop__identity_fc32_uint8.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...
for-task-for.c
// RUN: %libomp-compile-and-run #include <stdio.h> #include <math.h> #include "omp_testsuite.h" #define NUM_OUTER_THREADS 16 #define NUM_INNER_THREADS 16 #define SMALL_LOOPCOUNT 64 /*! Utility function to spend some time in a loop */ static void do_some_work (void) { int i; double sum = 0; for(i = 0; i < 1000...
GB_binop__bxnor_uint16.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX...
spmv_tile.h
#include"common.h" #include"mmio_highlevel.h" //#include"mmio.h" #include"utils.h" #include"tilespmv_warp.h" //#include"tilespmv_warp_avx.h" void tilespmv(Beidou_Tile_Matrix *matrix, MAT_VAL_TYPE *x, MAT_VAL_TYPE *y, int new_row) // (int rowA, int colA, int *rowpointerA, int *columnindexA, MAT_VAL_TY...
GB_binop__band_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-...
house.h
// This is AutoMine/GraphZero implementation #pragma omp parallel for schedule(dynamic,1) reduction(+:counter) for(vidType v0 = 0; v0 < g.V(); v0++) { auto y0 = g.N(v0); auto y0f0 = bounded(y0,v0); for(vidType idx1 = 0; idx1 < y0f0.size(); idx1++) { auto v1 = y0f0.begin()[idx1]; auto y1 = g.N(v1); aut...
incompleteprag.c
int x; #pragma omp int main() { x = 0; return x; }
mpncbo.c
/* $Header$ */ /* mpncbo -- netCDF binary operator */ /* Purpose: Compute sum, difference, product, or ratio of specified hyperslabs of specfied variables from two input netCDF files and output them to a single file. */ /* Copyright (C) 1995--present Charlie Zender This file is part of NCO, the netCDF Operator...
GB_unop__log10_fc64_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...
1140.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...
LevMarFitting.h
#ifndef LEVMARFITTING_HEADER #define LEVMARFITTING_HEADER #include <algorithm> #include <iostream> #include "LevMarFunc.h" #ifdef DOPARALLEL #include <omp.h> #endif template< class ScalarT > bool Cholesky(ScalarT *a, size_t n, ScalarT p[]) /*Given a positive-definite symmetric matrix a[1..n][1..n], this routine constr...
GB_binop__bxor_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...
tti-so8.c
#define _POSIX_C_SOURCE 200809L #include "stdlib.h" #include "math.h" #include "sys/time.h" #include "xmmintrin.h" #include "pmmintrin.h" #include "omp.h" struct dataobj { void *restrict data; int * size; int * npsize; int * dsize; int * hsize; int * hofs; int * oofs; } ; struct profiler { double sect...
texture.c
/* * Texture Manager */ #include "zgl.h" static GLTexture* find_texture(GLint h) { GLTexture* t; GLContext* c = gl_get_context(); t = c->shared_state.texture_hash_table[h & TEXTURE_HASH_TABLE_MASK]; while (t != NULL) { if (t->handle == h) return t; t = t->next; } return NULL; } GLboolean glAreTextures...
calc.h
#ifndef DEF_NARROWBAND_H #define DEF_NARROWBAND_H /* ========================================================================= Copyright (c) 2008-2015, Institute for Microelectronics, TU Wien. ----------------- ViennaTS - The Vienna Topography Simulator ...
omp_ex_11.c
#include <stdio.h> #include <omp.h> /* MIT License Copyright (c) 2019 NOUREDDINE DAGHBOUDJ 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 ri...
GB_binop__lt_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-...
main.c
#include<stdio.h> #include<omp.h> int main(){ // Define the domain float x_len = 2.0; // Length of the domain int x_points = 101; // Number of points to consider float del_x = x_len/(x_points-1); // Length of an element float x[x_points]; #pragma omp parallel for for (int i = 0; i <...
bst.cpp.pluto.c
#include <omp.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #define min(x,y) ((x) < (y) ? (x) : (y)) #define max(x,y) ((x) > (y) ? (x) : (y)) #define ceild(n,d) ceil(((double)(n))/((double)(d))) #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) #define S0(a, i, j, k) c[i][j] = c[i][k] +...
_quadratic_ld.c
/* The batman package: fast computation of exoplanet transit light curves * Copyright (C) 2015 Laura Kreidberg * * This program 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 of the Lice...
matvec_float.c
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/timeb.h> #include <malloc.h> #include <math.h> #define N_RUNS 20 #define N 10240 // read timer in second double read_timer() { struct timeb tm; ftime(&tm); return (double) tm.time + (double) tm.millitm / 1000.0; } //Create a matrix an...
GB_binop__bor_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_fp64.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http...
coordinate_common.h
/*! * Copyright 2018 by Contributors * \author Rory Mitchell */ #pragma once #include <algorithm> #include <string> #include <utility> #include <vector> #include <limits> #include "../common/random.h" namespace xgboost { namespace linear { /** * \brief Calculate change in weight for a given feature. Applies l1/l2...
critical.c
#include <omp.h> #include <stdio.h> main() { int x; x = 0; #pragma omp parallel shared(x) { #pragma omp critical x = x + 1; } /* end of parallel section */ printf("out of the parallel region : X = %d\n",x); }
sort.c
/* This file is part of ParTI!. ParTI! is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ParTI! is distributed...
smg2_setup_rap.c
/*BHEADER********************************************************************** * Copyright (c) 2008, Lawrence Livermore National Security, LLC. * Produced at the Lawrence Livermore National Laboratory. * This file is part of HYPRE. See file COPYRIGHT for details. * * HYPRE is free software; you can redistribute...
parallel_utilities.h
// | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: Riccardo Rossi // Denis Demidov...
timer.h
/* @copyright Russell Standish 2000-2013 @author Russell Standish This file is part of EcoLab Open source licensed under the MIT license. See LICENSE for details. */ #ifndef TIMER_H #define TIMER_H #if !defined(__MINGW32__) && !defined(__MINGW32_VERSION) #include <unistd.h> #include <sys/times.h> #endif #incl...
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...
main.c
#include <stdio.h> #include <string.h> #include <time.h> #include <stdlib.h> #include <unistd.h> #include <stdbool.h> #include <omp.h> #include <cblas.h> //Threshold for testing validity of matrix matrix multiplication #define ERROR_THRESHOLD 0.0001 //For measuring wall time using omp_get_wtime() static double start;...
Matrix_Add_ColumnMajor.c
#include<stdio.h> #include<stdlib.h> #include <sys/time.h> double rtclock() { struct timezone Tzp; struct timeval Tp; int stat; stat = gettimeofday (&Tp, &Tzp); if (stat != 0) printf("Error return from gettimeofday: %d",stat); return(Tp.tv_sec + Tp.tv_usec*1.0e-6); } #define size 10000 #define NT 8 int A[size][size]; i...
myMultiFactorial.c
#include <omp.h> #include <stdio.h> #include <unistd.h> int main(int argc, char *argv[]) { /* sequential code */ int i, N=7,ans, numThreads = omp_get_max_threads(); int ress[numThreads]; //Array to store pre answers (before joining)... //Initialize the array to 1s for(i = 0; i < numThreads; i++){ ress[i] = 1; } ...
enhance.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
GB_unop__identity_fc32_int64.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...
SUGE.c
/** * Name: SUGE.c v2.3.1 * Date: 2021-09-12 * Intro: A lib to simulate astronomical phenomenons. * Update: Allows two colors to display clearly, now supports v4. * Open configure file SUGE by default, which can be appointed by cmd argument: * ver: 2/3/4 * number: Numbers of celestial bodies * X posi...
GB_dense_subassign_22_template.c
//------------------------------------------------------------------------------ // GB_dense_subassign_22_template: C += b where C is dense and b is a scalar //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. ...
GB_binop__bor_int32.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX...
Example_target_task_reduction.2b.c
/* * @@name: target_task_reduction.2b.c * @@type: C * @@compilable: yes * @@linkable: yes * @@expect: success * @@version: omp_5.0 */ #include <stdio.h> #pragma omp declare target to(device_compute) extern void device_compute(int *); extern void host_compute(int *); int main() { int sum = 0; #pragma omp parallel...
convolution-2d.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...
shared-clause.c
#include <stdio.h> #ifdef _OPENMP #include <omp.h> #endif main() { int i, n = 7; int a[n]; for (i=0; i<n; i++) a[i] = i+1; // none significa que cualquier variable usada en una región //paralela que no estén con private (OpenMP), //shared (OpenMP), reduction, firstprivate, o la cláusula de lastprivate ...
ParSHUM_solver.c
#define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <string.h> #include <libgen.h> #include <math.h> #include <limits.h> #ifdef USE_PLASMA #include <plasma.h> #else #include <mkl.h> #endif #include "ParSHUM_verbose.h" #include "ParSHUM_enum.h" #include "ParSHUM_matrix.h" #include "ParSHUM_dense.h" #...
GB_unop__identity_uint8_uint32.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...