Skip to content

Instantly share code, notes, and snippets.

View gonidelis's full-sized avatar

Giannis Gonidelis gonidelis

  • CCCL @ Nvidia
  • San Francisco Bay Area, CA
  • X @gonidelis
View GitHub Profile
@gonidelis
gonidelis / slurm.sh
Created December 6, 2021 15:27
slurm.sh
export APEX_TASK_SCATTERPLOT=1
./bin/local_par_for
#include <hpx/hpx.hpp>
#include <hpx/hpx_main.hpp>
int main()
{
hpx::execution::experimental::fork_join_executor exec(
hpx::threads::thread_priority::normal,
hpx::threads::thread_stacksize::small_,
hpx::execution::experimental::fork_join_executor::loop_schedule::dynamic);
@gonidelis
gonidelis / CMakeLists.txt
Created October 12, 2021 16:05
Compile HPX along with range-v3
# Copyright (c) Srinivas Vasu 2021
# Copyright (c) Akhil Nair 2021
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
cmake_minimum_required(VERSION 3.17)
@gonidelis
gonidelis / error.sh
Last active April 6, 2021 14:19
link
error: no match for ‘operator|’ (operand types are ‘ranges::zip_view<ranges::repeat_view<int>, ranges::ref_view<std::vector<int, std::allocator<int> > > >’ and ‘ranges::views::view_closure<ranges::detail::bind_back_fn_<ranges::views::transform_base_fn, main()::<lambda(int)> > >’)
16 | auto ax = ranges::views::zip(ranges::views::repeat(a), x) | ranges::views::transform(mult);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | ranges::views::view_closure<ranges::detail::bind_back_fn_<ranges::views::transform_base_fn, main()::<lambda(int)> > >
| ranges::zip_view<ranges::repeat_view<int>, ranges::ref_view<std::vector<int, std::allocator<int> > > >
@gonidelis
gonidelis / transform_loop.hpp
Created July 30, 2020 20:13
adapted transform loop
namespace detail {
template <typename Iter>
struct transform_loop
{
template <typename InIterB, typename InIterE, typename OutIter, typename F>
HPX_HOST_DEVICE HPX_FORCEINLINE static util::in_out_result<InIterB, OutIter>
call(InIterB first, InIterE last, OutIter dest, F&& f)
{
for (/* */; first != last; (void) ++first, ++dest)
{
In file included from /home/giannis/foreach_adapt/libs/include/include/hpx/include/parallel_for_each.hpp:10,
from /home/giannis/foreach_adapt/libs/algorithms/tests/unit/container_algorithms/foreach_adapt.cpp:2:
/home/giannis/foreach_adapt/libs/algorithms/include/hpx/parallel/algorithms/for_each.hpp: In instantiation of ‘static typename std::enable_if<(! hpx::traits::is_random_access_iterator<InIterB>::value), InIterB>::type hpx::parallel::v1::detail::for_each<Iter>::sequential(ExPolicy&&, InIterB, InIterE, F&&, Proj&&) [with ExPolicy = const hpx::parallel::execution::sequenced_policy&; InIterB = Iterator<long int>; InIterE = Sentinel<long int>; F = void (&)(int); Proj = hpx::parallel::util::projection_identity; Iter = Iterator<long int>; typename std::enable_if<(! hpx::traits::is_random_access_iterator<InIterB>::value), InIterB>::type = Iterator<long int>]’:
/home/giannis/foreach_adapt/libs/algorithms/include/hpx/parallel/algorithms/detail/dispatch.hpp:108:44: required from ‘typename hpx::p
#include <hpx/hpx_main.hpp>
#include <hpx/include/parallel_for_each.hpp>
#include <hpx/modules/testing.hpp>
#include "iter_sent.hpp"
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <iostream>
/home/giannis/foreach_adapt/libs/algorithms/include/hpx/parallel/util/detail/algorithm_result.hpp: In instantiation of ‘static hpx::parallel::util::detail::algorithm_result_impl<ExPolicy, T>::type hpx::parallel::util::detail::algorithm_result_impl<ExPolicy, T>::get(T_&&) [with T_ = Sentinel<long int>; ExPolicy = hpx::parallel::execution::sequenced_policy; T = Iterator<long int>; hpx::parallel::util::detail::algorithm_result_impl<ExPolicy, T>::type = Iterator<long int>]’:
/home/giannis/foreach_adapt/libs/algorithms/include/hpx/parallel/algorithms/for_each.hpp:427:35: required from ‘typename hpx::parallel::util::detail::algorithm_result<ExPolicy, T>::type hpx::parallel::v1::detail::for_each_(ExPolicy&&, FwdIterB, FwdIterE, F&&, Proj&&, std::false_type) [with ExPolicy = const hpx::parallel::execution::sequenced_policy&; FwdIterB = Iterator<long int>; FwdIterE = Sentinel<long int>; F = void (&)(int); Proj = hpx::parallel::util::projection_identity; typename hpx::parallel::util::detail::algorithm_result<ExPolicy
@gonidelis
gonidelis / cxx20_disable_sized_sentinel_for.cpp
Created June 16, 2020 11:46
feature check test for disable_sized_sentinel_for
#include <disable_sized_sentinel_for>
int main()
{
inline constexpr bool b = std::disable_sized_sentinel_for<void, void>;
return 0;
}
/home/john/hpx_is_sentinel_for/libs/performance_counters/src/performance_counter_set.cpp: In member function ‘std::vector<hpx::performance_counters::counter_value> hpx::performance_counters::performance_counter_set::get_counter_values(hpx::launch::sync_policy, bool, hpx::error_code&) const’:
/home/john/hpx_is_sentinel_for/libs/performance_counters/src/performance_counter_set.cpp:337:37: error: could not convert ‘hpx::util::unwrap(Args&& ...) [with Args = {std::vector<hpx::lcos::future<hpx::performance_counters::counter_value>, std::allocator<hpx::lcos::future<hpx::performance_counters::counter_value> > >}; decltype (unwrap_depth_impl<1>((forward<Args>)(hpx::util::unwrap::args)...)) = std::vector<hpx::lcos::future<hpx::performance_counters::counter_value> >]()’ from ‘std::vector<hpx::lcos::future<hpx::performance_counters::counter_value> >’ to ‘std::vector<hpx::performance_counters::counter_value>’
return hpx::util::unwrap(get_counter_values(reset));
~~~~~~~~~~~~~~~~~^~~~~~~~~~