source
stringlengths
3
92
c
stringlengths
26
2.25M
test.c
#include <omp.h> #include <stdio.h> int main() { int i, j; int s = 0; int N = 30; int A[N]; int B[3]; omp_set_num_threads(3); for (int j = 0; j < 3; j++) { #pragma omp parallel for lastprivate(A) for (int i = 0; i < N / 3; i++) { // printf("%d\n", omp_get_thread_num()); A[i] = i; ...
lud_omp.c
#include <stdio.h> #ifdef _OPENMP #include <omp.h> #endif void lud_omp_cpu(float *a, int size) { int i, j, k; float sum; for (i = 0; i < size; i++) { for (j = i; j < size; j++) { sum = a[i * size + j]; for (k = 0; k < i; k++) sum -= a[i * size + k] * a[k * size + j]; a[i * size + j...
Cmrcmodel_p.c
#include <Python.h> #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include "numpy/arrayobject.h" #include <math.h> #include <fftw3.h> #ifdef _OPENMP #include <omp.h> #endif typedef struct MRCHeader { int nx; //number of columns (fastest changing in map) int ny; //number of rows int nz; //number of secti...
nr_incore.c
/* Copyright 2014-2018 The PySCF Developers. 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 requi...
thread_info.h
// ----------------------------------------------------------------------------- // // Copyright (C) The BioDynaMo Project. // 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. // // See the LICENSE file distrib...
Example_nesting_restrict.5.c
/* * @@name: nesting_restrict.5c * @@type: C * @@compilable: no * @@linkable: no * @@expect: failure */ void work(int i, int j) {} void wrong5(int n) { #pragma omp parallel { #pragma omp critical { work(n, 0); /* incorrect nesting of barrier region in a critical region */ #pragma omp barrier ...
distort.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
jacobi.pluto.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 pmax(x,y) ((x) > (y)? (x) : (y)) #define pmin(x,y) ((x) < (y)? (x) : (y)) #include "smoothers.h" #include <math.h> // cannot be 8 or below #ifndef TS #define TS...
GB_binop__lor_fp32.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX...
randomkit.c
/* MPY Random kit 1.0 */ /* static char const rcsid[] = "@(#) $Jeannot: randomkit.c,v 1.28 2005/07/21 22:14:09 js Exp $"; */ #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <limits.h> #include <math.h> #include <assert.h> #include <mkl_vsl.h> #ifdef _WIN32 /* * Windows * XXX...
omp_report_mask.c
/* Routine reports OpenMP process affinity information. Get thread number and cpus (cpu_ids) Create static space (proc_mask) to hold all masks (done in a single region) Determine the mask for each thread (insert it in proc_mask) print mask header (one thread in single region) ...
3d7pt.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 * Adapted from PLUTO and Pochoir test bench * * Tare...
csymm.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/zsymm.c, normal z -> c, Fri Sep 28 17:38:02 2018 * **/ #include "plasma.h" #include "plasma_async.h" #incl...
GB_msort_2.c
//------------------------------------------------------------------------------ // GB_msort_2: sort a 2-by-n list of integers, using A[0:1][ ] as the key //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // ...
debug_task_shared.c
// This testcase checks emission of debug info for variables // inside shared clause of task construct. // REQUIRES: x86_64-linux // RUN: %clang_cc1 -debug-info-kind=constructor -DSHARED -x c -verify -triple x86_64-pc-linux-gnu -fopenmp -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK // RUN: %clang_cc1 -debug-...
mafillpmain.c
/* CalculiX - A 3-dimensional finite element program */ /* Copyright (C) 1998-2015 Guido Dhondt */ /* This program is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU General Public License as */ /* pub...
GB_binop__isge_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...
matrix.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include "matrix.h" #include "utils.h" matrix* initMatrix(matrix* mat, int height, int width) { mat->vals = (netF*)malloc(sizeof(netF) * width * height); //mat->vals = (netF*)_aligned_malloc(sizeof(netF) * width * height, 16); mat->width =...
5125.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...
vec_add_for.c
/* for Directive Example */ #include <omp.h> #define N 1000 #define CHUNKSIZE 100 main(int argc, char *argv[]) { int i, chunk; float a[N], b[N], c[N]; /* Some initializations */ for (i=0; i < N; i++) a[i] = b[i] = i * 1.0; chunk = CHUNKSIZE; #pragma omp parallel shared(a,b,c,chunk) pr...
GB_unop__identity_uint8_int64.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...
main.c
#include "heads.h" void calculate(int nthreads) { if (nthreads == 1) { for (int i = SIZE - 1; i > -1; i--) { // case matrix[i][i] == 0 is already rejected while eliminating double curans = (double)vec[i][0] / matrix[i][i]; answers[i][0] = curans; for (int j =...
9586.c
// this source is derived from CHILL AST originally from file '/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c' as parsed by frontend compiler rose void kernel_fdtd_2d(int tmax, int nx, int ny, double ex[2000 + 0][2600 + 0], double ey[2000 + 0][2600 + 0], doub...
GB_unaryop__minv_fp32_uint16.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
single.c
/* Copyright (C) 2005-2014 Free Software Foundation, Inc. C ontributed by Richard Henderson <r*th@redhat.com>. This file is part of the GNU OpenMP Library (libgomp). Libgomp 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 Softw...
omp_num_threads.c
#include <stdio.h> #ifdef _OPENMP #include <omp.h> #endif #include "omp_testsuite.h" int check_omp_num_threads (FILE * logFile) { int failed = 0; int max_threads = 0; int threads; int nthreads; /* first we check how many threads are available */ #pragma omp parallel { #pragma omp master max_threads = o...
target-17.c
extern void abort (void); void foo (int n) { int a[n], i, err; for (i = 0; i < n; i++) a[i] = 5 * i; #pragma omp target map(to:a) map(from:err) private(i) { err = 0; for (i = 0; i < n; i++) if (a[i] != 5 * i) err = 1; } if (err) abort (); for (i = 0; i < n; i++) a[i] += i; #p...
pragma_omp.h
/****************************************************************************** * Copyright (c) 2021, NVIDIA 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: * * Redistributions of ...
nvptx_va_arg_delayed_diags.c
// RUN: %clang_cc1 -fopenmp -x c -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm-bc %s -o %t-x86-host.bc // RUN: %clang_cc1 -verify -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only // R...
3d7pt_var.c
/* * Order-1, 3D 7 point stencil with variable coefficients * Adapted from PLUTO and Pochoir test bench * * Tareq Malas */ #include <stdio.h> #include <stdlib.h> #include <sys/time.h> #ifdef LIKWID_PERFMON #include <likwid.h> #endif #include "print_utils.h" #define TESTS 2 #define MAX(a,b) ((a) > (b) ? a : b) #...
IntegratorHPMCMonoImplicit.h
// Copyright (c) 2009-2017 The Regents of the University of Michigan // This file is part of the HOOMD-blue project, released under the BSD 3-Clause License. #ifndef __HPMC_MONO_IMPLICIT__H__ #define __HPMC_MONO_IMPLICIT__H__ #include "IntegratorHPMCMono.h" #include "hoomd/Autotuner.h" #include <random> #include <cf...
loop-6.c
/* { dg-do run } */ #include <omp.h> extern void abort (void); #define LLONG_MAX __LONG_LONG_MAX__ #define ULLONG_MAX (LLONG_MAX * 2ULL + 1) #define INT_MAX __INT_MAX__ int arr[6 * 5]; void set (int loopidx, int idx) { #pragma omp atomic arr[loopidx * 5 + idx]++; } #define check(var, val, loopidx, idx) \ if (...
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) **************************************...
gimplify.c
/* Tree lowering pass. This pass converts the GENERIC functions-as-trees tree representation into the GIMPLE form. Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Major work done by Sebastian Pop <s.pop@laposte.net>, Diego Novillo <dnovillo@redhat.com> a...
rkb_screen.c
/* * */ #include <stdlib.h> #include <string.h> #include <math.h> #include <complex.h> #include <assert.h> #include "cint.h" #include "cvhf.h" #include "fblas.h" #include "optimizer.h" #define MAX(I,J) ((I) > (J) ? (I) : (J)) #define LL 0 #define SS 1 #define SL 2 #define LS 3 int int2e_spinor(); int int2...
linalg.c
/* * linalg.c * Francesco Conti <f.conti@unibo.it> * * Copyright (C) 2015 ETH Zurich, University of Bologna * All rights reserved. * * This software may be modified and distributed under the terms * of the BSD license. See the LICENSE file for details. */ #include "linalg.h" #ifdef IPC_CONV16 #include "per...
data.h
/*! * Copyright (c) 2015 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 <rabit/rabit.h> #include <cstring> #include <memory> #include <numeric> #include <al...
omp_ex_15.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...
privatemissing-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...
compare.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
World.h
#ifndef __WORLD__H__ #define __WORLD__H__ #include <Eigen/Core> #include <Eigen/SparseCore> #include <Eigen/SparseCholesky> #include <vector> #include <set> #include <Eigen/Dense> #include "Constraint/ConstraintHeader.h" #include "../utils/collisionBrutal.h" #include "../constants.h" namespace FEM { // class Constra...
GB_unop__identity_int8_int8.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http://...
GB_binop__fmod_fp32.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
ApproxWeightPerfectMatching.h
// // ApproxWeightPerfectMatching.h // // // Created by Ariful Azad on 8/22/17. // // #ifndef ApproxWeightPerfectMatching_h #define ApproxWeightPerfectMatching_h #include "CombBLAS/CombBLAS.h" #include "BPMaximalMatching.h" #include "BPMaximumMatching.h" #include <parallel/algorithm> #include <parallel/numeric> #...
GB_unaryop__ainv_uint8_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...
DOMINOSEC_fmt_plug.c
/* * DOMINOSEC_fmt.c (version 3) * * Notes/Domino More Secure Internet Password module for Solar Designer's JtR * by regenrecht at o2.pl, Dec 2005. * Algorithm discovery by regenrecht at o2.pl, bartavelle at bandecon.com. * * Short description. * 1. Make 128bit digest of key. (128/8=16 bytes) * 2. Do bin2hex()...
gemm.c
#include "gemm.h" #include "utils.h" #include "im2col.h" #include "dark_cuda.h" #include <stdlib.h> #include <stdio.h> #include <math.h> #include <float.h> #include <string.h> #include <stdint.h> #ifdef _WIN32 #include <intrin.h> #endif #if defined(_OPENMP) #include <omp.h> #endif #define TILE_M 4 // 4 ops #define TIL...
mgl.h
/*************************************************************************** * mgl.h is part of Math Graphic Library * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru> * * * * This program is free software; you can redi...
barrier.c
/* * barrier.c -- Archer testcase */ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // // See tools/archer/LICENSE.txt for details. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===...
fileparse.c
/* Copyright (c) 2015 The University of Edinburgh. */ /* * This software was developed as part of the * EC FP7 funded project Adept (Project ID: 610490) * www.adept-project.eu */ /* Licensed under the Apache License, Version 2.0 (the...
ops.h
/******************************************************************************* * Copyright (c) 2015-2018 Skymind, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at * https://www.apache.org/licenses/LICENSE-2.0. * *...
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...
ssca2.c
/* ============================================================================= * * ssca2.c * * ============================================================================= * * For the license of bayes/sort.h and bayes/sort.c, please see the header * of the files. * * ---------------------------------------...
GB_binop__iseq_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...
convolutiondepthwisebnrelu_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 ...
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...
host_as_target.c
// Check that specifying device as omp_get_initial_device(): // - Doesn't cause the runtime to fail. // - Offloads code to the host. // - Doesn't transfer data. In this case, just check that neither host data nor // default device data are affected by the specified transfers. // - Works whether it's specified direct...
dgemm.c
#include "cblas.h" #include "dgemm_versions.h" #include <assert.h> #include <omp.h> #include <stdio.h> // #ifndef MYLIB_NUM_THREADS // #define MYLIB_NUM_THREADS 10 // #endif #define BLOCK_SIZE 2 #define min(a,b) \ ({ __typeof__ (a) _a = (a); \ __typeof__ (b) _b = (b); \ _a < _b ? _a : _b; }) void cb...
master.c
#include <stdio.h> #include <cmath> #include "../common.h" #include "kernel_fin.c" #include "kernel_ecc.h" #include "kernel_cam.h" void master( fp timeinst, fp *initvalu, fp *params, fp *finavalu, fp *com, long long *timecopyin, long long *timekernel, long long *timecopyout...
hailstone.c
#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <time.h> #include <errno.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <x86intrin.h> #include "hailstone.h" extern struct poly fpoly16[]; // flags int bflag = 0; uint32_t start_...
ztradd.c
/** * * @file * * PLASMA is a software package provided by: * University of Tennessee, US, * University of Manchester, UK. * * @precisions normal z -> s d c * **/ #include "plasma.h" #include "plasma_async.h" #include "plasma_context.h" #include "plasma_descriptor.h" #include "plasma_internal.h" #include ...
jacobi25_2d-p.pluto.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)) #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/time.h> #include...
GB_binop__iseq_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...
3d25pt.c
/* * Order-2, 3D 25 point stencil * Adapted from PLUTO and Pochoir test bench * * Tareq Malas */ #include <stdio.h> #include <stdlib.h> #include <sys/time.h> #ifdef LIKWID_PERFMON #include <likwid.h> #endif #include "print_utils.h" #define TESTS 2 #define MAX(a,b) ((a) > (b) ? a : b) #define MIN(a,b) ((a) < (b)...
if-clause.c
#include <stdio.h> #include <stdlib.h> #include <omp.h> int main(int argc, char **argv) { int i, n=20, tid, x; int a[n],suma=0,sumalocal; if(argc < 3) { fprintf(stderr,"Uso: \n %s <num-iteraciones> <num-hebras>\n", argv[0]); exit(-1); } n = atoi(argv[1]); if (n>20) n=20; for (i=0; i<n; i++) { a...
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...
GB_transpose.c
//------------------------------------------------------------------------------ // GB_transpose: C=A' or C=op(A'), with typecasting //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-License-Identifi...
ignored.c
// RUN: %compile-run-and-check #include <omp.h> #include <stdio.h> const int MaxThreads = 1024; int main(int argc, char *argv[]) { int cancellation = -1, dynamic = -1, nested = -1, maxActiveLevels = -1; #pragma omp target map(cancellation, dynamic, nested, maxActiveLevels) { // libomptarget-nvptx doesn't ...
owl_ndarray_pool_impl.h
/* * OWL - OCaml Scientific Computing * Copyright (c) 2016-2022 Liang Wang <liang@ocaml.xyz> */ #ifdef OWL_ENABLE_TEMPLATE CAMLprim value FUN_NATIVE (spatial) ( value vInput_ptr, value vOutput_ptr, value vBatches, value vInput_cols, value vInput_rows, value vIn_channel, value vKernel_cols, value vKernel_row...
GB_unop__sin_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...
deprecate.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
omp_nonmonotonic_dynamic1.c
// RUN: %libomp-compile // RUN: env OMP_SCHEDULE=nonmonotonic:dynamic,10 %libomp-run // The test checks iterations distribution for OMP 5.0 nonmonotonic OMP_SCHEDULE // case #threads > #chunks (fallback to monotonic dynamic) #include <stdio.h> #include <omp.h> #define ITERS 100 #define CHUNK 10 int err = 0; int mai...
Parser.h
//===--- Parser.h - C Language Parser ---------------------------*- C++ -*-===// // // 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 // //===---------------------------...
main.c
// // main.c // N-Body // // Authors: // Emanuele Del Sozzo (emanuele.delsozzo@polimi.it), Lorenzo Di Tucci (lorenzo.ditucci@polimi.it), // Marco Rabozzi (marco.rabozzi@polimi.it), Marco Nanni (marco3.nanni@mail.polimi.it) // #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include <...
example3.c
#include "multi_fbeam.h" #include <sys/stat.h> #include <errno.h> #include <png.h> typedef struct image_data{ char dir_name[64]; // directory name to output image int scale; // number for enlarge the output image int m; // sampling number double rang; // rang...
GB_binop__isgt_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...
quadrature_omp.c
#include "quadrature.h" #include <omp.h> double trapezoid(double (*fp)(double), double a, double b, int N) { double h = (b-a)/(N-1); double f_a, f_b, trapezoid = 0.0; // Perform the trapezoid rule #pragma omp parallel for reduction(+: trapezoid) for (int i = 0; i < N; ++i) { if (i == 0...
eaw-experimental.c
#include "eaw-experimental.h" #include "libdwt.h" #include "inline.h" #include <assert.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <limits.h> #ifdef _OPENMP #include <omp.h> #endif /** * @brief Copy memory area. * * This function copies @p n floats from memory area @p src to memory area ...
solucao_omp_barrier.c
/****************************************************************************** * FILE: omp_bug3.c * DESCRIPTION: * Run time error * AUTHOR: Blaise Barney 01/09/04 * LAST REVISED: 06/28/05 ******************************************************************************/ #include <omp.h> #include <stdio.h> #include <st...
scheduler-clause.c
/* * sheduler-clause.c * * Created on: 28/04/2014 * Author: Carlos de la Torre */ #include <stdio.h> #include <stdlib.h> #ifdef _OPENMP #include <omp.h> #else #define omp_get_thread_num() 0 #endif int main(int argc, char **argv) { int i, n = 20, a[n], suma = 0; if (argc < 2) { fprintf(stderr, "\nFalta...
mandelbrot_set.c
/** * Copyright (c) 2020 Eros Fabrici - eros.fabrici@gmail.com * 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, cop...
7786.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...
2.hello_firstprivate.c
#include <stdio.h> #include <omp.h> /* If the OMP_NUM_THREADS variable is set to 8 with */ /* export OMP_NUM_THREADS=8 */ /* Q1: Is the execution of the program correct? Add a */ /* data sharing clause to make it correct */ /* Q2: Are the lines always printed in the same...
compare.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
main.c
#include <stdio.h> #include <stdlib.h> #include <omp.h> #include <time.h> #include "../examples/openmp_dot_product/scalar/runner.h" int getMove(double p, unsigned int* seed) { return (rand_r(seed) / (double) RAND_MAX) < p ? -1 : 1; } struct context { int a, b, x, N, P; double p; int result, lifetime;...
DataAbstract.h
/***************************************************************************** * * Copyright (c) 2003-2018 by The University of Queensland * http://www.uq.edu.au * * Primary Business: Queensland, Australia * Licensed under the Apache License, version 2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Development unt...
quantize.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
LookupTable.h
#ifndef _LOOKUPTABLE_H_ #define _LOOKUPTABLE_H_ /* * LookupTable.h: * Lookup operation, for embeddings * * Created on: Apr 22, 2017 * Author: mszhang */ #include "SparseParam.h" #include "MyLib.h" #include "Alphabet.h" #include "Node.h" #include "Graph.h" #include "ModelUpdate.h" #include "profiler.h" ...
tensor_transpose.h
// Copyright (C) 2019. Huawei Technologies Co., Ltd. All rights reserved. // 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,...
GB_sparse_masker_template.c
//------------------------------------------------------------------------------ // GB_sparse_masker_template: R = masker (C, M, Z) where R is sparse/hyper //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. /...
acoPlacement.c
/*************************************************************************** Name : acoPlacement.c Version : 1.0 Author(s) : Panayiotis Danassis (panos_dan@hotmail.com) Date : May 6, 2015 Description : 3-D FPGA placement algorithm based on Ant Colony Optimization. ----------- Copyright (C...
matmul.c
//------------------------------------------------------------------------------------------------------------------------------ // Samuel Williams // SWWilliams@lbl.gov // Lawrence Berkeley National Lab //------------------------------------------------------------------------------------------------------------------...
bugged2.c
/****************************************************************************** * ЗАДАНИЕ: bugged2.c * ОПИСАНИЕ: * Еще одна программа на OpenMP с багом. ******************************************************************************/ #include <omp.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char **...
pbkdf2-hmac-sha1_fmt_plug.c
/* * This software is Copyright (c) 2013 magnum and it is hereby released to * the general public under the following terms: * Redistribution and use in source and binary forms, with or without * modification, are permitted. */ #if FMT_EXTERNS_H extern struct fmt_main fmt_pbkdf2_hmac_sha1; #elif FMT_REGISTERS_H j...
column_matrix.h
/*! * Copyright 2017 by Contributors * \file column_matrix.h * \brief Utility for fast column-wise access * \author Philip Cho */ #ifdef __ENCLAVE_OBLIVIOUS__ #include "column_matrix_obl.h" #else #ifndef XGBOOST_COMMON_COLUMN_MATRIX_H_ #define XGBOOST_COMMON_COLUMN_MATRIX_H_ #include <limits> #include <vector> #...
par_csr_matop.c
/*BHEADER********************************************************************** * Copyright (c) 2017, Lawrence Livermore National Security, LLC. * Produced at the Lawrence Livermore National Laboratory. * Written by Ulrike Yang (yang11@llnl.gov) et al. CODE-LLNL-738-322. * This file is part of AMG. See files READ...
update_ops_matrix_dense_multi.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include "constant.h" #include "update_ops.h" #include "utility.h" #ifdef _OPENMP #include <omp.h> #endif #ifdef _MSC_VER #include <intrin.h> #else #include <x86intrin.h> #endif //void multi_qubit_dense_matrix_gate_old_single(const UINT* t...
ten_tusscher_2004_RS_CPU_epi_S0.c
// Original Ten Tusscher - Scenario 0 #include <assert.h> #include <stdlib.h> #include "ten_tusscher_2004_epi_S0.h" GET_CELL_MODEL_DATA(init_cell_model_data) { assert(cell_model); if(get_initial_v) cell_model->initial_v = INITIAL_V; if(get_neq) cell_model->number_of_ode_equations = NEQ; ...
ep.c
//-------------------------------------------------------------------------// // // // This benchmark is an OpenMP C version of the NPB EP code. This OpenMP // // C version is developed by the Center for Manycore Programming at Seoul // // Nati...
Lyra2.c
/** * Implementation of the Lyra2 Password Hashing Scheme (PHS). * * Author: The Lyra PHC team (http://www.lyra2.net/) -- 2015. * * This software is hereby placed in the public domain. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ...