source
stringlengths
3
92
c
stringlengths
26
2.25M
newtonforwardinterpolation.c
#include<stdio.h> #define MAXN 100 #define ORDER 4 int main() { float ax[MAXN+1], ay [MAXN+1], diff[MAXN+1][ORDER+1], nr[ORDER+1], dr[ORDER+1],x,p,h,yp; int n,i,j,k; printf("\nEnter the value of n:\n"); scanf("%d",&n); printf("\nEnter the values in form x,y:\n"); for (i=0;i<=n;i++) s...
camp.c
/* (c) 1996,1997 Peter Sanders, Ingo Boesnach */ /* simulate a cellular automaton (serial version) * periodic boundaries * * #1: Number of lines * #2: Number of iterations to be simulated * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <omp.h> #include "random.h" #...
cartesiangrid.h
#ifndef GRIDGENERATOR_CARTESIANGRID_H #define GRIDGENERATOR_CARTESIANGRID_H #include <gcem.hpp> #include <common/surface.h> #include <set> #include <sfcmm_common.h> #include "cartesiangrid_base.h" #include "common/configuration.h" #include "common/IO.h" #include "geometry.h" #include "globaltimers.h" #ifdef SOLVER_AV...
LAGraph_matrix_extract_keep_dimensions.c
//------------------------------------------------------------------------------ // LAGraph_matrix_extract_keep_dimensions: extract submatrix but keep the // dimensions of the original matrix // ------------------------------------------------------------------------------ // LAGraph, (c) 2021 by The LAGraph Contribut...
loop1.c
#include <stdio.h> #include <omp.h> int main() { int i,j; int innerreps = 100; #pragma omp parallel private(j) { // for (j=0; j<innerreps; j++) { #pragma omp for schedule(static,2) for (i=0; i<32; i++) { printf ("thread %d is executing %d \n",omp_get_thread_num(),i); // ...
compatibility.h
// -*- C++ -*- // Copyright (C) 2007-2013 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...
Example_task_dep.11.c
/* * @@name: task_dep.11c * @@type: C * @@compilable: yes * @@linkable: no * @@expect: success * @@version: omp_5.0 */ #include<stdio.h> void set_an_element(int *p, int val) { *p = val; } void print_all_elements(int *v, int n) { int i; for (i = 0; i < n; ++i) { printf("%d, ", v[i...
batchnorm_kernel_arm.c
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * License); you ma...
error.c
//-------------------------------------------------------------------------// // // // This benchmark is an OpenMP C version of the NPB LU code. This OpenMP // // C version is developed by the Center for Manycore Programming at Seoul // // Nati...
dnnl_requantize-inl.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 ...
omp_parallel_for_firstprivate.c
// RUN: %libomp-compile-and-run #include <stdio.h> #include "omp_testsuite.h" int test_omp_parallel_for_firstprivate() { int sum ; int i2; int i; int known_sum; sum=0; i2=3; #pragma omp parallel for reduction(+:sum) private(i) firstprivate(i2) for (i = 1; i <= LOOPCOUNT; i++) { sum = sum + (i + i...
GB_binop__minus_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-...
morn_wave_FFT.c
/* Copyright (C) 2019-2020 JingWeiZhangHuai <jingweizhanghuai@163.com> Licensed under the Apache License, Version 2.0; 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 agreed to in wri...
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) ...
GB_binop__eq_uint8.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http:...
GrB_Matrix_serialize.c
//------------------------------------------------------------------------------ // GrB_Matrix_serialize: copy a matrix into a serialized array of bytes //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SP...
hello.c
#include <stdio.h> #include <omp.h> int main(int argc, char **argv) { #pragma omp parallel num_threads(6) { printf("Hello, multithreaded world: thread %d of %d\n", omp_get_thread_num(), omp_get_num_threads()); } return 0; }
builder.h
// Copyright (c) 2015, The Regents of the University of California (Regents) // See LICENSE.txt for license details #ifndef BUILDER_H_ #define BUILDER_H_ #include <algorithm> #include <cinttypes> #include <fstream> #include <functional> #include <type_traits> #include <utility> #include "command_line.h" #include "ge...
kdtree_index.h
/*********************************************************************** * Software License Agreement (BSD License) * * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. * * THE BSD LICENSE * * Redistribution an...
GB_reduce_build_template.c
//------------------------------------------------------------------------------ // GB_build_template: T=build(S), and assemble any duplicate tuples //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http:/...
simplest.c
int main() { int x; #pragma omp parallel { int p; if (1) { #pragma omp atomic write x = 0; } else { #pragma omp atomic read p = x; } #pragma omp barrier x; } }
convolution_3x3_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 ...
labyrinth.c
/* ============================================================================= * * labyrinth.c * * ============================================================================= * * Copyright (C) Stanford University, 2006. All Rights Reserved. * Author: Chi Cao Minh * * ======================================...
GB_unaryop__ainv_fp64_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...
relu_hcl_arm.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 ma...
laplace2d.c
/* * Copyright 2017 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 ...
GB_binop__ne_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-...
morphology.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
nmt_master_flat.c
#include "utils.h" static void purify_generic_flat(nmt_field_flat *fl,flouble *mask,fcomplex **walm0,flouble **maps_in,fcomplex **alms_out) { if(fl->pure_b || fl->pure_e) { nmt_purify_flat(fl,mask,walm0,maps_in,maps_in,alms_out); } else { int im1; for(im1=0;im1<fl->nmaps;im1++) fs_map_product(f...
RecordTable.h
/* * Souffle - A Datalog Compiler * Copyright (c) 2020, The Souffle Developers. All rights reserved. * Licensed under the Universal Permissive License v 1.0 as shown at: * - https://opensource.org/licenses/UPL * - <souffle root>/licenses/SOUFFLE-UPL.txt */ /*******************************************************...
GB_unop__abs_fp64_fc64.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http://...
GB_unop__identity_int64_uint32.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...
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 o...
atom_symmetry_class.h
// Copyright (c) 2013-2016 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...
paint.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
displacement_field_greedy.c
#include <assert.h> #include <math.h> #include <stdlib.h> #include <float.h> #include <string.h> #include <stdbool.h> #include "disptools.h" #include "displacement_field_greedy.h" #include "jacobian.h" #include "error.h" /*! * \brief Update the displacement field according to the error * on the Jacobian map....
GB_unaryop__identity_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...
drsdd.c
/*! @copyright (c) 2017 King Abdullah University of Science and * Technology (KAUST). All rights reserved. * * STARS-H is a software package, provided by King Abdullah * University of Science and Technology (KAUST) * * @file src/backends/openmp/blrm/drsdd.c * @version 1.3.0 * @a...
rndgen.c
// Generates a sequence of N random double precision values. // For each value x holds isfinite(x) == true but x is otherwise arbitrary. #include "common.h" int main(int argc, char *argv[]) { if (3 != argc) { (void)fprintf(stderr, "%s N FileName\n", argv[0]); return EXIT_FAILURE; } const size_t n = atoz(...
MaxLut.h
// -------------------------------------------------------------------------- // Binary Brain -- binary neural net framework // // Copyright (C) 2018 by Ryuji Fuchikami // https://github.com/ryuz // ryuji.fuch...
GB_add_phase0.c
//------------------------------------------------------------------------------ // GB_add_phase0: find vectors of C to compute for C=A+B or C<M>=A+B //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http:...
GB_binop__lxor_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-...
openmp_hello.c
/* Hello, World program for OpenMP. Jim Teresco, Siena College, Fall 2021 Based on example by Blaise Barney, LLNL at https://hpc.llnl.gov/tuts/openMP/#ProgrammingModel */ #include <omp.h> #include <stdio.h> int main (int argc, char *argv[]) { // These variables will be used to store the number of ...
trmv_x_csc_u_hi.c
#include "alphasparse/kernel.h" #include "alphasparse/util.h" #include "alphasparse/opt.h" #ifdef _OPENMP #include <omp.h> #endif static alphasparse_status_t trmv_csc_u_hi_omp(const ALPHA_Number alpha, const ALPHA_SPMAT_CSC *A, const ALPHA_Number *x, const ALPHA_Number b...
tally.h
#ifndef OPENMC_TALLIES_TALLY_H #define OPENMC_TALLIES_TALLY_H #include "openmc/constants.h" #include "openmc/tallies/filter.h" #include "openmc/tallies/trigger.h" #include <gsl/gsl> #include "pugixml.hpp" #include "xtensor/xfixed.hpp" #include "xtensor/xtensor.hpp" #include <memory> // for unique_ptr #include <unord...
field.c
/***************************************************************************** * * field.c * * Rank 1 objects: scalar fields, vector fields, and compressed tensor Q_ab. * * The data storage order is determined in memory.h. * * Lees-Edwards transformation is supported provided the lees_edw_t * object is su...
attribute.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
nmt_field_flat.c
#include "utils.h" nmt_k_function *nmt_k_function_alloc(int nk,flouble *karr,flouble *farr,flouble y0,flouble yf,int is_const) { nmt_k_function *f=my_malloc(sizeof(nmt_k_function)); f->is_const=is_const; f->y0=y0; if(!is_const) { f->x0=karr[0]; f->xf=karr[nk-1]; f->yf=yf; f->spl=gsl_spline_allo...
dlacpy.c
/** * * @file * * PLASMA is a software package provided by: * University of Tennessee, US, * University of Manchester, UK. * * @generated from /home/luszczek/workspace/plasma/bitbucket/plasma/compute/zlacpy.c, normal z -> d, Fri Sep 28 17:38:07 2018 * **/ #include "plasma.h" #include "plasma_async.h" #inc...
gemm.c
#include "gemm.h" #include "utils.h" #include "cuda.h" #include <stdlib.h> #include <stdio.h> #include <math.h> void gemm_bin(int M, int N, int K, float ALPHA, char *A, int lda, float *B, int ldb, float *C, int ldc) { int i,j,k; for(i = 0; i < M; ++i){ for(k = 0; k < K; ++k){...
data.c
#include "data.h" #include "utils.h" #include "image.h" #include "dark_cuda.h" #include "box.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #define NUMCHARS 37 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; list *get_paths(char *filename) { char *path; FILE *file = fopen(filename, "r"); ...
GB_unaryop__identity_bool_bool.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. // http...
sieve.c
/* Tempo - Sequencial 5761455 real 0m3.999s user 0m3.918s sys 0m0.068s 5761455 real 0m4.013s user 0m3.918s sys 0m0.076s 5761455 real 0m4.179s user 0m4.061s sys 0m0.091s 5761455 real 0m3.981s user 0m3.891s sys 0m0.076s 5761455 real 0m4.311s user 0m4.212s sys 0m0.088s 5761455 real 0m4.318s user 0m4.114s sys 0m0.179...
ars_vectorized_environment.h
#ifndef ARS_VECTORIZED_ENVIRONMENT_H #define ARS_VECTORIZED_ENVIRONMENT_H #include <algorithm> #include <thread> #include <functional> #include <vector> /// @param[in] nb_elements : size of your for loop /// @param[in] functor(start, end) : /// your function processing a sub chunk of the for loop. /// "start" is the ...
spmd2-fixed.c
/* spmd2.c * ... illustrates the SPMD pattern in OpenMP, * using the commandline arguments * to control the number of threads. * * Joel Adams, Calvin College, November 2009. * * Usage: ./spmd2 [numThreads] * * Exercise: * - Compile & run with no commandline args * - Rerun with different commandline args */ #include ...
parallel_transform.h
namespace Rcpp{ namespace parallel{ #if defined(RCPP11_EXPERIMENTAL_PARALLEL) template <typename InputIterator, typename OutputIterator, typename Function> void transform( int nthreads, InputIterator begin, InputIterator end, OutputIterator target, Function fun ){ std::vect...
sum_openmp.c
/* Copyright (C) 2018 Francesc Alted http://blosc.org License: BSD 3-Clause (see LICENSE.txt) Example program showing how to operate with compressed buffers. To compile this program for synthetic data (default): $ gcc -fopenmp -O3 sum_openmp.c -o sum_openmp -lblosc2 To run: $ OMP_PROC_BIND=spread ...
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 // //===---------------------------...
GB_binop__isge_uint16.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
quantize.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
Stencil_par3.c
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include "malloc2D.h" #include "timer.h" int main(int argc, char *argv[]) { struct timespec tstart_cpu, tstop_cpu; double cpu_time; int imax=2002, jmax = 2002; int niter=1000, nburst=100; double** restrict x = malloc2D(jmax, imax); dou...
mandel-omp-for-row.c
/* * Sequential Mandelbrot program * * This program computes and displays all or part of the Mandelbrot * set. By default, it examines all points in the complex plane * that have both real and imaginary parts between -2 and 2. * Command-line parameters allow zooming in on a specific part of * this range. ...
plex.c
/* * compute the duplex structure of two RNA strands, * allowing only inter-strand base pairs. * see cofold() for computing hybrid structures without * restriction. * Ivo Hofacker * Vienna RNA package * */ /*...
AI_model1.c
#include"AI.h" #include <omp.h> #define MAXSTEP 3 //#define CHECK_SCORE //This is for simple spawn //the simulation function for the branches in the searching tree int ai_model1_simulate(GameState *gameState, Player *player, int depth) { if(depth<=0)return ai_sum_scores(gameState,player); int MaxScore=-60000...
bml_adjungate_triangle_ellpack_typed.c
#include "../../macros.h" #include "../../typed.h" #include "../bml_introspection.h" #include "../bml_logger.h" #include "../bml_types.h" #include "bml_adjungate_triangle_ellpack.h" #include "bml_types_ellpack.h" #include <stdio.h> #include <stdlib.h> #include <complex.h> #include <math.h> #ifdef _OPENMP #include <o...
GB_binop__times_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-...
OpenMPClause.h
//===- OpenMPClause.h - Classes for OpenMP clauses --------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Matrix.h
#pragma once #include <Vector.h> namespace freeaml { /** * @brief @c Matrix<T> is a class suited for representing dense matrices. * * This class stores a matrix of elements of type @c T. It overloads the * addition (+), subtraction (-), multiplication (*) and division (/) operators * for supporting common matrix...
sum.c
//sum.c #include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/timeb.h> #include <malloc.h> #define N_RUNS 1000 #define N 120000 // read timer in second double read_timer() { struct timeb tm; ftime(&tm); return (double) tm.time + (double) tm.millitm / 1000.0; } //Create a matrix and a vec...
FEMTree.h
/* Copyright (c) 2006, Michael Kazhdan and Matthew Bolitho 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 copyright notice, this list of conditions ...
SpatialConvolutionMM.c
#ifndef TH_GENERIC_FILE #define TH_GENERIC_FILE "THNN/generic/SpatialConvolutionMM.c" #else #include <ATen/div_rtn.h> static inline void THNN_(SpatialConvolutionMM_shapeCheck)( THTensor *input, THTensor *gradOutput, THTensor *weight, THTensor *bias, int kH, int kW, int dH, int dW, int padH, int padW, int weight_nu...
resize-inl.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 may no...
Parallel Programming in C - Linear Search.c
#include <stdio.h> #include <stdlib.h> #include <time.h> #include "omp.h" /* OpenMP implementation example Details of implementation/tutorial can be found here: http://madhugnadig.com/articles/parallel-processing/2017/02/25/parallel-computing-in-c-using-openMP.html */ clock_t t; double cpu_time_used; int linearSearc...
truecrypt_fmt_plug.c
/* * TrueCrypt volume support for John The Ripper * * Written by Alain Espinosa <alainesp at gmail.com> in 2012. No copyright * is claimed, and the software is hereby placed in the public domain. * In case this attempt to disclaim copyright and place the software in the * public domain is deemed null and void, t...
jacobi-block-for.cuda.c
#include "hclib.h" #ifdef __cplusplus #include "hclib_cpp.h" #include "hclib_system.h" #ifdef __CUDACC__ #include "hclib_cuda.h" #endif #endif # include "poisson.h" /* #pragma omp task/taskwait version of SWEEP. */ void sweep (int nx, int ny, double dx, double dy, double *f_, int itold, int itnew, double *u_, ...
serial_tree_learner.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_TREELEARNER_SERIAL_TREE_LEARNER_H_ #define LIGHTGBM_TREELEARNER_SERIAL_TREE_LEARNER_H_ #include <LightGBM/dataset.h> #include <Ligh...
kernels.c
#include <math.h> /* This routine computes the 2-norm of a vector */ double norm2(int n, double *x){ int i; double res; res = 0.0; /* CC: reduction is necessary to have a correct result */ #pragma omp parallel for reduction(+:res) for(i=0; i<n; i++) res += x[i]*x[i]; res = sqrt(res); return res;...
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...
nlcpy_argsort.c
/* # # * The source code in this file is developed independently by NEC Corporation. # # # NLCPy License # # # Copyright (c) 2020-2021 NEC Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following c...
commondraw.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...
diagsm_x_sky_n_col.c
#include "alphasparse/kernel.h" #include "alphasparse/util.h" #include "alphasparse/opt.h" #include <memory.h> #ifdef _OPENMP #include <omp.h> #endif alphasparse_status_t ONAME(const ALPHA_Number alpha, const ALPHA_SPMAT_SKY *A, const ALPHA_Number *x, const ALPHA_INT columns, const ALPHA_INT ldx, ALPHA_Number *y, cons...
Sqrt.c
#ifndef TH_GENERIC_FILE #define TH_GENERIC_FILE "generic/Sqrt.c" #else static int nn_(Sqrt_updateOutput)(lua_State *L) { THTensor *input = luaT_checkudata(L, 2, torch_Tensor); real bias = luaT_getfieldchecknumber(L,1,"eps"); THTensor *output = luaT_getfieldcheckudata(L, 1, "output", torch_Tensor); THTensor_(r...
GrB_BinaryOp_wait.c
//------------------------------------------------------------------------------ // GrB_BinaryOp_wait: wait for a user-defined GrB_BinaryOp to complete //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPD...
3d25pt.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-2, 3D 25 point stencil * Adapted from PLUTO and Pochoir test bench * * Tar...
DRB071-targetparallelfor-orig-no.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...
kmp_sch_simd_runtime_guided.c
// RUN: %libomp-compile // RUN: env OMP_SCHEDULE=guided %libomp-run // RUN: env OMP_SCHEDULE=guided,1 %libomp-run 1 // RUN: env OMP_SCHEDULE=guided,2 %libomp-run 2 // RUN: env OMP_SCHEDULE=dynamic %libomp-run // RUN: env OMP_SCHEDULE=dynamic,1 %libomp-run 1 // RUN: env OMP_SCHEDULE=dynamic,2 %libomp-run 2 // RUN...
omp_task_red_taskloop.c
// RUN: %libomp-compile-and-run #include <stdio.h> #include <omp.h> int r; int work(int k, int l) { return k + l + 1; } void bar(int i) { #pragma omp taskgroup task_reduction(+:r) { int th_gen = omp_get_thread_num(); #pragma omp task in_reduction(+:r) firstprivate(i, th_gen) { r += work(i, 0); printf("e...
ag.h
int algoritmoGenetico(int N, int p, int np, Chromo *Best, int prob, int numMaxGen, clock_t start) { int numthreads = 5; omp_set_num_threads(numthreads); int posminlocal; int countGen = 0; // Contador de Generaciones Chromo *parents = (Chromo *)malloc(sizeof(Chromo) * np); Chromo *population = (...
expected_output.c
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> #include <sys/time.h> //--------------------------------------------------------------------- // program SP //--------------------------------------------------------------------- //---------- // Class S: //---------- //---------- // Class W: ...
array_init.c
// Test the handling of two loops under omp for // watch the loop index replacement (private by default) int main(void) { int i, j; float u[500][500]; #pragma omp parallel for for (i=0; i<500; i++) for (j=0; j<500; j++) { u[i][j] = 0.0; } return 0; }
GB_unaryop__minv_uint64_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...
pi_atomic.c
/* * A parallel pi program using atomic operations * * Author: Matt Cufari * Version: 1.0.0 * Date Created Dec 18 2020 * Date Last Modified Jan 4 2021 */ #include <stdio.h> #include <omp.h> static long num_steps = 1000000; double step; #define NUM_THREADS 2 void main(){ double pi; int nthreads; step = 1...
polybench.c
/** * polybench.c: This file is part of the PolyBench/C 3.2 test suite. * * * Contact: Louis-Noel Pouchet <pouchet@cse.ohio-state.edu> * Web address: http://polybench.sourceforge.net * License: /LICENSE.OSU.txt */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <assert.h> ...
countsort.c
// ----------------------------------------------------------------------------- // // "00_AccelGraph" // // ----------------------------------------------------------------------------- // Copyright (c) 2014-2019 All rights reserved // ----------------------------------------------------------------------------- ...
row_major_kernels.h
#ifndef ROW_MAJOR_KERNELS_H #define ROW_MAJOR_KERNELS_H extern "C" { /*! * Row-Major matrix sketching with CountSketch and Gaussian transforms. Parallelized with OpenMP. * A is a n*d row-major matrix. S is a r*n CountSketch. C is a row major matrix. * If m == 0: C has size r * d and we only apply C <- S * A...
embedded_fehlberg_7_8.c
//////////////////////////////////////////////////////////////////////////////// // File: embedded_fehlberg_7_8.c // // Routines: // // Embedded_Fehlberg_7_8 ...
reduction.c
#include <stdio.h> #define N 1000000ll #define SUM (N * (N-1)/2) int main (void) { long long a, i; #pragma omp target parallel map(tofrom: a) shared(a) private(i) { #pragma omp master a = 0; #pragma omp barrier #pragma omp for reduction(+:a) for (i = 0; i < N; i++) { a += i; ...
work.c
#include "work.h" #include <stdio.h> #include <inttypes.h> /** * Copy: * for all threads: * for (j=0;j<repeats) * for (i=offset;i<size+offset) * alla[thread_nr][i]=allb[thread_nr][i] * resulting in size*repeats*2*sizeof(double) accessed bytes **/ double copy_(double **alla, double **allb, unsigned long long...
Graph.h
#ifndef BasicGraph #define BasicGraph /* * Graph.h: * manage nodes in a neural network model * * Created on: Apr 21, 2017 * Author: mszhang */ //#include "Eigen/Dense" #include "Node.h" #include "MyLib.h" //using namespace Eigen; // one Node means a vector // the col should be 1, because we aimed for NLP ...
trsm_x_csr_u_hi_row.c
#include "alphasparse/kernel.h" #include "alphasparse/util.h" #include "alphasparse/opt.h" alphasparse_status_t ONAME(const ALPHA_Number alpha, const ALPHA_SPMAT_CSR *A, const ALPHA_Number *x, const ALPHA_INT columns, const ALPHA_INT ldx, ALPHA_Number *y, const ALPHA_INT ldy) { ALPHA_INT m = A->rows; int num_t...