source
stringlengths
3
92
c
stringlengths
26
2.25M
PIOpenMP.c
#include <stdio.h> #include <stdlib.h> #include <omp.h> int main(int argc, char *argv[]) { unsigned int processes = 8u; unsigned long iter = 1000000000ul; // 1E9 if (argc > 1) { processes = (unsigned int) atoi(argv[1]); } if (argc > 2) { iter = (unsigned long) atol(argv[2]); } ...
kernels.h
#pragma omp declare target unsigned int LCG_random(unsigned int * seed) { const unsigned int m = 2147483648; const unsigned int a = 26757677; const unsigned int c = 1; *seed = (a * (*seed) + c) % m; return *seed; } void LCG_random_init(unsigned int * seed) { const unsigned int m = 2147483648; const unsig...
convolutiondepthwise_3x3_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 copy ...
convolution_sgemm_packnto1.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 ...
3d25pt_var.c
/* * Order-1, 3D 25 point stencil with axis-symmetric ariable coefficients * 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) >...
parallel_team.c
// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s // REQUIRES: ompt // UNSUPPORTED: gcc, icc-19 #include "callback.h" int main() { #pragma omp target teams num_teams(1) thread_limit(2) #pragma omp parallel num_threads(2) { printf("In teams\n"); } return 0; } // CHECK: 0: NULL_POINTER=[[NULL:.*$]] //...
core_dgemm.c
/** * * @file * * PLASMA is a software package provided by: * University of Tennessee, US, * University of Manchester, UK. * * @generated from /home/luszczek/workspace/plasma/bitbucket/plasma/core_blas/core_zgemm.c, normal z -> d, Fri Sep 28 17:38:18 2018 * **/ #include <plasma_core_blas.h> #include "plas...
divsufsort.c
/* * divsufsort.c for libdivsufsort * Copyright (c) 2003-2008 Yuta Mori All Rights Reserved. * * 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 ...
genome.c
/* ============================================================================= * * genome.c * * ============================================================================= * * Copyright (C) Stanford University, 2006. All Rights Reserved. * Author: Chi Cao Minh * * =========================================...
Wparentheses-4.c
/* PR c/70436 */ /* { dg-additional-options "-Wparentheses -fno-openmp" } */ int a, b, c; void bar (void); void baz (void); void f1 (void); #pragma omp declare target to (bar, baz, f1, a, b, c) void f1 (void) { int i, j; if (a) /* { dg-warning "ambiguous" } */ #pragma omp distribute for (i = 0; i < 10; i...
ssytrs.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/zhetrs.c, normal z -> s, Fri Sep 28 17:38:07 2018 * **/ #include "plasma.h" #include "plasma_async.h" #inc...
fused_rowwise_nbitfake_conversion_ops.h
#pragma once #ifdef _OPENMP #include <omp.h> #endif #include "caffe2/core/context.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" #include "caffe2/operators/reducer_functors.h" #include "caffe2/utils/math.h" namespace caffe2 { namespace internal { inline bool is_little_endian() ...
rose_jacobi.c
#include "rex_kmp.h" #include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/timeb.h> #include <malloc.h> #include <immintrin.h> #include <immintrin.h> #define REAL float static double read_timer_ms() { struct timeb tm; ftime(&tm); return ((double )tm . time) * 1000.0 + ((double )tm . millitm);...
simd4.c
/* { dg-do compile } */ /* { dg-options "-fopenmp" } */ /* { dg-additional-options "-std=c99" { target c } } */ struct S *p; /* { dg-message "forward declaration" "" { target c++ } } */ float f; int j; void foo (void) { #pragma omp simd linear(p) linear(f : 1) /* { dg-error "linear clause applied to" "" { target *-...
GB_unaryop__lnot_uint16_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...
omp_for_schedule_auto.c
<ompts:test> <ompts:testdescription>Test with omp for schedule auto</ompts:testdescription> <ompts:ompversion>3.0</ompts:ompversion> <ompts:directive>omp for auto</ompts:directive> <ompts:dependences>omp critical,omp parallel firstprivate</ompts:dependences> <ompts:testcode> #include <stdio.h> #include <math.h> #inclu...
fci_rdm.c
/* * */ #include <stdlib.h> #include <string.h> //#include <omp.h> #include "config.h" #include "vhf/fblas.h" #include "fci.h" #define MIN(X,Y) ((X)<(Y)?(X):(Y)) #define CSUMTHR 1e-28 #define BUFBASE 96 #define SQRT2 1.4142135623730950488 #define BRAKETSYM 1 #define PARTICLESY...
rt_dgetrf.c
#include "runtime.h" void RT_CORE_dgetrf(Quark *quark, Quark_Task_Flags *task_flags, int m, int n, int nb, double *A, int lda, int *IPIV, PLASMA_sequence *sequence, PLASMA_request *request, PLASMA_bool ch...
openmp_factors.c
/* Suggested makefile: ---------- P=openmp_factors CFLAGS=`pkg-config --cflags glib-2.0` -g -Wall -std=gnu99 -O3 -fopenmp LDLIBS=`pkg-config --libs glib-2.0` -fopenmp $(P): ---------- */ #include <omp.h> #include <stdio.h> #include <stdlib.h> //malloc #include <string.h> //memset #include "openmp_getmax.c" int main(...
OMPMixedList.h
/** \file OMPMixedList.h*/ #ifndef MIXEDLIST__H #define MIXEDLIST__H //! A structure that allocates memory as lists on an arena /** The MixedList structure allocates pieces of memory by request and in * an atomic manner by giving out memory indices. This way multiple lists can reside in the same buffer in a compact...
lcs_algorithm.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <omp.h> #define MAX(a, b) (a > b ? a : b) #define MIN(a, b) (a < b ? a : b) char* readFile(FILE *fin, char *txt, int block_size) { fseek(fin, 0L, SEEK_END); int sz = ftell(fin); txt = (char*)malloc((sz+1) * sizeof(char)); fseek(fin,...
recursive.c
int counter = 0; void foo() { #pragma omp critical { counter++; if (counter <100) foo(); } } int main() { foo(); return 0; }
parallel-simple.c
/* * parallel-simple.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 ...
solution.c
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <unistd.h> #include <omp.h> // Определение функции double Func(double x) { // Недействительные значения не должны вносить вклад в интеграл if (x > 2) { return 0; } return sqrt(4 - x*x); } // Формула Котеса рассчета определенного...
GB_binop__bset_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...
convolution_pack8to4_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 ...
par_vector.c
/****************************************************************************** * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) **************************************...
timer.h
/* * 'timer.h' * This file is part of the "trinity" project. * (https://github.com/hobywan/trinity) * Copyright 2016, Hoby Rakotoarivelo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in comp...
fft_impl_generic.h
/* Copyright 2017-2019 Michal Zientkiewicz 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 of conditions and the f...
layerramdistancetransform.h
/********************************************************************************* * * Inviwo - Interactive Visualization Workshop * * Copyright (c) 2017-2020 Inviwo Foundation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided th...
elkan_commons.c
#include "elkan_commons.h" #include "../../utils/vector/sparse/sparse_vector_math.h" #include "../../utils/global_defs.h" void calculate_cluster_distance_matrix(struct general_kmeans_context* ctx , VALUE_TYPE** dist_clusters_clusters , VALUE...
label_propagation.h
/****************************************************************************** * label_propagation.h * * Source of VieCut. * ****************************************************************************** * Copyright (C) 2017 Alexander Noe <alexander.noe@univie.ac.at> * * Published under the MIT license in the ...
epollex_test.c
/* * This file is part of ABCDK. * * MIT License * */ #include <stdio.h> #include <assert.h> #include <unistd.h> #include <string.h> #include <sys/sendfile.h> #include "util/general.h" #include "util/getargs.h" #include "util/clock.h" #include "util/thread.h" #include "util/signal.h" #include "util/epollex.h" v...
header.h
/*-------------------------------------------------------------------- c--------------------------------------------------------------------- c c header.h c c--------------------------------------------------------------------- c-------------------------------------------------------------------*/ /*---------------...
616fb.c
#define _POSIX_C_SOURCE 200809L #include "stdlib.h" #include "math.h" #include "sys/time.h" #include "xmmintrin.h" #include "pmmintrin.h" #include "omp.h" #include <stdio.h> #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) struct dataobj { void *restrict data; int *size; i...
exafmm.h
#ifndef exafmm_h #define exafmm_h #include <complex> #include <cstdio> #include <cstdlib> #include <vector> namespace exafmm { //! Basic type definitions typedef double real_t; //!< Floating point type is single precision typedef std::complex<real_t> complex_t; ...
task-2.c
extern void abort (void); int f1 (void) { int a = 6, e = 0; int nested (int x) { return x + a; } #pragma omp task { int n = nested (5); if (n != 11) #pragma omp atomic e += 1; } #pragma omp taskwait return e; } int f2 (void) { int a = 6, e = 0; int nested (int x) { retur...
GB_dense_subassign_06d_template.c
//------------------------------------------------------------------------------ // GB_dense_subassign_06d_template: C<A> = A where C is dense //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http://suite...
trmm.pluto.par.c
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <math.h> double A[N][N+20]; double B[N][N+20]; void init_arrays() { int i,j; for (i=0; i<N; i++) for (j=0; j<N; j++) { B[i][j] = (i+j) % 5 + 1; if (i < j) A[i][j] = (i+j) % 5 + 1; else if (i == j) A[i][j] = 1; else A[i][j...
omp_for_private.c
// RUN: %libomp-compile-and-run #include <stdio.h> #include <math.h> #include "omp_testsuite.h" /* Utility function do spend some time in a loop */ static void do_some_work() { int i; double sum = 0; for(i = 0; i < 1000; i++){ sum += sqrt ((double) i); } } int sum1; #pragma omp threadprivate(sum1) int test...
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 // //===---------------------------...
gep.c
#include <stdio.h> #include "./gep.h" #define CACHE_SIZE 32 /* An implementation of the Gaussian elimination paradigm for simple dynamic programming problems */ uint64_t get_entry(dp_matrix_t* X, uint64_t i, uint64_t j) { if (i > X->width || j > X->height) { return 0; // return 0 if the entry is out of rang...
GB_binop__lor_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...
matmul_int.c
/* * Square matrix multiplication * A[N][N] * B[N][N] = C[N][N] * */ #include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/timeb.h> #include <malloc.h> #define N 512 //#define N 16 // read timer in second double read_timer() { struct timeb tm; ftime(&tm); return (double) tm.time + (do...
parallel.c
#include <omp.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include "matrix_functions.h" int main(int argc, char const *argv[]) { if (argc != 3) { fprintf(stderr, "Error. Entregar el 'n' y el numero de hilos.\nEjemplo: par 400 4\n"); return -1; } srand(time(NUL...
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> ...
par_mod_lr_interp.c
/****************************************************************************** * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) **************************************...
GB_unop__lnot_int16_int16.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...
gm_set.h
#ifndef GM_SET_H #define GM_SET_H #include <set> #include "gm_internal.h" #include "gm_lock.h" template<typename T> class gm_sized_set { public: gm_sized_set(size_t _max_sz) : max_sz(_max_sz), byte_map(NULL), setLock(0) { is_small = true; est_size = 0; // init...
scheduled-clause.c
#include <stdio.h> #include <stdlib.h> #ifdef _OPENMP #include <omp.h> #else #define omp_get_thread_num() 0 #endif int main(int argc, char **argv) { int i, n=16,chunk,a[n],suma=0; if(argc < 2) { fprintf(stderr,"\nFalta chunk \n"); exit(-1); } chunk = atoi(argv[1]); for (i=0; i<n; i++) a[i] = i...
sum.c
/* * Assignment 2 (CSE436) * Kazumi Malhan * 06/08/2016 */ #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <sys/timeb.h> /* read timer in second */ double read_timer() { struct timeb tm; ftime(&tm); return (double) tm.time + (double) tm.millitm / ...
OpenMPClause.h
//===- OpenMPClause.h - Classes for OpenMP clauses --------------*- 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 // //===---------------------------...
enhance.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
markstm.c
//** 2 functions called from i2.c **// /* Move markers by using simple Runge-Kutta method */ void movemarkomp() { /* Vx, Vy buffer */ double dvxdx,dvxdy,dvydx,dvydy,celdx,celdy,vx0,vx1,vx2,vx3,vx4,vy0,vy1,vy2,vy3,vy4,ee0,ee1,ee2,ee3,ee4,sp0,sp1,sp2,sp3,sp4,pr0,pr1,pr2,pr3,pr4; /* Water */ double vxwater,vywater; ...
allocator.h
#pragma once #include <queue> #include "adabs/pgas_addr.h" #include "adabs/tools/alignment.h" namespace adabs { namespace collective { namespace pgas { inline void remote_allocate_real(gasnet_token_t token, gasnet_handlerarg_t arg0, gasnet_handlerarg_t arg1, ...
GB_binop__plus_fp64.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX...
GB_bitmap_masker_template.c
//------------------------------------------------------------------------------ // GB_bitmap_masker_template: phase2 for R = masker (C, M, Z), R is bitmap //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. /...
blast_traceback.c
/* $Id: blast_traceback.c 604796 2020-04-02 12:32:43Z fongah2 $ * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government...
GB_unop__abs_fp32_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...
GB_binop__bor_int64.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX...
libgomp.h
/* Copyright (C) 2005-2018 Free Software Foundation, Inc. Contributed by Richard Henderson <rth@redhat.com>. This file is part of the GNU Offloading and Multi Processing Library (libgomp). Libgomp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Licen...
GB_unop__identity_uint16_int32.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...
AlgebraicSpanningEdgeCentrality.h
/* * AlgebraicSpanningEdgeCentrality.h * * Created on: Jul 12, 2016 * Author: Michael Wegner (michael.wegner@student.kit.edu) */ #ifndef NETWORKIT_CPP_ALGEBRAIC_ALGORITHMS_ALGEBRAICSPANNINGEDGECENTRALITY_H_ #define NETWORKIT_CPP_ALGEBRAIC_ALGORITHMS_ALGEBRAICSPANNINGEDGECENTRALITY_H_ #include "../../centra...
GB_apply_op.c
//------------------------------------------------------------------------------ // GB_apply_op: typecast and apply a unary operator to an array //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http://sui...
jacobi_omp.c
/* * Copyright (c) 2008, BSC (Barcelon Supercomputing Center) * 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,...
ten_tusscher_2004_epi_S2_14.c
//Original Ten Tusscher #include <assert.h> #include <stdlib.h> #include "ten_tusscher_2004_epi_S2_14.h" GET_CELL_MODEL_DATA(init_cell_model_data) { assert(cell_model); if(get_initial_v) cell_model->initial_v = INITIAL_V; if(get_neq) cell_model->number_of_ode_equations = NEQ; } //TODO...
GB_binop__ldexp_fp32.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
residualbased_elimination_builder_and_solver_with_constraints.h
// | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: Vicente Mataix Ferrandiz // ...
ast-dump-openmp-section.c
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -ast-dump %s | FileCheck --match-full-lines -implicit-check-not=openmp_structured_block %s void test() { #pragma omp sections { #pragma omp section ; } } // CHECK: TranslationUnitDecl {{.*}} <<invalid sloc>> <invalid sloc> // CHECK: `-FunctionDecl {{....
GB_unaryop__minv_int64_int8.c
//------------------------------------------------------------------------------ // GB_unaryop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http...
StmtOpenMP.h
//===- StmtOpenMP.h - Classes for OpenMP directives ------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
GB_unop__identity_int64_fc64.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-Li...
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...
shmem_ctx.c
/* * Copyright (c) 2017 Intel Corporation. All rights reserved. * This software is available to you under the BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redi...
image.c
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
ompfor-decremental.c
/* * default, decremental */ #include <stdio.h> #ifdef _OPENMP #include <omp.h> #endif int foo(int lower, int upper, int stride) { int i; #pragma omp for for (i=lower;i>upper;i-=stride) { printf("Iteration %2d is carried out by thread %2d\n",\ i, omp_get_thread_num()); } } int main(void) { #prag...
gravity_soft.h
#pragma once #include "cutfunc.h" template <class Tpsys, class Tptree> void correctForceLong(Tpsys & pp, Tptree & tree_grav, NeighborList & NList, PS::S32 & n_ngb_tot, PS::S32 & n_with_ngb) { const PS::S32 n_loc = pp.getNumber...
constCurvModel3d.c
/* Include constant curvature drivers for all dimensions here */ /* System headers */ #include <stdio.h> #include <stdlib.h> #include <math.h> /* Local headers */ #include "QSSLIB_config.h" #include "qss_options.h" #include "qss_spatial_derivatives3d.h" #include "qss_tvd_runge_kutta3d.h" #include "qss_data_arrays.h...
Example_nesting_restrict.1.c
/* * @@name: nesting_restrict.1c * @@type: C * @@compilable: no * @@linkable: no * @@expect: failure */ void work(int i, int j) {} void wrong1(int n) { #pragma omp parallel default(shared) { int i, j; #pragma omp for for (i=0; i<n; i++) { /* incorrect nesting of loop regions */ #pragma ...
GB_binop__bget_uint8.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-...
GB_binop__ne_fc64.c
//------------------------------------------------------------------------------ // GB_binop: hard-coded functions for each built-in binary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http:...
GB_matvec_type.c
//------------------------------------------------------------------------------ // GB_matvec_type: return the type of a matrix //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-License-Identifier: Ap...
fft_util_omp45.c
#include <complex.h> #include <cufft.h> #include <cuda_device_runtime_api.h> #include <cuda.h> #include <cuda_runtime.h> #include "mytypes.h" #include "pf3d_fft.h" #include "util.h" #include "runparm.h" #include "pf3dbench.h" #define dns(a,b,c) dns[CELTNDX3(a,b,c)] #define grd(a,b,c) grd[CELTNDX(a,b,c)] void rcmp2de...
kernels.h
#pragma omp declare target /* POSITIVEINFINITY * Returns maximum value of a type */ float positiveInfinity(float tmp) { return FLT_MAX; } double positiveInfinity(double tmp) { return DBL_MAX; } uint32_t positiveInfinity(uint32_t tmp) { return 0xFFFFFFFFUL; } uint64_t positiveInfinity(uint64_t tmp) { retur...
ASTMatchers.h
//===- ASTMatchers.h - Structural query framework ---------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
data.c
#include "data.h" #include "utils.h" #include "image.h" #include "dark_cuda.h" #include "box.h" #include "http_stream.h" #include <stdio.h> #include <stdlib.h> #include <string.h> extern int check_mistakes; #define NUMCHARS 37 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; list *get_paths(char *filename) { ...
ljForce.c
/// \file /// Computes forces for the 12-6 Lennard Jones (LJ) potential. /// /// The Lennard-Jones model is not a good representation for the /// bonding in copper, its use has been limited to constant volume /// simulations where the embedding energy contribution to the cohesive /// energy is not included in the two-b...
kdtree.c
/** @file kdtree.c ** @brief KD-tree - Definition ** @author Andrea Vedaldi, David Novotny **/ /* Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. All rights reserved. This file is part of the VLFeat library and is made available under the terms of the BSD license (see the COPYING file). */ /** <!-- ~~~...
GB_unaryop__lnot_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_subassign_08n.c
//------------------------------------------------------------------------------ // GB_subassign_08n: C(I,J)<M> += A ; no S //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved. // SPDX-License-Identifier: Apache...
loss.h
#pragma once #include "base/spmm.h" #include "base/binary_class_evaluation.h" #include "config.pb.h" #include "dmlc/data.h" #include "dmlc/io.h" namespace dmlc { namespace difacto { /** * \brief the loss function */ template <typename T> class Loss { public: /** * create and init the loss function * * @p...
utils.h
/********** C++ Routines for Linear Algebra Operations. Copyright (C) 2020-2021 Chunlin Li 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 3 of the License, or ...
lbfgsbsolver.h
// CppNumericalSolver // based on: // L-BFGS-B: A LIMITED MEMORY ALGORITHM FOR BOUND CONSTRAINED OPTIMIZATION // Richard H. Byrd, Peihuang Lu, Jorge Nocedal and Ciyou Zhu #include <iostream> #include <list> #include <Eigen/LU> #include "isolver.h" #include "../boundedproblem.h" #include "../linesearch/morethuente.h" #i...
dzamax.c
/** * * @file * * PLASMA is a software package provided by: * University of Tennessee, US, * University of Manchester, UK. * * @precisions normal z -> s d c * **/ #include "plasma.h" #include "plasma_async.h" #include "plasma_context.h" #include "plasma_descriptor.h" #include "plasma_internal.h" #include ...
GB_unop__cimag_fp64_fc64.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. // SPDX-Li...
GB_unop__identity_int32_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...
kthread_dump_pe.c
#include <pthread.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <string.h> #include "breads.h" #include "kvec.h" #include "config.h" #include <omp.h> /************ * kt_dump_pe_for() * ************/ struct kt_dump_pe_for_t; typedef struct { struct kt_dump_pe_for_t *t; long i, n; //i < n...
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...
GB_unop__identity_bool_fp32.c
//------------------------------------------------------------------------------ // GB_unop: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http://...
branch.c
/* Copyright (c) 2013, Intel Corporation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following di...