source
stringlengths
3
92
c
stringlengths
26
2.25M
CLHelper.h
//------------------------------------------ //--cambine:helper function for OpenCL //--programmer: Jianbin Fang //--date: 27/12/2010 //------------------------------------------ #ifndef _CL_HELPER_ #define _CL_HELPER_ #include <CL/cl.h> #include <fstream> #include <iostream> #include <string> #include <ve...
sumstats.h
/* Copyright (c) 2015-2016 Drew Schmidt 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 notice, this list o...
GB_unop__identity_int16_uint32.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX-Li...
3d7pt_var.lbpar.c
#include <omp.h> #include <math.h> #define ceild(n,d) ceil(((double)(n))/((double)(d))) #define floord(n,d) floor(((double)(n))/((double)(d))) #define max(x,y) ((x) > (y)? (x) : (y)) #define min(x,y) ((x) < (y)? (x) : (y)) /* * Order-1, 3D 7 point stencil with variable coefficients * Adapted from PLUTO and Po...
Sema.h
//===--- Sema.h - Semantic Analysis & AST Building --------------*- 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 // //===---------------------------...
mpifft.c
/* -*- mode: C; tab-width: 2; indent-tabs-mode: nil; fill-column: 79; coding: iso-latin-1-unix -*- */ /* mpifft.c */ #include <hpcc.h> #include "hpccfft.h" #include "wrapmpifftw.h" double *HPCC_fft_timings_forward, *HPCC_fft_timings_backward; static void MPIFFT0(HPCC_Params *params, int doIO, FILE *outFile, MPI_Co...
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> ...
add.c
#include "main.h" mat_rv addition_coo_nothreading(coo matrix1, coo matrix2) { mat_rv rv; if(matrix1.rows != matrix2.rows || matrix1.cols != matrix2.cols){ rv.error = ERR_WRONG_DIM; return rv; } if(matrix1.elems[0].type != matrix2.elems[0].type){ rv.error = ERR_TYPE_MISSMATCH; return rv; } struct timespec...
GB_unaryop__minv_bool_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...
GB_binop__lxor_bool.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX...
papi_helper.h
#ifndef UTILS_PAPI_HELPER_H #define UTILS_PAPI_HELPER_H #include <omp.h> #include <iostream> #include <stdexcept> #include <pthread.h> #ifdef HAVE_PAPI #include <papi.h> #endif #include "colors.h" static long long l1_tcm, l2_tcm, l3_tcm, tlb_dm; void papi_helper_init_thread() { #ifdef HAVE_PAPI if (PAPI_...
build_JKmat_DF.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <omp.h> #include "linalg_lib_wrapper.h" #include "utils.h" #include "TinyDFT_typedef.h" #include "build_JKmat_DF.h" void TinyDFT_reduce_temp_J(double *temp_J, double *temp_J_thread, int len, int tid, int nthread) { ...
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. // //===-------------------------------------------------------...
DRB050-functionparameter-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...
GB_concat_sparse.c
//------------------------------------------------------------------------------ // GB_concat_sparse: concatenate an array of matrices into a sparse matrix //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. //...
enhance.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
mixed_tentusscher_myo_epi_2004_S2_10.c
// Scenario 2 - Mixed-Model TenTusscher 2004 (Myocardium + Epicardium) // (AP + max:dvdt) #include <stdio.h> #include "mixed_tentusscher_myo_epi_2004_S2_10.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...
Proj4.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "grb2.h" #include "wgrib2.h" #include "fnlist.h" /* proj4.c interface routines to the Proj.4 library 6/2012 Public Domain Dusan Jovic 8/2014 Public Domain Wesley Ebisuzaki latlon lambert conformal ncep rotated latlon B grid 10/2015 l...
amuxCRS.h
/** * \file * \author Thomas Fischer * \date 2011-09-20 * \brief Definition of amuxCRS functions. * * \copyright * Copyright (c) 2013, OpenGeoSys Community (http://www.opengeosys.org) * Distributed under a Modified BSD License. * See accompanying file LICENSE.txt or * h...
valid.yolo1.src.h
#pragma once #include "ukr.h" #include "omp.h" #include "transpose.h" #include "gen_ukr_A6B2gemm_1_32_544_544_3_3_3.h" #include "gen_ukr_A4B2gemm_1_32_544_544_3_3_3.h" void testrun(float* A ,float*B, float*C, float*oriB ){ int tid = omp_get_thread_num(); int Nx = 544; int Ny = 544; int Nh = 3; long long...
threading.c
/*BHEADER********************************************************************** * Copyright (c) 2008, Lawrence Livermore National Security, LLC. * Produced at the Lawrence Livermore National Laboratory. * This file is part of HYPRE. See file COPYRIGHT for details. * * HYPRE is free software; you can redistribute...
opencl_sxc_fmt_plug.c
/* * Modified by Dhiru Kholia <dhiru at openwall.com> for Keychain format. * * This software is Copyright (c) 2012 Lukas Odzioba <ukasz@openwall.net> * and it is hereby released to the general public under the following terms: * Redistribution and use in source and binary forms, with or without * modification, ar...
deconvolution_4x4.h
// Tencent is pleased to support the open source community by making ncnn available. // // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. // // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy ...
block_map.h
/* The main differences of block_multimap from unordered_multimap are: 1) Block oriented methods (e.g., insert, equal_range, find) have been added that operate on arrays of elements. 2) A maximum number of elements per key can be specified with MAX_ELEM. 3) USE_ACC Only: Values are stored in result arrays...
declare_variant_mixed_codegen.c
// RUN: %clang_cc1 -verify -fopenmp -x c -triple x86_64-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefix HOST // RUN: %clang_cc1 -fopenmp -x c -triple x86_64-unknown-linux -emit-pch -o %t -fopenmp-version=45 %s // RUN: %clang_cc1 -fopenmp -x c -triple x86_64-unknown-linux -include-pch %t -verify %s -emit-...
GB_binop__div_fc32.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__lnot_int32_fp64.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
openmp.h
// -*- C++ -*- #ifndef GRAPHGRIND_BACKEND_OPENMP_H #define GRAPHGRIND_BACKEND_OPENMP_H #include "config.h" #include "graptor/partitioner.h" #include "graptor/legacy/parallel.h" #include "graptor/utils.h" #include <iostream> #include <fstream> #include <stdlib.h> #include <assert.h> #include <unistd.h> #include <sched...
perftest.c
/** * Copyright (C) Mellanox Technologies Ltd. 2001-2014. ALL RIGHTS RESERVED. * Copyright (C) The University of Tennessee and The University * of Tennessee Research Foundation. 2015. ALL RIGHTS RESERVED. * Copyright (C) UT-Battelle, LLC. 2015. ALL RIGHTS RESERVED. * * See file LICENSE for terms. */ #...
convolution_sgemm_pack8to1_int8.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 ...
laplace2d-04s.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 ...
mmGPU.c
/* Tempo sequencial: real 0m31,842s user 0m31,713s sys 0m0,083s real 0m30,929s user 0m30,789s sys 0m0,074s real 0m31,569s user 0m31,408s sys 0m0,077s real 0m30,880s user 0m30,749s sys 0m0,067s real 0m31,120s user 0m30,967s sys 0m0,087s Tempo Paralelo - Multicore:...
tools.h
#ifndef YGGTOOLS_H_ #define YGGTOOLS_H_ #ifdef _MSC_VER #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS 1 #endif #endif #ifdef _OPENMP #include <omp.h> #endif #include <string.h> #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <errno.h> #include <time.h> #ifdef USE_OSR_YGG struc...
omp_target_disassociate_ptr.c
// omp_target_disassociate_ptr should always fail if the hold reference count is // non-zero, regardless of the dynamic reference count. When the latter is // finite, the implementation happens to choose to report the hold diagnostic. // RUN: %libomptarget-compile-generic -fopenmp-extensions // RUN: %not %libomptarge...
GB_binop__min_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-...
World.h
#ifndef __WORLD__H__ #define __WORLD__H__ #include <Eigen/Core> #include <Eigen/SparseCore> #include <Eigen/SparseCholesky> #include <vector> #include <set> #include <Eigen/Dense> #include "Constraint/ConstraintHeader.h" #include "../utils/collisionBrutal.h" #include "../constants.h" namespace FEM { // class Constra...
kinFoodWeb_kry_omp.c
/* ----------------------------------------------------------------- * Programmer(s): Ting Yan @ SMU * Based on kinFoodWeb_kry.c and parallelized with OpenMP * ----------------------------------------------------------------- * SUNDIALS Copyright Start * Copyright (c) 2002-2019, Lawrence Livermore National Se...
Parallelizer.h
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2010 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 can ob...
syrk.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...
parallel_blocked_ldlt_03.h
// // Created by Kazem on 12/31/18. // #ifndef PROJECT_SERIAL_BLOCKED_LDL_03_H #define PROJECT_SERIAL_BLOCKED_LDL_03_H #include <stdlib.h> #include <cmath> #include <cassert> #include "mkl.h" #include "Reach.h" #include "Sym_BLAS.h" namespace nasoq { #undef TIMING #undef TLAST bool ldl_left_sn_parallel_03(int n, c...
arrays.c
/** * module with tools for manipulating arrays * Julien Lesgourgues, 18.04.2010 */ #include "arrays.h" /** * Called by thermodynamics_init(); perturb_sources(). */ int array_derive( double * array, int n_columns, int n_lines, int index_x, /** from 0 to (n_columns-1) */ int index_y, int index...
morphology.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
tensor_voting.h
#ifndef CVD_INC_TENSOR_VOTE_H #define CVD_INC_TENSOR_VOTE_H #include <cvd/image.h> #include <TooN/TooN.h> #include <TooN/helpers.h> #include <vector> #include <utility> namespace CVD { #ifndef DOXYGEN_IGNORE_INTERNAL namespace TensorVoting { struct TV_coord { std::ptrdiff_t o; int x; int y; }; ...
implicit_blender.c
/* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be use...
kernel_template.c
#define _POSIX_C_SOURCE 200809L #include "stdlib.h" #include "math.h" #include "sys/time.h" #include "xmmintrin.h" #include "pmmintrin.h" #include <stdio.h> #include "omp.h" #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) struct dataobj { void *restrict data; int *size; in...
GB_binop__iseq_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:...
transform.h
/*! * Copyright 2018 XGBoost contributors */ #ifndef XGBOOST_COMMON_TRANSFORM_H_ #define XGBOOST_COMMON_TRANSFORM_H_ #include <dmlc/omp.h> #include <xgboost/data.h> #include <utility> #include <vector> #include <type_traits> // enable_if #include "host_device_vector.h" #include "common.h" #include "span.h" #if de...
GB_unaryop__identity_int8_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...
GB_unaryop__identity_int32_int8.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
omp-barrier.c
#include "stdio.h" int main() { #pragma omp parallel { printf("hello world 1\n"); #pragma omp barrier printf("hello world 2\n"); #pragma omp barrier printf("hello world 3\n"); #pragma omp barrier printf("hello world 4\n"); } return 0; }
ljForce.c
/******************************************************************************* Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of so...
bufradixsort_relocate.h
#ifndef BUFRADIXSORT_RELOCATE_H #define BUFRADIXSORT_RELOCATE_H #include "bufradixsort_common.h" #include <limits.h> #include <stddef.h> #include <stdint.h> #include <string.h> #if EXT_UNIQID(SSE2) == EXT_UNIQID(EXT_STREAM) #include <emmintrin.h> #include <smmintrin.h> #endif /* COPYMASKBUF */ #define COPYMASKBUF C...
MatrixOp.c
#include "../include/MatrixOp.h" //==================== vector operations =========================== // put random values into the matrix if mode == 0 struct Vector * new_vec(int length, int mode) { struct Vector *vecp = (struct Vector *)malloc(sizeof(struct Vector)); vecp->length = length; vecp->vec = (f...
LAGraph_BF_full2.c
//------------------------------------------------------------------------------ // LAGraph_BF_full2.c: Bellman-Ford single-source shortest paths, returns tree, // while diagonal of input matrix A needs not to be explicit 0, using the // frontier idea from Roi Lipman //--------------------------------------------------...
nt.c
/*************************************************************************** * * (C) Copyright 2007 The Board of Trustees of the * University of Illinois * All Rights Reserved * * MRI-Q: Magnetic Resonance Imaging * Computes a matrix Q, represen...
test-omp.c
#include<stdio.h> #include<omp.h> int main(void) { #pragma omp parallel { printf("Hello, I'm thread %d\n", omp_get_thread_num()); } }
ompfor-default.c
/* * default loop scheduling */ #include <stdio.h> #ifdef _OPENMP #include <omp.h> #endif int main(void) { int i,j; #pragma omp parallel { #pragma omp single printf ("Using %d threads.\n",omp_get_num_threads()); #pragma omp for private(j) for (i=0;i<10;i++) { j = omp_get_thread_num(); print...
residualbased_elimination_builder_and_solver_with_constraints.h
// | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: Vicente Mataix Ferrandiz // ...
Example_udr.2.c
/* * @@name: udr.2.c * @@type: C * @@compilable: yes * @@linkable: no * @@expect: success * @@version: omp_4.0 */ #include <stdio.h> #include <limits.h> struct point { int x; int y; }; #pragma omp declare reduction(min : struct point : \ omp_out.x = omp_in.x > omp_out.x ? omp_out.x : omp_in.x, \ ...
THTensorMath.c
#ifndef TH_GENERIC_FILE #define TH_GENERIC_FILE "internal/THTensorMath.c" #else #ifndef NAN #define NAN (nan(NULL)) #endif #ifdef _OPENMP #include <omp.h> #endif #define TH_OMP_OVERHEAD_THRESHOLD 100000 #ifdef _OPENMP #ifndef _WIN32 #define PRAGMA(P) _Pragma(#P) #else #ifdef __GNUC__ #define PRAGMA(P) _P...
laplace2d-02.c
#include <math.h> #include <string.h> #include <stdio.h> #include <omp.h> #define NN 4096 #define NM 4096 __attribute__((target(mic))) double A[NN][NM]; __attribute__((target(mic))) double Anew[NN][NM]; int main(int argc, char** argv) { const int n = NN; const int m = NM; const int iter_max = 200; co...
GB_binop__ge_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-...
GB_dense_subassign_25_template.c
//------------------------------------------------------------------------------ // GB_dense_subassign_25_template: C<M> = A where C is empty and A is dense //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. /...
ast-dump-openmp-target.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(void) { #pragma omp target ; } // CHECK: TranslationUnitDecl {{.*}} <<invalid sloc>> <invalid sloc> // CHECK: `-FunctionDecl {{.*}} <{{.*}}ast-dump-openmp-t...
GB_concat_full_template.c
//------------------------------------------------------------------------------ // GB_concat_full_template: concatenate an full tile into a full matrix //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SP...
GB_resize.c
//------------------------------------------------------------------------------ // GB_resize: change the size of a matrix //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http://suitesparse.com See Gra...
mish_ref.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...
raytracer.h
#pragma once #include "resource.h" #include <linalg.h> #include <memory> #include <omp.h> #include <random> #include <time.h> using namespace linalg::aliases; namespace cg::renderer { struct ray { ray(float3 position, float3 direction) : position(position) { this->direction = normalize(direction); } float3 po...
GB_unaryop__ainv_fp64_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...
GB_unop__identity_fc64_fp32.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX-Li...
GB_binop__isle_uint64.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX...
omp_single_nowait.c
<ompts:test> <ompts:testdescription></ompts:testdescription> <ompts:ompversion>2.0</ompts:ompversion> <ompts:directive>omp single nowait</ompts:directive> <ompts:dependences>omp critical,omp atomic</ompts:dependences> <ompts:testcode> #include <stdio.h> #include "omp_testsuite.h" int my_iterations; #pragma omp threadp...
matrix.c
#include <stdio.h> #include <omp.h> #define SIZE 1000 int a[SIZE][SIZE],b[SIZE][SIZE],res_seq[SIZE][SIZE],res_parallel[SIZE][SIZE]; void seq_matmul(int a[][SIZE],int b[][SIZE]) { int i,j,k; for(i=0;i<SIZE;++i) { for(j=0;j<SIZE;++j) { res_seq[i][j]=0; for(k=0;k<SIZE;++k) { res_seq[i][j] = res_seq[...
test.c
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #include <omp.h> #include <cilk/cilk.h> // maximum value of n #define NMAX 75000000 //#define NMAX 200 #define CHUNKSIZE 20 typedef struct{ int lt; int gt; } flag; ...
data45.h
// The data are synthesized. #ifndef _DATA_H_ #define _DATA_H_ #pragma omp declare target const int NODE_N=45; const int STATE_N=2; const int DATA_N=600; int data[DATA_N*NODE_N]={ 1,1,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1,0,1,0,0,1,1, 1,1,0,0,0,0,0,1,1,0,0,0,0,0,1,0,1,1,0,0,1,0,0,0...
pi-v3.c
/* * Compute pi by approximating the area under the curve f(x) = 4 / (1 + x*x) * between 0 and 1. * * parallel version using OpenMP */ #include <stdio.h> #include <stdlib.h> #include <omp.h> /* OpenMP */ #if _DEBUG_ #define _DEBUG_ 1 #else #define _DEBUG_ 0 #endif int main(int argc, char *argv[]) { do...
globals.h
#include <iostream> using std::cout; using std::endl; #ifndef _flops_globals_H #define _flops_globals_H //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////...
hybrid_hello.c
#include <stdio.h> #include <omp.h> #include "mpi.h" int main(int argc, char* argv[]) { int rank, size; int tid, thread_level; MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &thread_level); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); printf("Hello, world! I am the main...
convolution_1x1.h
// Tencent is pleased to support the open source community by making ncnn available. // // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. // // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy ...
SuperRayGenerator.h
/* * Copyright(c) 2016, Youngsun Kwon, Donghyuk Kim, and Sung-eui Yoon, KAIST * 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...
decl2.c
/* Process declarations and variables for C++ compiler. Copyright (C) 1988-2015 Free Software Foundation, Inc. Hacked 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 published by...
openmp_yield.c
#include <omp.h> #include <stdio.h> #include <stdint.h> #include <stdlib.h> #define NUM_TASKS 1000 #define VERBOSE static volatile int flag_one_cntr = 0; static volatile int flag_two_cntr = 0; int main(int argc, char **argv) { #pragma omp parallel #pragma omp master for (int i = 0; i < NUM_TASKS+omp_get_num_threa...
omp_threadprivate.c
// RUN: %libomp-compile-and-run // REQUIRES: !(abt && (clang || gcc)) /* * Threadprivate is tested in 2 ways: * 1. The global variable declared as threadprivate should have * local copy for each thread. Otherwise race condition and * wrong result. * 2. If the value of local copy is retained for the two adjacent ...
GB_binop__isne_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_concat_hyper.c
//------------------------------------------------------------------------------ // GB_concat_hyper: concatenate an array of matrices into a hypersparse matrix //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved...
test6.c
int g1; void foo () { g1=0; #pragma omp barrier 1+g1; } int main() { #pragma omp parallel { int p; g1=2; if (3) { p=4; g1 = 10; foo (); 5+g1; } else { p=6+g1; //#pragma omp atomic read // p = g1; #pragma omp barrier g1=7; } if (8) { 9=g1; foo(); g1=10+g1; } else { 11+g1;...
drhook.c
/** * (C) Copyright 2014- ECMWF. * * This software is licensed under the terms of the Apache Licence Version 2.0 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. * * In applying this licence, ECMWF does not waive the privileges and immunities * granted to it by virtue of its status as an in...
GB_binop__rdiv_uint32.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
mattran.c
#include "matrix.h" /** \brief Computes the transpose of a matrix * * \param[in] A Input matrix * \param[in] result Matrix to store the result * \return \f$ \mathbf{A}^T \f$ * */ MATRIX mat_tran(MATRIX A, MATRIX result) { int i, j, m, n; m = MatCol(A); n = MatRow(A); if(result==NULL) if((resul...
8990.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...
bli_dotv_bgq_int.c
/* BLIS An object-based framework for developing high-performance BLAS-like libraries. Copyright (C) 2014, The University of Texas at Austin Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Re...
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)...
prox_lib.h
/*! * Modifications Copyright 2017-2018 H2O.ai, Inc. */ #ifndef PROX_LIB_H_ #define PROX_LIB_H_ #include <algorithm> #include <cmath> #include <cstdio> #include <limits> #include <vector> #ifdef __CUDACC__ #include <thrust/device_vector.h> #include <thrust/functional.h> #include <thrust/inner_product.h> #include <t...
atomic_write_codegen.c
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -target-cpu core2 -fopenmp -x c -emit-llvm %s -o - | FileCheck %s // RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -target-cpu core2 -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -target-cpu core2 -include-pch %t ...
reduction.c
#include <stdio.h> #include <stdlib.h> float sum(const float *a, const size_t n); int main(int argc, char* argv[]) { const size_t n = 1<<10; size_t i; float *a; a = malloc(n*sizeof(float)); for (i = 0; i < n; i++) { a[i] = (float)i; } printf("Sum: %f\n", sum(a, n)); free(a); } float sum(const...
loop_order.c
#include <stdio.h> #include <omp.h> #define N 1024 #define THREADS 8 int main(void) { int errors = 0; int total_wait_errors = 0; int x[N]; int y[N]; int z[N]; int num_threads = -1; int rand_indexes[8]; for (int i = 0; i < N; i++) { x[i] = 1; y[i] = i + 1; z[i] = 2*(i + 1); } for (int ...
GxB_Vector_Option_get.c
//------------------------------------------------------------------------------ // GxB_Vector_Option_get: get an option in a vector //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX-License-Identifie...
omp_pause_resource.c
// RUN: %libomp-compile-and-run // Linking fails for icc 18/19 // UNSUPPORTED: icc-18, icc-19 #include <stdio.h> #include "omp_testsuite.h" int test_omp_pause_resource() { int fails, nthreads, my_dev; fails = 0; nthreads = 0; my_dev = omp_get_initial_device(); #pragma omp parallel #pragma omp single nthr...
GB_select_phase1.c
//------------------------------------------------------------------------------ // GB_select_phase1: count entries in each vector for C=select(A,thunk) //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SP...
Launcher.h
// SPDX-FileCopyrightText: 2020 CERN // SPDX-License-Identifier: Apache-2.0 /** * @file Launcher.h * @brief Backend-dependent abstraction for parallel function execution * @author Andrei Gheata (andrei.gheata@cern.ch) */ #ifndef COPCORE_LAUNCHER_H_ #define COPCORE_LAUNCHER_H_ #include <CopCore/Global.h> namespa...