Skip to content

Instantly share code, notes, and snippets.

View biddisco's full-sized avatar

John Biddiscombe biddisco

  • CSCS
View GitHub Profile
// Taken from stdexec inline scheduler and modified accordingly
/*
* Copyright (c) 2021-2022 NVIDIA Corporation
*
* Licensed under the Apache License Version 2.0 with LLVM Exceptions
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* https://llvm.org/LICENSE.txt
#pragma once
#include <exception>
#include <tuple>
#include <type_traits>
#include <utility>
//
#include <pika/assert.hpp>
#include <pika/config.hpp>
//
#pragma once
#if !defined(NMC_HAVE_HPX)
#error "this header can only be loaded if NMC_HAVE_HPX is set"
#endif
#include <hpx/hpx.hpp>
#include <hpx/hpx_main.hpp>
#include <hpx/runtime.hpp>
#include <hpx/runtime/threads/detail/thread_num_tss.hpp>
#include <vector>
#include <cassert>
#include <iostream>
/* The template parameter is named 'E' for 'Expression' */
template <typename E>
// A CRTP base class for Vecs with a size and indexing:
class VecExpression {
public:
Starting test on two terminals
bbpbg2
------
bin/hello_world --hpx:threads=1 -Ihpx.parcel.verbs.enable=1 --hpx.debug-attach=exception --hpx:localities=2 --hpx:nodes bbpbgas049 bbpbgas050 --hpx:endnodes --hpx:node 1 -Ihpx.parcel.bootstrap=tcp
bin/hello_world --hpx:threads=1 -Ihpx.parcel.verbs.enable=1 --hpx.debug-attach=exception --hpx:localities=2 --hpx:nodes bbpbgas049 bbpbgas050 --hpx:endnodes --hpx:node 2 -Ihpx.parcel.bootstrap=tcp
bbpviz1
@biddisco
biddisco / gist:cbce4206e57a07c9157f
Created February 7, 2015 10:55
function templates
#include <functional>
#include <tuple>
#include <utility>
#include <iostream>
int rpc_hello(int a, float c, double *result1, double *result2) {
std::cout << "Hello, int " << a << " float " << c << std::endl;
*result1 = 999.99;
*result2 = 777.77;
return 0;
# OSU MPI Latency Test
# Size Latency (us)
0 14.67
1 19.89
2 19.83
4 19.71
8 19.92
16 19.96
32 20.27
64 20.34
/Users/biddisco/build/vtkm$ make
[ 4%] Built target TestBuild_vtkm
[ 6%] Built target TestBuild_vtkm_testing
[ 12%] Built target UnitTests_kit_vtkm_testing
[ 17%] Built target TestBuild_vtkm_internal
[ 19%] Built target UnitTests_kit_vtkm_internal_testing
[ 36%] Built target TestBuild_vtkm_cont
[ 46%] Built target TestBuild_vtkm_cont_internal
[ 50%] Built target UnitTests_kit_vtkm_cont_internal_testing
[ 55%] Built target TestBuild_vtkm_cont_arg
@biddisco
biddisco / compile time string array
Created November 28, 2014 23:03
compile time string array
#include <array>
#include <iostream>
template<char... Cs>
struct string
{
static constexpr std::array<char,sizeof...(Cs)+1> value = {{Cs...,'\0'}};
constexpr operator const char*()
{
@biddisco
biddisco / Template typelist example
Last active March 21, 2016 13:57
Template typelist example
// to test compilation online
// http://melpon.org/wandbox
#include <type_traits>
#include <iostream>
#include <string>
// The typelist template
template<typename... Ts>
struct list{};