Skip to content

Instantly share code, notes, and snippets.

@matthiasdiener
matthiasdiener / svmfuse.sh
Last active September 20, 2022 20:39
Install emirge with the Fusion Array Context and SVM support
#!/bin/bash
# A script to install emirge with the Fusion Array Context and SVM support
# THIS SCRIPT IS LIKELY NOT NECESSARY ANYMORE
# Open PRs that are involved for SVM:
# - https://github.com/pocl/pocl/pull/1067
set -ex
#define lid(N) ((int) get_local_id(N))
#define gid(N) ((int) get_group_id(N))
#if __OPENCL_C_VERSION__ < 120
#pragma OPENCL EXTENSION cl_khr_fp64: enable
#endif
static void apply_inv_vandermonde_knl(int const n_from_dofs, int const nelements, __global double const *__restrict__ nodal_coeffs, __global double *__restrict__ result, __global double const *__restrict__ vdm_inv);
static void face_mass(__global double const *__restrict__ jac_surf, __global double const *__restrict__ mat, int const nelements, int const nface_nodes, int const nfaces, int const nvol_nodes, __global double *__restrict__ result, __global double const *__restrict__ vec);
static void resample_by_picking(__global double const *__restrict__ ary, int const nelements_vec, int const n_from_nodes, __global long const *__restrict__ from_element_indices, int const n_to_nodes, int const nelements, __global int const *__restrict__ pick_list, __global double *__restrict__ result);
static void resample_by_picking_0(__global double const *__restrict__
@matthiasdiener
matthiasdiener / build-pocl.sh
Last active October 6, 2022 00:56
Script to build pocl and pyopencl from source
#!/bin/bash
set -o errexit
pushd .
### Conda
MINIFORGE_INSTALL_PREFIX=$PWD/miniforge3
@matthiasdiener
matthiasdiener / build-gcc-offload-nvptx.sh
Last active May 29, 2024 14:11
Script to build gcc with OpenMP offloading to Nvidia devices (via nvptx)
#!/bin/bash
#
# Build GCC with support for offloading to NVIDIA GPUs.
#
set -o nounset -o errexit
# Location of the installed CUDA toolkit
cuda=/usr/local/cuda
@matthiasdiener
matthiasdiener / rustinst_ppc64le.sh
Last active April 24, 2019 01:10
[OUTDATED] Installation script for rustup/rust on RHEL 7/CentOS 7 PowerPC (ppc64le) (the precompiled rustup binaries do not work on these systems)
#!/bin/bash
set -o nounset -o errexit
# Make sure we are running on ppc64le. If not, need to adjust the URLs below
[[ $(arch) == "ppc64le" ]] || { echo "This script needs to be run on ppc64le, not $(arch)."; exit 1; }
rm -rf rustinst/
mkdir rustinst
cd rustinst
@matthiasdiener
matthiasdiener / package.py
Last active February 27, 2019 22:28
**EDIT: This is not necessary anymore, the package has been merged to spack.** spack gcc package with nvptx offloading (Nvidia, CUDA)
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
from spack.operating_systems.mac_os import macos_version
from llnl.util import tty
import glob