source
stringlengths
3
92
c
stringlengths
26
2.25M
mandel_par.c
#include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <time.h> #include <sys/time.h> #include "pngwriter.h" #include "consts.h" #include <omp.h> int main (int argc, char** argv) { png_data* pPng = png_create (IMAGE_WIDTH, IMAGE_HEIGHT); double x, y, x2, y2, cx, cy; cy = MIN_Y; double fDel...
cpd.c
/** * @file cpd.c * @brief Tensor factorization with the CPD model using AO-ADMM. * @author Shaden Smith <shaden@cs.umn.edu> * @version 2.0.0 * @date 2016-05-14 */ /****************************************************************************** * INCLUDES ***********************************************************...
openmp-macro-expansion.c
// RUN: %clang_cc1 -fopenmp -E -o - %s 2>&1 | FileCheck %s // This is to make sure the pragma name is not expanded! #define omp (0xDEADBEEF) #define N 2 #define M 1 #define E N> #define map_to_be_expanded(x) map(tofrom:x) #define sched_to_be_expanded(x,s) schedule(x,s) #define reda_to_be_expanded(x) reduction(+:x)...
mpi_io.c
/****************************************************************************** * INCLUDES *****************************************************************************/ #include "../splatt_mpi.h" #include "../io.h" #include "../timer.h" #include "../util.h" /*******************************************************...
omp_sections_reduction.c
<ompts:test> <ompts:testdescription>Test which checks the omp sections reduction directive with all its options.</ompts:testdescription> <ompts:ompversion>2.0</ompts:ompversion> <ompts:directive>omp sections reduction</ompts:directive> <ompts:testcode> #include <stdio.h> #include <math.h> #include "omp_testsuite.h" i...
HelloOpenMP_fix4.c
#include <stdio.h> #include <omp.h> int main(int argc, char *argv[]){ #pragma omp parallel { int nthreads = omp_get_num_threads(); int thread_id = omp_get_thread_num(); #pragma omp master { printf("Goodbye slow serial world and Hello OpenMP!\n"); printf(" I have %d thre...
YAKL_reductions.h
#pragma once template <class T, int myMem> class ParallelMin; template <class T, int myMem> class ParallelMax; template <class T, int myMem> class ParallelSum; #ifdef YAKL_ARCH_HIP template <class T> class ParallelMin<T,memDevice> { void *tmp; // Temporary storage size_t nTmp; // Size of temporar...
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/error.h" #include "openmc/geometry.h" #include "openmc/pa...
flowinfo_ipv4_src.c
/* * Copyright 2014-2017 Nippon Telegraph and Telephone 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 requi...
dct.c
/***************************************************************************** * dct.c: h264 encoder library ***************************************************************************** * Copyright (C) 2003-2008 x264 project * * Authors: Loren Merritt <lorenm@u.washington.edu> * Laurent Aimar <fenrir@vi...
GB_unaryop__abs_uint16_uint8.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
sse.h
/* SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, * modify, merge, publish, ...
flow_rate_slip_utility.h
// | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: Miguel Maso Sotomayor // #ifndef KRATOS_FLOW_RAT...
tally.h
#ifndef OPENMC_TALLIES_TALLY_H #define OPENMC_TALLIES_TALLY_H #include "openmc/constants.h" #include "openmc/tallies/trigger.h" #include "pugixml.hpp" #include "xtensor/xfixed.hpp" #include "xtensor/xtensor.hpp" #include <memory> // for unique_ptr #include <unordered_map> #include <string> #include <vector> namespa...
config.h
/* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ #if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__...
imageutils.h
/** * Created by yanyuanchi on 2017/4/8. */ #ifndef SIFTYSIFTY_IMAGEUTILS_H #define SIFTYSIFTY_IMAGEUTILS_H #include "structs.h" #include "utils.h" #ifdef _OPENMP #include <omp.h> #endif namespace SiftySifty { /** * half sample the src Mat * @tparam T type * @param src src mat * @param dst dst mat * @return...
Pragma.h
//===- Pragma.h - Pragma registration and handling --------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
main.c
#include <stdio.h> #include <stdlib.h> #include <omp.h> int main(int argc, const char * argv[]) { int n = 100; if (argc == 1) { printf("Use: %s <número de items>\n", argv[0]); exit(0); } else { n = atoi(argv[1]); } int suma = 0; int i; int numeros[n]; ...
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...
kncmbpush3.c
/* KNC C Library for Skeleton 3D Electromagnetic Vector PIC Code */ /* written by Viktor K. Decyk, UCLA and Ricardo Fonseca, ISCTE */ #include <stdlib.h> #include <stdio.h> #include <complex.h> #include <math.h> #include <string.h> #include <immintrin.h> #include "kncmbpush3.h" /*-------------------------------------...
gas.h
/** * Author: Kartik Lakhotia Sourav Pati * Email id: klakhoti@usc.edu spati@usc.edu * Date: 27-Feb-2018 * * This code implements work optimized propagation blocking with * transposed bin graph to reduce cache misses in scatter */ #include <iostream> #include <stdio.h> #include <stdlib....
GB_unaryop__identity_uint32_uint64.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
elemwise_binary_scalar_op.h
/* * 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 ...
attribute.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
simulation_context_base.h
// Copyright (c) 2013-2017 Anton Kozhevnikov, Thomas Schulthess // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are permitted provided that // the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notic...
mandel.c
/* ** PROGRAM: Mandelbrot area ** ** PURPOSE: Program to compute the area of a Mandelbrot set. ** Correct answer should be around 1.510659. ** WARNING: this program may contain errors ** ** USAGE: Program runs without input ... just run the executable ** ** HISTORY: Writt...
pfem_2_monolithic_slip_strategy.h
#ifndef KRATOS_PFEM2_MONOLITHIC_SLIP_STRATEGY_H #define KRATOS_PFEM2_MONOLITHIC_SLIP_STRATEGY_H #include "includes/define.h" #include "includes/model_part.h" #include "utilities/openmp_utils.h" #include "processes/process.h" #include "solving_strategies/schemes/scheme.h" #include "solving_strategies/strategies/solving...
SpatialConvolutionMM.c
#ifndef TH_GENERIC_FILE #define TH_GENERIC_FILE "generic/SpatialConvolutionMM.c" #else /* note: due to write issues, this one cannot be parallelized as well as unfolded_copy */ static void nn_(unfolded_acc)(THTensor *finput, THTensor *input, int kW, int kH, ...
convolutiondepthwise_3x3_pack8_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 ...
SPHCalcHydroForceFunctor.h
/** * @file SPHCalcHydroForceFunctor.h * @author seckler * @date 22.01.18 */ #pragma once #include "autopas/particles/OwnershipState.h" #include "autopas/sph/SPHKernels.h" namespace autopas::sph { /** * Class that defines the hydrodynamic force functor. * It is used to calculate the force based on the given SP...
forest.h
#pragma once #include "tree.h" template <typename SplitFunctionT, typename LeafFunctionT> class Forest { public: Forest() {} virtual ~Forest() {} std::shared_ptr<LeafFunctionT> inferencest(const SamplePtr& sample) const { int n_trees = trees_.size(); std::vector<std::shared_ptr<LeafFunctionT>> f...
z_solve.c
//-------------------------------------------------------------------------// // // // This benchmark is a serial C version of the NPB BT code. This C // // version is developed by the Center for Manycore Programming at Seoul // // Nati...
ref3.c
#ifdef GEN_PICTURES static void do_draw(const struct parameters *p, size_t key, size_t h, size_t w, double (*restrict g)[h][w]) { begin_picture(key, w-2, h-2, p->io_tmin, p->io_tmax); size_t i, j; for (i = 1; i < h-1; ++i) for (j = 1; j < w-1; ++j) draw_point(j-...
multiply.h
#pragma once #include "intgemm_config.h" #include "interleave.h" #include "intrinsics.h" #include "vec_traits.h" #include "callbacks.h" #include <cmath> //sqrt namespace intgemm { struct MeanStd { float mean; float stddev; }; INTGEMM_SSE2 static inline float MaxFloat32(__m128 a) { // Fold to just using the f...
kji_optimize.c
#include <stdio.h> #include <stdlib.h> #include <omp.h> int A_row; int A_col; int B_row; int B_col; int **constructMatrix(int row, int col){ int **matrix = (int **)malloc(sizeof(int *) * row); for (int i = 0; i < row;i++){ matrix[i] = (int *)malloc(sizeof(int) * col); } return matrix; } void ...
comm.h
/* * 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 ...
GB_unop__floor_fc32_fc32.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-Li...
UncertainDataEstimator.h
/// \ingroup base /// \class ttk::UncertainDataEstimator /// \author Michael Michaux <michauxmichael89@gmail.com> /// \date August 2016. /// /// \brief TTK processing package that takes an input ensemble data set /// (represented by a list of scalar fields) and which computes various /// vertexwise statistics (PDF es...
convolution_pack4.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 ...
two_flip_move_generator.h
/*****************************************************************************/ // Copyright (c) 2020-2021 Yuji KOGUMA // Released under the MIT license // https://opensource.org/licenses/mit-license.php /*****************************************************************************/ #ifndef PRINTEMPS_NEIGHBORHOOD_TWO_F...
GB_binop__islt_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-...
window.c
/********************************************************************[libaroma]* * Copyright (C) 2011-2015 Ahmad Amarullah (http://amarullz.com/) * * 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 Lic...
convolution_1x1_pack8_fp16s.h
// Tencent is pleased to support the open source community by making ncnn available. // // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. // // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy ...
dds.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
rnn_impl.h
/* * 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 ...
chain_access_omp.c
// RUN: ${CATO_ROOT}/src/scripts/cexecute_pass.py %s -o %t // RUN: diff <(mpirun -np 1 %t) %s.reference_output #include <stdlib.h> #include <stdio.h> #include <omp.h> void use_pointer(int * p, int x) { *p = x; } int main() { int* ptr = (int*)malloc(sizeof(int)); *ptr = 0; #pragma omp parallel { ...
3d7pt.c
/* * Order-1, 3D 7 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) ...
CGOpenMPRuntime.h
//===----- CGOpenMPRuntime.h - Interface to OpenMP Runtimes -----*- 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 // //===---------------------------...
renderer.c
#include <stdlib.h> #include <stdio.h> #include <math.h> #include <float.h> #include "vec.h" #include "renderer.h" #include "intersection.h" void initRenderer(Renderer* renderer, int width, int height, float hview, float vview) { renderer->width = width; renderer->height = height; renderer->horizontal_vi...
task_target_device_codegen.c
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[ .].+[.|,]" --prefix-filecheck-ir-name _ // RUN: %clang_cc1 -verify -triple x86_64-a...
GB_binop__gt_uint32.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX...
clang-host-targ2.c
#include <stdio.h> #include "assert.h" #include <unistd.h> #define TRIALS 1 #define N 960 int main() { int fail = 0; double A[N], B[N], C[N]; for (int i = 0; i < N; i++) { A[i] = 0.0; B[i] = 0.0; C[i] = 1.0; } int nte = 32; int tl = 64; int blockSize = tl; for (int t = 0 ; t < TRIALS ; t+...
sort.c
/**********************************************************************************************/ /* This program is part of the Barcelona OpenMP Tasks Suite */ /* Copyright (C) 2009 Barcelona Supercomputing Center - Centro Nacional de Supercomputacion */ /* Copyright (C) 2009 Univer...
GB_unaryop__ainv_int16_fp32.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
ExplicitTopology.h
/* * MIT License * * Copyright (c) 2018-2019 Benjamin Köhler * * 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, c...
9644.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...
composite.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
GB_unop__isnan_bool_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...
omp_doacross.c
// RUN: %libomp-compile-and-run // XFAIL: gcc-4, gcc-5, clang-3.7, clang-3.8, icc-15, icc-16 #include <stdio.h> #include <stdlib.h> #include "omp_testsuite.h" #ifndef N #define N 750 #endif int test_doacross() { int i, j; // Allocate and zero out the matrix int *m = (int *)malloc(sizeof(int) * N * N); for (i ...
sgemm.c
#include <stdio.h> #include <stdlib.h> #include <inttypes.h> #include <math.h> #include <sys/time.h> #include <omp.h> /* * C = [n, q] = A[n, m] * B[m, q] */ enum { N = 1000, M = 1000, Q = 1000, NREPS = 5, }; double wtime() { struct timeval t; gettimeofday(&t, NULL); return (dou...
conv_im2col_sgemm_sse_sgemm.h
// BUG1989 is pleased to support the open source community by supporting ncnn available. // // Copyright (C) 2019 BUG1989. All rights reserved. // // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy of the License at // //...
GB_binop__div_int64.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX...
work.c
/******************************************************************** * BenchIT - Performance Measurement for Scientific Applications * Contact: developer@benchit.org * * $Id: work.c 1 2009-09-11 12:26:19Z william $ * $URL: svn+ssh://william@rupert.zih.tu-dresden.de/svn-base/benchit-root/BenchITv6/kernel/memory/ba...
for-task-for.c
// RUN: %libomp-compile-and-run #include <stdio.h> #include <math.h> #include "omp_testsuite.h" #define NUM_OUTER_THREADS 16 #define NUM_INNER_THREADS 16 #define SMALL_LOOPCOUNT 64 /*! Utility function to spend some time in a loop */ static void do_some_work (void) { int i; double sum = 0; for(i = 0; i < 1000...
pvector.h
// Copyright (c) 2015, The Regents of the University of California (Regents) // See LICENSE.txt for license details #ifndef PVECTOR_H_ #define PVECTOR_H_ #include <algorithm> /* GAP Benchmark Suite Class: pvector Author: Scott Beamer Vector class with ability to not initialize or do initialize in parallel - std:...
bmh_parallel.c
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<omp.h> #define NUM_THREADS 4 int occ[256]; int* lastocc(char str[]) { int i; char a; for(i=0;i<128;i++) occ[i]=-1; int len=strlen(str); for(i=0;i<len-1;i++) { a=str[i]; occ[a]=i; } return occ; } void bmh(char *t,int start,int end,char *...
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_subassign_05.c
//------------------------------------------------------------------------------ // GB_subassign_05: C(I,J)<M> = scalar ; no S //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-License-Identifier: Apa...
Metric.h
// // Created by Jin Zhu on 2020/2/18. // // #define R_BUILD #ifndef SRC_METRICS_H #define SRC_METRICS_H #include <algorithm> #include <random> #include <vector> #include "Algorithm.h" #include "Data.h" #include "utilities.h" template <class T1, class T2, class T3, class T4> // To do: calculate loss && all to one &&...
mediancut.c
/* ** © 2009-2018 by Kornel Lesiński. ** © 1989, 1991 by Jef Poskanzer. ** © 1997, 2000, 2002 by Greg Roelofs; based on an idea by Stefan Schneider. ** ** See COPYRIGHT file for license. */ #include <stdlib.h> #include <stddef.h> #include "libimagequant.h" #include "pam.h" #include "mediancut.h" #define index_of_cha...
NEC_scheme.c
/* ============================================================================= Copyright (c) 2013, Institute for Microelectronics, TU Wien http://www.iue.tuwien.ac.at ----------------- ViennaWD - The Vienna Wigner Decoherence Algorithms Ensemb...
GB_unaryop__ainv_int8_uint16.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http...
GB_unop__identity_int32_int8.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-Li...
SourceCode.c
#ifdef _WIN32 #include <stdio.h> #else #define _GNU_SOURCE // for fcloseall() on linux #include <stdio.h> #endif #include <stdbool.h> #include <string.h> #include <stdlib.h> #include <omp.h> #include <math.h> #include <SpiceUsr.h> #include <PAConfig.h> #ifdef _WIN32 #include <windows.h> // needed for search wu directo...
Ooura_FFT.h
#ifndef _H_OOURA_FFT_ #define _H_OOURA_FFT_ #include <cmath> class Ooura_FFT{ private: int frame_size; int channels; double **a, **w; int **ip; public: inline Ooura_FFT(int _frame_size, int _channels); inline ~Ooura_FFT(); inline void FFT(double **); inline void FFT(double **, int tagre...
inputBug330.c
/* test preprocessing info before and after a statement */ #include <stdio.h> #ifdef _OPENMP #include "omp.h" #endif int main() { int nthreads; #pragma omp parallel { nthreads++; #if defined(_OPENMP) #pragma omp master { printf("I am the master thread.\n"); } #endif // nthreads++; // things are qui...
graphprop.c
#include<stdio.h> #include<string.h> #include "graph.h" #include "graphprop.h" #include "graphutil.h" int64_t T = 0 ; double avgincident; double scaledT; double aed; double sccindex; double clusterCoeff; double avgEdgeDistance(graph *G) { long * edgeDistances = (long*) malloc (sizeof(long) * G->numNodes); /...
task-barrier.c
/* * task-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 // ...
resize.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
omp_loop.c
#include <omp.h> #include <stdio.h> #include <stdlib.h> #define N 100 int main(int argc, char *argv[]) { int nthreads, tid, i; float a[N], b[N], c[N]; // some initializations for(i=0; i<N; i++) { a[i] = b[i] = i; } #pragma omp parallel shared(a, b, c, nthreads) private(i, tid) ...
testis.c
/*[]*/ struct __sFILEX ; /*[]*/ int printf(const char *restrict , ...); /*[]*/ extern void timer_clear(int ); /*[]*/ extern void timer_start(int ); /*[]*/ extern void timer_stop(int ); /*[]*/ extern double timer_read(int ); /*[]*/ extern void c_print_results(char *name, char class , int n1 , int n2 , int n3 , int nite...
GB_binop__lxor_int16.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
dbscan_vp.h
#ifndef DBSCAN_VP_H #define DBSCAN_VP_H #include "vptree.h" #include <Eigen/Dense> namespace clustering { class DBSCAN_VP : private boost::noncopyable { private: static inline double dist( const Eigen::VectorXf& p1, const Eigen::VectorXf& p2 ) { return ( p1 - p2 ).norm(); } const Dataset::Ptr...
fox_floats_timer_caching_omp_fileIO_benchmark.c
/* fox_floats_timer_caching_omp_fileIO_benchmark.c -- uses Fox's algorithm to multiply two square matrices * * Implementation of parallel matrix multiplication: * LaTeX: $C_{i,j} = \sum_{k} A_{i,k}B_{k,j}$ * * Input: * Input Matrix file name: A.dat, B.dat * * Output: * Output Matrix file name: C.dat...
depend-3.c
/* { dg-do compile } */ /* { dg-options "-fopenmp" } */ void bar (int a[10][10][10]); void foo (int a[10][10][10], int **b, int x) { int c[10][10][10]; #pragma omp task depend(out: a[2:4][3:0][:7]) /* { dg-error "zero length array section" } */ bar (a); #pragma omp task depend(inout: b[:7][0:0][:0]) /* { dg-...
ompdynamic.c
#include <stdio.h> #include <stdlib.h> int main(int argc, char* argv[]) { printf("OpenMP Dynamic Test Case\n"); const int n = 1024; double* the_array = (double*) malloc(sizeof(double) * n); int i = 0; for(i = 0; i < n; ++i) { the_array[i] = i; } double sum; #pragma omp parallel for schedule(dynamic) redu...
matmul.c
//===-- matmul.c - Different implementations of matrix multiplies -*- C -*-===// // // Part of the LOMP 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_seqval.c
/* Copyright (C) 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:...
is.c
/*-------------------------------------------------------------------- NAS Parallel Benchmarks 2.3 OpenMP C versions - IS This benchmark is an OpenMP C version of the NPB IS code. The OpenMP C versions are developed by RWCP and derived from the serial Fortran versions in "NPB 2.3-serial" developed by NAS...
ocp_nlp_sqp.c
/* * Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren, Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor, Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan, Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl * * This file is part of acados....
SparseDenseProduct.h
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2015 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, You c...
5468.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 <...
elemwise_binary_op.h
/* * 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 ...
NM_chi2dist.c
#include "mex.h" //#include "chi2double.h" #include <stdio.h> #include <float.h> /* We calculate calculate chi2=(a-b)**2/(a+b+FLT_MIN) to avoid division-by-zero: If a+b != 0, then (a+b+FLT_MIN)==(a+b) and nothing changed. If a+b == 0, then the numerator is 0 as well, and we don't divide by 0. */ // Using compiler...
depthwise_conv2d.h
// Copyright 2018 Xiaomi, Inc. 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 applicab...
ccl_core.c
#include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <math.h> #include <string.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_odeiv.h> #include <gsl/gsl_spline.h> #include <gsl/gsl_interp2d.h> #include <gsl/gsl_spline2d.h> #include <gsl/gsl_integration.h> #include "ccl.h" // // Macros for replacing r...
pcg.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <math.h> #include "pcg.h" // Left preconditioned Conjugate Gradient for solving A * x = b void pcg( const int n, const DTYPE tol, const int max_iter, const matvec_fptr Ax, const void *Ax_param, const DTYP...
target_uses_allocators.c
// Test host codegen. // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-...
PagerankCpuCode.c
#include "PagerankCpuCode.h" #define AVG_DEG 8 //4 //#define NUM_NODES (512*1024) //(128*1024) //#define NUM_EDGES (NUM_NODES*AVG_DEG) int NUM_NODES = (512*1024); //(128*1024) int NUM_EDGES; // (NUM_NODES*AVG_DEG) #include "bfs.h" #include "graph_gen.h" #include "edge_list_input.h" #include <omp.h> // Globals vo...
generated-funcs.c
// Check that the CHECK lines are generated for clang-generated functions // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fopenmp %s -emit-llvm -o - | FileCheck --check-prefix=OMP %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu %s -emit-llvm -o - | FileCheck --check-prefix=NOOMP %s const int size = 1024 * ...