source
stringlengths
3
92
c
stringlengths
26
2.25M
cancel_worksharing.c
// RUN: %libomp-compile && env OMP_CANCELLATION=true %libomp-run | %sort-threads | FileCheck %s // REQUIRES: ompt // Current GOMP interface implementation does not support cancellation; icc 16 does not distinguish between sections and loops // XFAIL: gcc, icc-16 #include "callback.h" #include <unistd.h> int main() { ...
explicit_task.c
// RUN: %libomp-compile-and-run | %sort-threads | tee %s.out | FileCheck %s // REQUIRES: ompt // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7 #define TEST_NEED_PRINT_FRAME_FROM_OUTLINED_FN #include "callback.h" #include <omp.h> int main() { int condition=0; omp_set_nested(0); print_frame(0); #pragma omp parallel n...
quadtree.h
#pragma once #include "common.h" #include <vector> #include <queue> #include <iostream> #include <string> #include <omp.h> struct quadnode; typedef quadnode* nodeptr; struct quadnode { nodeptr child[4]; double centerx, centery, xmin, xmax, ymin, ymax, totalMass = 0; particleptr within = NULL; int npar = 0; std::...
convolution_1x1_int8.h
// BUG1989 is pleased to support the open source community by supporting ncnn available. // // author:BUG1989 (https://github.com/BUG1989/) Long-term support. // author:FuGuangping (https://github.com/fu1899) Implemented the first version of INT8 quantization on ARMv7. // // Copyright (C) 2019 BUG1989. All rights reser...
5-4t.c
#include <stdio.h> #include <omp.h> int main() { int i; int sum=0; omp_set_num_threads(4); #pragma omp parallel for for (i=0; i<COUNT; i++) { sum = sum + i; printf("Thread number: %d Iteration: %d Local Sum: %d \n", omp_get_thread_num(), i, sum); } printf("\...
bench.c
#include "omp.h" #include "pmsis.h" #define LOOP_ITER (2048) #define NB_ITER (256) #define NB_BARRIER_ITER (256) #define NB_ITER_SINGLE (128) #define CORE_ID pi_core_id() #define PRINTF(...) //#define PRINTF(...) printf(__VA_ARGS__) static void start_timer() { pi_perf_cl_reset(); pi_perf_conf(1<<PI_PERF_CYC...
GB_binop__eq_uint32.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http:...
valid.yolo9.src.h
#pragma once #include "ukr.h" #include "omp.h" #include "transpose.h" #include "gen_ukr_A6B2gemm_1_1024_17_17_512_3_3.h" #include "gen_ukr_A1B2gemm_1_1024_17_17_512_3_3.h" void testrun(float* A ,float*B, float*C, float*oriB ){ int tid = omp_get_thread_num(); int Nx = 17; int Ny = 17; int Nh = 3; long lo...
sph_compute.h
#ifndef SPH_COMPUTE_H #define SPH_COMPUTE_H #pragma omp declare simd double w_bspline_3d(double r, double h); double w_bspline_3d_constant(double h); #pragma omp declare simd double w_bspline_3d_simd(double q); #pragma omp declare simd double dwdq_bspline_3d_simd(double q); #define w_bspline_3d_LUT(q) w_bspline_3d...
ast-dump-openmp-teams.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 target #pragma omp teams ; } // CHECK: TranslationUnitDecl {{.*}} <<invalid sloc>> <invalid sloc> // CHECK: `-FunctionDecl {{.*}} <{{.*}}ast...
vertical_grid.c
/* This source file is part of the Geophysical Fluids Modeling Framework (GAME), which is released under the MIT license. Github repository: https://github.com/OpenNWP/GAME */ /* This file contains functions that compute properties of the vertical grid. */ #include <stdlib.h> #include <stdio.h> #include <math.h> #inc...
quicksort.h
// -*- C++ -*- // Copyright (C) 2007-2019 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms // of the GNU General Public License as published by the Free Software // Foundation; either version 3...
GB_AxB_saxpy3.c
//------------------------------------------------------------------------------ // GB_AxB_saxpy3: compute C=A*B, C<M>=A*B, or C<!M>=A*B in parallel //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http:/...
GB_binop__rminus_uint64.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
teams.c
#include <stdio.h> #include <omp.h> #define HOST_MAX_TEAMS 70000 #define TRIALS (1) #define N (HOST_MAX_TEAMS+92) int A[N], B[N], C[N], D[N], E[N]; int main(void) { int fail = 0; // // Test: num_teams and omp_get_team_num() // for (int i = 0; i < N; i++) { A[i] = 0; B[i] = 0; C[i] = 1; D...
SpatialConvolutionMap.c
#ifndef TH_GENERIC_FILE #define TH_GENERIC_FILE "generic/SpatialConvolutionMap.c" #else static int nn_(SpatialConvolutionMap_updateOutput)(lua_State *L) { THTensor *input = luaT_checkudata(L, 2, torch_Tensor); int kW = luaT_getfieldcheckint(L, 1, "kW"); int kH = luaT_getfieldcheckint(L, 1, "kH"); int dW = luaT_...
omp_hello.c
/****************************************************************************** * FILE: omp_hello.c * DESCRIPTION: * OpenMP Example - Hello World - C/C++ Version * In this simple example, the master thread forks a parallel region. * All threads in the team obtain their unique thread number and print it. * The m...
omp_smithW-v3-master-ompfor.c
/********************************************************************************* * Smith–Waterman algorithm * Purpose: Local alignment of nucleotide or protein sequences * Authors: Daniel Holanda, Hanoch Griner, Taynara Pinheiro * * Compilation: gcc omp_smithW.c -o omp_smithW -fopenmp -DDEBUG // debuggin...
imginputfileconn.h
/** * DeepDetect * Copyright (c) 2014 Emmanuel Benazera * Author: Emmanuel Benazera <beniz@droidnik.fr> * * This file is part of deepdetect. * * deepdetect 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 F...
graph_generator.c
/* Copyright (C) 2009-2010 The Trustees of Indiana University. */ /* */ /* Use, modification and distribution is subject to the Boost Software */ /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ /* http:...
SpatialMaxUnpooling.c
#include <string.h> #include "../thnets.h" int nnload_SpatialMaxUnpooling(struct module *mod, struct nnmodule *n) { struct table *t = n->table; mod->type = MT_SpatialMaxUnpooling; mod->updateOutput = nn_SpatialMaxUnpooling_updateOutput; struct SpatialMaxUnpooling *m = &mod->SpatialMaxUnpooling; m->poolin...
GB_unop__creal_fp32_fc32.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...
LILCSR.h
//***************************************************************************** //Title :PANSFEM2/LinearAlgebra/Models/LILCSR.h //Author :Tanabe Yuta //Date :2019/11/29 //Copyright :(C)2019 TanabeYuta //***************************************************************************** #pragma once #include <iostream> #i...
ex9.c
#include <stdio.h> #include <stdlib.h> #include <omp.h> #include "timer.h" int main(int argc, char const *argv[]) { unsigned long long num_steps; int T; int i; double step; double x; double pi; double sum = 0.0; double tempo, fim, inicio; num_steps = atoll(argv[1]); T = atoi(argv[2]); printf("Num steps=%lld...
hmm.c
/* * Copyright (C) 2017 by Benedict Paten (benedictpaten@gmail.com) * * Released under the MIT license, see LICENSE.txt */ #include "margin.h" // OpenMP #if defined(_OPENMP) #include <omp.h> #define CELL_BUFFER_SIZE 1000 #endif inline double logAddP(double a, double b, bool maxNotSum) { /* * Local funct...
GB_binop__cmplx_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-...
GB_binop__copysign_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...
NeighborhoodGraph.h
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #ifndef _SPTAG_COMMON_NG_H_ #define _SPTAG_COMMON_NG_H_ #include "../VectorIndex.h" #include "CommonUtils.h" #include "Dataset.h" #include "FineGrainedLock.h" #include "QueryResultSet.h" #include <chrono> #include <queue...
pdf_fmt_plug.c
/* PDF cracker patch for JtR. Hacked together during Monsoon of 2012 by * Dhiru Kholia <dhiru.kholia at gmail.com> . * * This software is Copyright (c) 2012, Dhiru Kholia <dhiru.kholia at gmail.com> * * Uses code from Sumatra PDF and MuPDF which are under GPL * * Edited by Shane Quigley 2013 */ #if FMT_EXTERNS...
advectionMain.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...
run_fft_omp.c
#include "fft.h" #include <omp.h> #define MASTER 0 #define NTHREADS 8 int main(int argc, char* argv[]) { int_t len = 0, reps = 0; #ifdef N len = (int_t) N; #else if(argc > 1) { len = (int_t) atoi(argv[1]); } else { fprintf(stderr, "ERR...
hello-1.c
/* * test the simplest case, no variable handling By C. Liao */ #include <stdio.h> #ifdef _OPENMP #include <omp.h> #endif int main(void) { #pragma omp parallel { printf("Hello,world!"); } return 0; }
countsort-parallel.c
#include <omp.h> #include <stdio.h> #include <stdlib.h> #include <string.h> /// Function that sorts a vector `a` of size `n` double count_sort(double a[], int n, int nt) { int i, j, count; double *temp; double start, end, duracao; temp = (double *)malloc(n * sizeof(double)); start = omp_get_wtime(); #pragm...
IndexedFaceMesh.h
#ifndef __INDEXEDFACEMESH_H__ #define __INDEXEDFACEMESH_H__ #include <vector> #include "Common/Common.h" #include <iterator> namespace Utilities { class IndexedFaceMesh { public: struct Edge { unsigned int m_face[2]; unsigned int m_vert[2]; }; struct Face { unsigned int *m_edges; }; // Sto...
blas.c
#include "blas.h" #include "utils.h" #include <math.h> #include <assert.h> #include <float.h> #include <stdio.h> #include <stdlib.h> #include <string.h> void reorg_cpu(float *x, int out_w, int out_h, int out_c, int batch, int stride, int forward, float *out) { int b,i,j,k; int in_c = out_c/(stride*stride); ...
BsplineFunctor.h
////////////////////////////////////////////////////////////////////////////////////// // This file is distributed under the University of Illinois/NCSA Open Source License. // See LICENSE file in top directory for details. // // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers. // // File developed by: John R. G...
cofold.c
/* * minimum free energy * RNA secondary structure prediction * * c Ivo Hofacker, Chrisoph Flamm * original implementation by * Walter Fontana * * Vienna RNA package */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #i...
sms4speed.c
/* ==================================================================== * Copyright (c) 2014 - 2017 The GmSSL Project. 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. Redistribution...
el2d_openmp.c
#include<stdio.h> #include"2d_lib.c" // vx void el2d_openmp(double *vx, int BD_nx_vx, int BD_nz_vx, double *pvxbtxx, double *pvxbtxz, double *vz, int BD_nx_vz, int BD_nz_vz, double *pvzbtxz, double *pvzbtzz, double *txx, double *ptxxbvx, double *ptxxbvz, double *tzz, double *ptzzbvx, double *ptzzbvz, int B...
omp2.c
// note not doing O0 below as to ensure we get tbaa // TODO: %clang -fopenmp -std=c11 -fno-vectorize -fno-unroll-loops -O1 -disable-llvm-optzns %s -S -emit-llvm -o - | %opt - %loadEnzyme -enzyme -S | %clang -fopenmp -x ir - -o %s.out && %s.out // RUN: %clang -fopenmp -std=c11 -fno-vectorize -fno-unroll-loops -O1 %s -...
GB_unop__exp2_fc64_fc64.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-Li...
omp-loop02.c
#include <omp.h> /* Orphaned work sharing. */ extern void abort (void); #define N 10 void parloop (int *a) { int i; #pragma omp for for (i = 0; i < N; i++) a[i] = i + 3; } main() { int i, a[N]; #pragma omp parallel shared(a) { parloop (a); } for (i = 0; i < N; i++) if (a[i] != i + 3) ...
convolution_3x3_pack1to8_int8.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 copy ...
gmx_isdcmds.c
/* * * Tim Connolly - tconnolly@ucmerced.edu * Copyright (c) 2014, Regents of the University of California * Released under BSD 2-Clause License (see "LICENSE" file) * * This code was modified from the file src/tools/gmx_gyrate.c */ #include <math.h> #include <string.h> #include "libisdm.h" #include "eigen...
compiler_cgen.c
/* Generated by Nim Compiler v0.15.0 */ /* (c) 2016 Andreas Rumpf */ /* The generated code is subject to the original license. */ #define NIM_INTBITS 32 #include "nimbase.h" #include <string.h> typedef struct Tcgen529027 Tcgen529027; typedef struct TNimType TNimType; typedef struct TNimNode TNimNode; typedef struct ...
static_sched.c
#include <stdio.h> #include <omp.h> #define THREADS 4 #define N 8 int main ( ) { int i; #pragma omp parallel for schedule(static) num_threads(THREADS) for (i = 0; i < N; i++) { sleep(i); printf("Thread %d iteration %d.\n", omp_get_thread_num(), i); } return 0; }
8986.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[1000 + 0][1200 + 0], double ey[1000 + 0][1200 + 0], doub...
sum_parallel.c
//Ejercicio EDA 2 Prof. Francisco Rodriguez /* Para compilar usar gcc -Wall -std=c99 sum_parallel.c -fopenmp */ #include <stdio.h> #include <stdlib.h> // para la función rand() #include <time.h> // para inicializar la semilla de aleatoriedad #include <omp.h> // para las funciones de biblioteca de OpenMP // No vamos ...
GB_unaryop__ainv_uint8_int32.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
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 // //===---------------------------...
interpolate_v2_op.h
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. 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...
DCSCTile.h
/****************************************************************************** * ** Copyright (c) 2016, Intel Corporation ** * ** All rights reserved. ** * ** ...
oyranos_cmm_oJPG.c
/** @file oyranos_cmm_oJPG.c * * JPEG file i/o module for Oyranos * * @par Copyright: * 2014-2015 (C) Kai-Uwe Behrmann * * @brief JPEG filter for Oyranos * @internal * @author Kai-Uwe Behrmann <oy@oyranos.org> * @par License: * new BSD <http://www.opensource.org/licenses/BSD...
magsac.h
#pragma once #include <limits> #include <chrono> #include <memory> #include "model.h" #include "model_score.h" #include "samplers/sampler.h" #include "samplers/uniform_sampler.h" #include <math.h> #include "gamma_values.cpp" #ifdef _WIN32 #include <ppl.h> #endif #include <gflags/gflags.h> #include <glog/logging.h...
omp_in_explicit_task.c
// RUN: %libomp-compile-and-run #include <stdio.h> #include <stdlib.h> #include <omp.h> int main() { int res; res = omp_in_explicit_task(); if (res) { printf("error: omp_in_explicit_task: serial1 returned %d\n", res); return 1; } #pragma omp parallel num_threads(2) { int r = omp_in_explicit_ta...
DRACC_OMP_001_Buffer_Overflow_Recursion_yes.c
/* Causing a buffer overflow on the accelerator with recursion in line 15. */ #define C 1024 #pragma omp declare target int counter = 0; int rekurs(){ for(int i = 0; i<C; i++){ #pragma omp atomic counter++; rekurs(); } return 0; } #pragma omp end declare target in...
integrateFullOrbit.c
/* Wrappers around the C integration code for Full Orbits */ #ifdef _WIN32 #include <Python.h> #endif #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_spline.h> #include <bovy_coords.h> #include <bovy_symplecticode.h> #include <leung_dop853.h> ...
3D.c
#include <stdio.h> #include <time.h> #include <assert.h> #include <stdlib.h> #include <math.h> #include <sys/time.h> #include <string.h> #define STR_SIZE (256) #define MAX_PD (3.0e6) /* required precision in degrees */ #define PRECISION 0.001 #define SPEC_HEAT_SI 1.75e6 #define K_SI 100 /* capacitance fitting factor ...
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...
ast-dump-openmp-begin-declare-variant_10.c
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s | FileCheck %s --check-prefix=C // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s -x c++| FileCheck %s --check-prefix=CXX // expected-no-diagnostics #ifdef __cplusplus #define CONST constexpr #else #defi...
SplineC2RAdoptor.h
////////////////////////////////////////////////////////////////////////////////////// // This file is distributed under the University of Illinois/NCSA Open Source License. // See LICENSE file in top directory for details. // // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers. // // File developed by: Jeremy Mc...
parallelQuicksort.c
void parallelQuicksortRecursive(int* arr, int start, int end); void swap(int* arr, int i, int j); // Quicksort entry-point void parallelQuicksort(int* arr, int len) { if (len > 0) parallelQuicksortRecursive(arr, 0, len - 1); } // Recursive quicksort implementarion void parallelQuicksortRecursive(int* arr,...
own_filters.c
/******************************************************************************* * Copyright (c) 2020, Intel Corporation * * 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 mus...
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...
residualbased_elimination_builder_and_solver.h
// | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: Riccardo Rossi // // ...
StreamTriad_par1.c
#include <stdio.h> #include <stdlib.h> #include <time.h> #include "timer.h" int main(int argc, char *argv[]){ int nsize = 20000000, ntimes=16; double a[nsize]; double b[nsize]; double c[nsize]; struct timespec tstart; // initializing data and arrays double scalar = 3.0, time_sum = 0.0; #pragma o...
GB_binop__isle_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...
spinless_fermion_basis_core.h
#ifndef _SPINLESS_FERMION_BASIS_OP_H #define _SPINLESS_FERMION_BASIS_OP_H #include <complex> #include "hcb_basis_core.h" #include "numpy/ndarraytypes.h" npy_uint32 bit_count(npy_uint32 I, int l){ I &= (0x7FFFFFFF >> (31-l)); I = I - ((I >> 1) & 0x55555555); I = (I & 0x33333333) + ((I >> 2) & 0x33333333); return (...
StmtOpenMP.h
//===- StmtOpenMP.h - Classes for OpenMP directives ------------*- 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 // //===---------------------------...
density.c
#include <stdio.h> #include <stdlib.h> #include <complex.h> #include <math.h> #include <omp.h> #include <time.h> #include <mkl.h> #include <mkl_types.h> #include "utils.h" #include "density.h" #include "linalg.h" #define PI 3.14159265359 // THE FOLLOWING TWO FUNCTIONS ARE NOT YET IMPLEMENTED /* double* ncl_ae_state_d...
ast-dump-openmp-for-simd.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_one(int x) { #pragma omp for simd for (int i = 0; i < x; i++) ; } void test_two(int x, int y) { #pragma omp for simd for (int i = 0; i < x; i++) f...
mixed_tentusscher_myo_epi_2004_S1_20.c
// Scenario 1 - Mixed-Model TenTusscher 2004 (Myocardium + Epicardium) // (AP + max:dvdt) #include <stdio.h> #include "mixed_tentusscher_myo_epi_2004_S1_20.h" GET_CELL_MODEL_DATA(init_cell_model_data) { if(get_initial_v) cell_model->initial_v = INITIAL_V; if(get_neq) cell_model->number_of_ode...
fc_compute.h
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or...
ej6.c
#include <omp.h> #include <stdio.h> void threads_por_nivel(int nivel){ printf("Nivel %d: Número de hilos en el nivel %d - %d\n",nivel,nivel,omp_get_num_threads()); } int main() { omp_set_nested(1); omp_set_num_threads(2); #pragma omp parallel { threads_por_nivel(1); omp_set_num_threads(3); #pragma omp ...
simd-6.c
/* { dg-do run { target vect_simd_clones } } */ /* { dg-additional-options "-msse2" { target sse2_runtime } } */ /* { dg-additional-options "-mavx" { target avx_runtime } } */ #define N 100 #define EPS 0.000001 #include <stdlib.h> #include <stdio.h> void init(int *b, float *y, int n) { int i, s = -1; for ( i=0...
tree.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_TREE_H_ #define LIGHTGBM_TREE_H_ #include <LightGBM/dataset.h> #include <LightGBM/meta.h> #include <string> #include <map> #includ...
GB_convert_hyper_to_sparse.c
//------------------------------------------------------------------------------ // GB_convert_hyper_to_sparse: convert a matrix from hypersparse to sparse //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. //...
lib_openmp.c
// This code makes some assumptions on the implementation of // trk_base64_stream_encode_init(), trk_base64_stream_encode() and trk_base64_stream_decode(). // Basically these assumptions boil down to that when breaking the src into // parts, out parts can be written without side effects. // This is met when: // 1) trk...
GB_binop__islt_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_unaryop__minv_int32_uint8.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http...
fixed_version.c
#include <stdio.h> int main(){ int sum =0; int temp[100]; int DATA_MAG = 100; int H[100]; int scale_factor = 10; int i; int LUT[100]; #pragma omp parallel default (none) private(i) shared (temp, LUT, H, scale_factor, sum, DATA_MAG) { #pragma omp for for (i =0; i < DATA_MAG...
error1.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...
citrix_ns_fmt_plug.c
/* * Description from Nicolas Ruff: * - Salt value is hashed as an hexadecimal string, not bytes. * - The trailing NULL byte of password string is taken into account during * hashing. * - The leading '1' is actually the string length * '1' = 49 = len('1') + len(hex_salt) + len(hex_sha1) * * ----------------...
move.h
#pragma once #include "core.h" #include "energy.h" #include "average.h" //#include "analysis.h" #include "potentials.h" #include "mpi.h" namespace Faunus { namespace Move { class Movebase { private: virtual void _move(Change&)=0; //!< Perform move and modify change object ...
thdat02.c
/* * Redistribution and use in source and binary forms, with * or without modification, are permitted provided that the * following conditions are met: * * 1. Redistributions of source code must retain this list * of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce t...
constant_density_acoustic_time_scalar_3D_6.h
#ifndef __CDA_TIME_SCALAR_3D_6__ #define __CDA_TIME_SCALAR_3D_6__ #include <stdlib.h> template< typename T, int ACCURACY > void cda_time_scalar_3D_6( T* km1_u, int nr_km1_u, int nc_km1_u, // in - padded wavefield shape T* k_Phix, int nr_k_Phix, int nc_k_Phix, // in - pa...
GB_binop__times_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-...
apriori.c
/*Copyright(C) 2016 João Saffran <joaosaffran@gmail.com> * * apriori.c - Apriori Methods Implementation */ #include <assert.h> #include "apriori.h" /* * Checks if has combination in an item of the database */ static inline int has_item_in_line(const struct Item *it, char *line) { int resp = 1; char *token = m...
GB_critical_section.c
//------------------------------------------------------------------------------ // Source/Template/GB_critical_section: execute code in a critical section //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. //...
GB_binop__lxor_uint64.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http:...
convolution_3x3_pack4.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 ...
_myomplib.c
#include <omp.h> #pragma omp declare target void inc_omp(int i, int *array) { array[i]++; } void dec_omp(int i, int *array) { array[i]--; } #pragma omp end declare target
icv-2.c
/* { dg-do run { target *-*-linux* } } */ #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif #include <pthread.h> #include <omp.h> #include <stdio.h> #include <stdlib.h> pthread_barrier_t bar; void *tf (void *p) { int l; if (p) omp_set_num_threads (3); pthread_barrier_wait (&bar); if (!p) omp_set_num_t...
GB_binop__rminus_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-...
concattest0.c
#include <stdlib.h> #include "concattest0.h" void concattest0(float* l,int m,int n,float*output){ #pragma omp parallel for for (int H10 = 0; H10 < 1; H10++) { for (int H11 = 0; H11 < n; H11++) { output[((1 + (m - (1)))) * (H11) + H10] = l[(((m)) * (H11)) + H10]; } } #pragma omp parallel for for (int H12 = 1;...
single-modificado.c
#include <stdio.h> #include <omp.h> int main() { int n = 9, i, a, b[n]; for (i=0; i<n; i++) b[i] = -1; #pragma omp parallel { #pragma omp single { printf("Dentro de la región parallel:\n"); } #pragma omp single { printf("Introduce valor de inicialización a:"); scanf("%d"...
DRB004-antidep2-var-yes.c
/* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it andor modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the L...
omp_realloc_def_fb.c
// RUN: %libomp-compile-and-run #include <stdio.h> #include <omp.h> int main() { omp_alloctrait_t at[2]; omp_allocator_handle_t a; omp_allocator_handle_t f_a; void *ptr[2]; void *nptr[2]; at[0].key = omp_atk_pool_size; at[0].value = 2 * 1024 * 1024; at[1].key = omp_atk_fallback; at[1].value = omp_at...
parallel.c
// OpenMP version. Edit and submit only this file. /* Enter your details below * Name : Qingwei Zeng * UCLA ID : 005181694 * Email : zenn@ucla.edu */ #include <omp.h> #include <stdio.h> #include <stdlib.h> #include "utils.h" /* This function takes in two 3-d matrices: long *old, long *new. * It only updates th...
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)...