source
stringlengths
3
92
c
stringlengths
26
2.25M
test.c
#include <stdio.h> #include <omp.h> #pragma omp requires unified_shared_memory #include "../utilities/check.h" #include "../utilities/utilities.h" #define TRIALS (1) #define N (992) #define INIT() INIT_LOOP(N, {C[i] = 1; D[i] = i; E[i] = -i;}) #define ZERO(X) ZERO_ARRAY(N, X) int main(void) { check_offloading...
HGEMM_v1.h
#include <iostream> #include <math.h> #include <float.h> #include <assert.h> #include <string.h> #include <stdio.h> #include <stdint.h> #include <cholUtils.h> #ifndef HALIDE_ATTRIBUTE_ALIGN #ifdef _MSC_VER #define HALIDE_ATTRIBUTE_ALIGN(x) __declspec(align(x)) #else #define HALIDE_ATTRIBUTE_ALIGN(x) __attri...
AntOMP.c
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #include<time.h> #include<omp.h> double dist[48][48]; double aleatorioEntero(int li, int ls); double aleatorio(); int probabilidad(double visi[], double fero[], int vector[], int cities); void gettingMatrix(); void printMatrix(); ...
gbdt.h
/*! * Copyright (c) 2016 Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See LICENSE file in the project root for license information. */ #ifndef LIGHTGBM_BOOSTING_GBDT_H_ #define LIGHTGBM_BOOSTING_GBDT_H_ #include <LightGBM/boosting.h> #include <LightGBM/objective_function.h> #include...
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...
array_sections-4.c
/* { dg-do run } */ #include <stdlib.h> void foo () { int A[30], *p; #pragma omp target data map(A[0:10]) { p = &A[0]; #pragma omp target map(p[3:7]) map(A[0:10]) { A[2] = 777; A[8] = 777; p[8] = 999; } } if (A[2] != 777 || A[8] != 999) abort (); } int main () { foo (); ...
Matrix.h
#ifndef MATRIX_H_ #define MATRIX_H_ #include "../Toolbox.h" #include "../Serializable.h" #include "KTuple.h" #include <string.h> #include <stdio.h> #include <string> #include <sys/mman.h> #include <cmath> #include <type_traits> #ifdef LINUX #include <clocale> #endif #ifdef OSX #include <locale.h> #endif namespace ...
cityblock.c
#include <math.h> void cbdm(double *a, double *b, double *r, int num_rows, int num_cols) { double _r = 0.0; #pragma omp parallel for reduction (+:_r) for(int i = 0; i < num_rows; i++) { for(int j = 0; j < num_rows ; j++) { _r = 0.0; for(int k = 0; k < num_cols ; k++) { ...
csr_matop.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) **************************************...
convolution_3x3_pack4.h
// Tencent is pleased to support the open source community by making ncnn available. // // Copyright (C) 2022 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_unaryop__minv_int32_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...
pcptdesdecryptcfbcaomp.c
/******************************************************************************* * Copyright 2002-2018 Intel Corporation * All Rights Reserved. * * If this software was obtained under the Intel Simplified Software License, * the following terms apply: * * The source code, information and material ("Material") co...
GB_binop__first_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...
pt_to_pt_pingping.c
/***************************************************************************** * * * Mixed-mode OpenMP/MPI MicroBenchmark Suite - Version 1.0 * * * * ...
DRB016-outputdep-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...
symm_x_coo_u_lo_row.c
#include "alphasparse/kernel.h" #include "alphasparse/util.h" #define CACHELINE 64 alphasparse_status_t ONAME(const ALPHA_Number alpha, const ALPHA_SPMAT_COO *mat, const ALPHA_Number *x, const ALPHA_INT columns, const ALPHA_INT ldx, const ALPHA_Number beta, ALPHA_Number *y, const ALPHA_INT ldy) { ALPHA_INT m = mat...
opi.c
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <omp.h> int main(int argc, char **argv) { //seed random number generator // Q2b: get the number of threads to run with from agrv and // add OpenMP API code to set number of threads here int Nthreads = atoi(argv[1]); omp_set_num_threads(Nthrea...
rom_builder_and_solver.h
// | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: Riccardo Rossi // ...
rose_slowInput.c
#include "omp.h" typedef double real8; /************************************************************************ * Function : StressZero * * Purpose : ************************************************************************/ void StressZero(real8 *newSxx,real8 *newSyy,real8 *newSzz,real8 *newTxy,real8 *newTx...
sharpen_AVX.c
#include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <fcntl.h> #include <immintrin.h> typedef float FLOAT; // Cycle Counter Code // // Can be replaced with ippGetCpuFreqMhz and ippGetCpuClocks // when IPP core functions are available. // typedef unsigned int UINT32; typedef unsign...
task1_omp.c
#include <math.h> #include <string.h> #include "timer.h" #include <stdio.h> #define NN 1024 #define NM 1024 float A[NN][NM]; float Anew[NN][NM]; int main(int argc, char** argv) { int i,j; const int n = NN; const int m = NM; const int iter_max = 1000; const double tol = 1.0e-6; double err...
func.c
#include <stdio.h> int jac_seq(int N, double delta, double threshold, int max_iter, double *f, double *u, double *u_old) { int i,j,k=0; double *temp,d=10e+10; while (k < max_iter) { // Set u_old = u temp = u; u = u_old; u_old = temp; // Set distance = 0.0 d = 0.0; for (i = 1; i < N-1; i++)...
conv3x3s1_winograd64_pack4_neon_BdB.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 ...
GB_unaryop__abs_int32_int8.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http...
decl.c
/* Process declarations and variables for -*- C++ -*- compiler. Copyright (C) 1988-2020 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as...
core_slange.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_zlange.c, normal z -> s, Fri Sep 28 17:38:21 2018 * **/ #include <plasma_core_blas.h> #include "pla...
Tutorial.h
//================================================================================================= /*! // \file blaze/Tutorial.h // \brief Tutorial of the Blaze library // // Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or m...
trmv_c_csr_u_lo_conj.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> static alphasparse_status_t trmv_x_csr_u_lo_conj_omp(const ALPHA_Number alpha, ...
GrB_Matrix_ncols.c
//------------------------------------------------------------------------------ // GrB_Matrix_ncols: number of columns of a sparse matrix //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX-License-Ide...
lu.c
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdint.h> #include <math.h> #include "nb/math_bot.h" #include "nb/memory_bot.h" #include "nb/container_bot.h" #include "nb/graph_bot.h" #include "nb/solver_bot.h" #include "../sparse_struct.h" #include "cholesky_symbolic.h" int nb_sparse_alloc_LU(c...
BPMaximalMatching.h
#include "../CombBLAS.h" #include <mpi.h> #include <sys/time.h> #include <iostream> #include <functional> #include <algorithm> #include <vector> #include <string> #include <sstream> #include "Utility.h" #define NO_INIT 0 #define GREEDY 1 #define KARP_SIPSER 2 #define DMD 3 using namespace std; MTRand GlobalMT(123); //...
csr_graph.h
#pragma once #include <cassert> #include <fstream> #include <sstream> #include <fcntl.h> #include <iostream> #include <unistd.h> #include <algorithm> #include <sys/mman.h> #include "common.h" #include "custom_alloc.h" class VertexSet { private: VertexId *ptr; VertexId size_; public: VertexSet() : size_(0) {} V...
GB_binop__pair_int64.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX...
sum_int.c
//sum.c #include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/timeb.h> #include <malloc.h> #define N_RUNS 20 #define N 10240000 // read timer in second double read_timer() { struct timeb tm; ftime(&tm); return (double) tm.time + (double) tm.millitm / 1000.0; } //Create a matrix and a vec...
test35.c
#include<stdio.h> int foo () { printf("Start Foo.\n"); printf("End Foo.\n"); return 0; } int main() { int a; #pragma omp parallel { if (!omp_get_thread_num()) { #pragma omp critical { printf("Hello World\n"); sleep(3); printf("Why are you so weird, world?\n", a); } } else { int i; for (...
counting.c
#include <stdio.h> #include <stdlib.h> #include <limits.h> #include <omp.h> #include <math.h> #define min(a,b) (((a)<(b))?(a):(b)) #define MIN(a,b) (((a)<(b))?(a):(b)) #define max(a,b) (((a)>(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) #define floord(n,d) floor(((double)(n))/((double)(d))) #define ceild(n,d) ce...
7434.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...
pr58551.c
/* PR middle-end/58551 */ /* { dg-do compile } */ /* { dg-options "-O0 -fopenmp" } */ void foo (int *a) { int i; for (i = 0; i < 8; i++) #pragma omp task if (a[i]) __builtin_abort (); } void bar (int, int); void baz (int *a) { int i; for (i = 0; i < 8; i++) #pragma omp task if (a[i]) ...
dfa8.c
#include <stdio.h> #include <stdint.h> #include <string.h> #include "dfa.h" #ifdef _OPENMP #include "omp.h" #endif void r8_get_diffMC(const int col8, const word32 diff_col, const int col9, word32 diffMC_list[DIFF_MC_MAX], int *len) { int i, c1, c2, diff; int fault_list[255]; int fault_list_le...
alt_veclib.c
#include <stdio.h> #include <omp.h> int main(void) { int isHost = 1; #pragma omp target map(tofrom: isHost) { isHost = omp_is_initial_device(); printf("Hello world. %d\n", 100); for (int i =0; i<5; i++) { printf("Hello world. iteration %d\n", i); } } printf("Target region executed on t...
test83.c
struct { int a;} b; int foo(int a, int b) { return a; } int bar(int a, int b) { return b; } void pr(char * str) {} int main() { int y = 10; int i[4]; int a = 10; int (*fptr[4])(int, int); int p[4]; p[3] = 0; fptr[3] = &foo; pr("Below"); i[3] = fptr[3](a * 10, bar(2, p[3])); #pragma omp parallel { } }
matrix_mul_openmp.c
#include <stdio.h> #include <math.h> #include <stdlib.h> #include <omp.h> /* Simple matrix multiplication example. */ /* matrix multiplication */ void matrix_mult(int const N, int const M, int const K, double A[N][M], double B[M][K], double C[N][K]) { for(int i = 0; i < N; i++) { for(int j = 0; j < K; j++) { ...
par_mgr.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) **************************************...
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. * *...
BlockProcessor.h
// File : BlockProcessor.h // Date : Fri 01 Apr 2016 05:52:01 PM CEST // Author : Fabian Wermelinger // Description: Process all blocks // Copyright 2016 ETH Zurich. All Rights Reserved. #ifndef BLOCKPROCESSORMPI_H_IKFSZWUJ #define BLOCKPROCESSORMPI_H_IKFSZWUJ #include <vector> #ifdef _OPENMP #include ...
GB_unaryop__abs_int8_uint32.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
dataracetest1.c
int main() { double a[10]; #pragma omp parallel for for(int i=1;i<4;i++) { a[i]=a[i+1]; } return 0; }
seramp.c
#include<Python.h> #include<numpy/arrayobject.h> #include<math.h> #include<omp.h> #define IND(a,i) *((double *)(a->data+i*a->strides[0])) static PyObject *seramp(PyObject *self, PyObject *args, PyObject *keywds); static PyObject *seramp(PyObject *self, PyObject *args, PyObject *keywds) { PyObject *etc; PyArrayOb...
mandelSSEDD.c
#include <immintrin.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> #include "mandelSSEDD.h" /* es können 2 DD auf einmal bearbeitet werden, d.h. in einem Register stehen 2 hi, im anderen die 2 lo */ DD2 DD2_mul(const DD2 pDD1, const DD2 pDD2) { const __m128d hi = pDD1.hi; ...
reduction-clause.c
#include <stdio.h> #include <stdlib.h> #ifdef _OPENMP #include <omp.h> #else #define omp_get_thread_num() 0 #endif main(int argc, char **argv) { int i, n=20, a[n],suma=10; if(argc < 2) { fprintf(stderr,"Falta iteraciones\n"); exit(-1); } n = atoi(argv[1]); if (n>20) { n=20; printf("n=%d",...
GeneralMatrixMatrix.h
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file...
plot.h
#ifndef OPENMC_PLOT_H #define OPENMC_PLOT_H #include <unordered_map> #include <sstream> #include "pugixml.hpp" #include "xtensor/xarray.hpp" #include "hdf5.h" #include "openmc/position.h" #include "openmc/constants.h" #include "openmc/cell.h" #include "openmc/geometry.h" #include "openmc/particle.h" #include "openmc...
builder.h
// Copyright (c) 2015, The Regents of the University of California (Regents) // See LICENSE.txt for license details #ifndef BUILDER_H_ #define BUILDER_H_ #include <algorithm> #include <cinttypes> #include <fstream> #include <functional> #include <type_traits> #include <utility> #include "command_line.h" #include "ge...
Stmt.h
//===--- Stmt.h - Classes for representing statements -----------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
GeneralMatrixMatrix.h
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file...
7633.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...
3d25pt_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 25 point stencil with axis-symmetric ariable coefficients * Adapted fr...
rose_scalar_privatization.c
/* a local variable to transfer temp value * It introduces "fake" data dependence since the variable is local to each iteration * */ #include "omp.h" int a[100]; int b[100]; void foo() { int i; #pragma omp parallel for private (i) for (i = 0; i <= 99; i += 1) { int tmp; tmp = a[i] + i; b[i] = tmp...
cpu_ctc.h
#pragma once #include <tuple> #include <cmath> #include <limits> #include <algorithm> #include <numeric> #if !defined(CTC_DISABLE_OMP) && !defined(APPLE) #include <omp.h> #endif #include "ctc_helper.h" template<typename ProbT> class CpuCTC { public: // Noncopyable CpuCTC(int alphabet_size, int minibatch, v...
app_baseline.c
/** * @file app.c * @brief Template for a Host Application Source File. * */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <unistd.h> #include <getopt.h> #include <assert.h> #include <stdint.h> #include <omp.h> #include "../../support/timer.h" static uint64_t *A; static uint6...
arrayInStruct_openMP.c
#include "arrayInStruct_openMP.h" void arrayInStruct__openMP(struct awl_unsignedS32 * v0, struct awl_unsignedS32 * out) { struct s_2_1xunsignedS32_1xawl_unsignedS32 e0 = { 0 }; struct s_2_1xunsignedS32_1xawl_unsignedS32 v6 = { 0 }; bool v3; (e0).member1 = (*v0).length; ((e0).member2).buffer = initCopyArr...
Triangular_BCSC.h
// // Created by kazem on 7/17/17. // #ifndef TRIANGOPENMP_TRIANGULAR_H #define TRIANGOPENMP_TRIANGULAR_H #include <cassert> #include "BLAS.h" #include "mkl.h" namespace nasoq { #define MKL_BLAS /* * Forward solve blocked */ int blockedLsolve(int n, size_t *Lp, int *Li, double *Lx, int NNZ, si...
GB_binop__eq_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-...
image.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
sparse_matrix_multiplication_utility.h
// | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: Vicente Mataix Ferrandiz // #if !defined(KRATOS_...
lastprivate-clause.c
#include <stdio.h> #ifdef _OPENMP #include <omp.h> #else #define omp_get_thread_num()0 #endif main(){ int i,n=7; int a[n], v; for(i=0;i<n;i++) a[i]=i+1; #pragma omp parallel for lastprivate(v) for(i=0; i<n; i++){ v=a[i]; printf ("thread %d v=%d\n ",omp_get_thread_num(),v); } print...
Solver.h
#pragma once #include <iostream> #include "common.h" #include "Loss.h" #include "Prox.h" namespace solvers { class Solver { public: Solver(const size_t nfeatures, const std::string& loss, const std::string& prox = "none", const Double proxWeight = 0) : nfeatures_(nfeatures), ...
mrcore.c
/*************************************************************************** * Copyright 2013 CertiVox UK Ltd. * * This file is...
GB_unaryop__minv_bool_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...
normal.c
/* ============================================================================= * * normal.c * -- Implementation of normal k-means clustering algorithm * * ============================================================================= * * Author: * * Wei-keng Liao * ECE Department, Northwestern University * ...
omp_parfor.c
#include <omp.h> #include <stdio.h> #include <time.h> double CLOCK() { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); return (t.tv_sec * 1000) + (t.tv_nsec * 1e-6); } main(int argc, char **argv) { unsigned int i; double start, finish, total1, total2, total3; double a[1000000]; sta...
sieve.c
/* * Adapted from: http://w...content-available-to-author-only...s.org/sieve-of-eratosthenes */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <math.h> int sieveOfEratosthenes(int n) { // Create a boolean array "prime[0..n]" and initialize // all entries it as...
DenseVector.h
//================================================================================================= /*! // \file blaze/math/smp/openmp/DenseVector.h // \brief Header file for the OpenMP-based dense vector SMP implementation // // Copyright (C) 2012-2018 Klaus Iglberger - All Rights Reserved // // This file is part ...
test9.c
void foo (int a) { 0; if (1) { 2; #pragma omp barrier 3; } else { 4; foo(3); 5; } } int main() { #pragma omp parallel { 6; if (7) { 8; foo(9); 10; } else { 11; #pragma omp barrier 12; #pragma omp barrier 13; } 14; #pragma omp barrier 15; } }
rose_shared.c
/* * dependence graph: */ #include "omp.h" void foo() { int i; int x; int a[100]; #pragma omp parallel for private (i) for (i = 0; i <= 99; i += 1) { a[i] = a[i] + 1; } } /* non loop carried anti dependence for array accesses : level =1 > 0 dep SgExprStatement:a[i] =((a[i]) + 1); SgExprStatemen...
omp_private.c
/* This file shows the problems with private variables which its value is NOT * copied. It also shows how the "firstprivate" directive can help with that. * * Code adapted from Introduction to Parallel Programming by Peter Pacheco. */ #include <stdio.h> #include <stdlib.h> #include <omp.h> int main(int argc, c...
nary-search.c
#include <stdio.h> #include <math.h> #include <omp.h> void main() { int sep[20], array[20], key, i, j, n, left, right, size, interval, index, break_value = 0, tid; printf("Enter the size of array\n"); scanf("%d", &size); printf("Enter the elements of array in ascending order\n"); for (i = 0; i < si...
RCCE_lib.h
// // Copyright 2010 Intel 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 app...
ast-dump-openmp-section.c
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -ast-dump %s | FileCheck --match-full-lines -implicit-check-not=openmp_structured_block %s void test() { #pragma omp sections { #pragma omp section ; } } // CHECK: TranslationUnitDecl {{.*}} <<invalid sloc>> <invalid sloc> // CHECK: `-FunctionDecl {{....
4-3t.c
#include <stdio.h> #include <omp.h> int main() { int i; omp_set_num_threads(3); #pragma omp parallel for for (i=0; i<16; i++) { printf("Hello from thread number: %d Iteration: %d \n", omp_get_thread_num(), i); } printf("\n GoodBye – Team Destroyed – Exiting Program \n...
exercise7.c
/* * BSD 2-Clause License * * Copyright (c) 2020, Alessandro Capotondi * 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 source code must retain the above copyri...
mass_matrix.h
/** * @author : Zhao Chonyyao (cyzhao@zju.edu.cn) * @date : 2021-04-30 * @description: mass matrix for finite element method. * @version : 1.0 */ #ifndef MASS_MATRIX_H #define MASS_MATRIX_H #include <Eigen/Dense> #include <Eigen/Sparse> #include <iostream> #include <vector> #include "Common/eigen_ext...
8240.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...
laplace2d.c
/* * Copyright 2012 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 ...
ASTMatchers.h
//===- ASTMatchers.h - Structural query framework ---------------*- 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 // //===---------------------------...
gi_regular_grid_trilinear_function_uncached.h
/* * * Copyright (C) 2018 Attila Gyulassy <jediati@sci.utah.edu> * All rights reserved. * * This software may be modified and distributed under the terms * of the BSD license. See the LICENSE file for details. */ #ifndef REGULAR_GRID_TRILINEAR_FUNCTION_UNCACHED #define REGULAR_GRID_TRILINEAR_FUNCTION_UNCACHED #inclu...
ellipticSEMFEMSetup.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 limitatio...
otfft_misc.h
// Copyright (c) 2015, OK おじさん(岡久卓也) // Copyright (c) 2015, OK Ojisan(Takuya OKAHISA) // Copyright (c) 2017 to the present, DEWETRON GmbH // OTFFT Implementation Version 9.5 // based on Stockham FFT algorithm // from OK Ojisan(Takuya OKAHISA), source: http://www.moon.sannet.ne.jp/okahisa/stockham/stockham.html #pragma...
test.c
#include <stdio.h> #include "../utilities/check.h" #define N 100 int main() { check_offloading(); // Initialisation int fail = 0; int error = 0; int a[N]; int b[N]; /* * Atomics update (implicit) */ // Initialise a[0] = 0; // Execute #pragma omp target map(tofrom: a[:1]) { #pragma om...
vednnConvolutionBackwardData.c
#include "vednnConvolutionBackwardData.h" #include <stdint.h> #ifdef VEDNN_USE_OPENMP #include <omp.h> extern int __vednn_omp_num_threads ; #endif static inline vednnError_t vednnConvolutionBackwardData_wrapper( vednnConvBackwardData_t pFunc, const vednnTensorParam_t *pParamGradOut, const void *pD...
nanort.h
// // NanoRT, single header only modern ray tracing kernel. // // // Notes : The number of primitives are up to 2G. If you want to render large // data, please split data into chunks(~ 2G prims) and use NanoSG scene graph // library(`${nanort}/examples/nanosg`). // /* The MIT License (MIT) Copyright (c) 2015 - 2019 ...
kmeans.h
#ifndef SRC_CLUSTERING_KMEANS_H_ #define SRC_CLUSTERING_KMEANS_H_ #include "clustering/kmeans_trait.h" #include "util/alignment.h" #include <limits> #include <random> #include <vector> namespace GraphSfM { /** * @brief Kind of initialization of the kmeans centers */ enum class KMeansInitType { KMEANS_INIT_RANDO...
softmax_hcl_arm.c
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * License); you ma...
hello_world_omp.c
#include <omp.h> #include <stdio.h> int main(int *argc, char *argv[]) { #pragma omp parallel { printf("Hello world!\n"); } return 0; }
bubble_helper_progs.c
#include "Parameter_files/INIT_PARAMS.H" #include "Parameter_files/ANAL_PARAMS.H" void HII_filter(fftwf_complex *box, int filter_type, float R){ int n_x, n_z, n_y; float k_x, k_y, k_z, k_mag, k_mag_x, k_mag_y,kR; #pragma omp parallel shared(box, filter_type, R) private(k_x, k_y, k_z, k_mag, k_mag_x, k_mag_y, kR,...
cffi.c
#include <stdbool.h> #include <stdio.h> #include <math.h> #include <inttypes.h> // Check little or big endian // Linux (32- or 64-bit) is probably little endian bool endian(void) { // https://stackoverflow.com/questions/12791864/c-program-to-check-little-vs-big-endian volatile uint32_t i=0x01234567; // ret...
eavlSourceTopologySparseMapOp.h
// Copyright 2010-2014 UT-Battelle, LLC. See LICENSE.txt for more information. #ifndef EAVL_SOURCE_TOPOLOGY_SPARSE_MAP_OP_H #define EAVL_SOURCE_TOPOLOGY_SPARSE_MAP_OP_H #include "eavlCUDA.h" #include "eavlCellSet.h" #include "eavlCellSetExplicit.h" #include "eavlCellSetAllStructured.h" #include "eavlDataSet.h" #inclu...
matvec_int.c
//matvec.c //Multiplies a matrix by a vector #include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/timeb.h> #include <malloc.h> #define N_RUNS 1000 #define N 1200 // read timer in second double read_timer() { struct timeb tm; ftime(&tm); return (double) tm.time + (double) tm.millitm / 100...
convolution_sgemm_pack1ton_fp16s.h
// Tencent is pleased to support the open source community by making ncnn available. // // Copyright (C) 2021 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 ...
convolution_7x7_pack1ton.h
// Tencent is pleased to support the open source community by making ncnn available. // // Copyright (C) 2021 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 ...