Skip to content

Instantly share code, notes, and snippets.


Eyal Rozenberg eyalroz

View GitHub Profile
View vector_add.cpp
#include <stdio.h>
#include <math.h>
#ifdef __APPLE__
#include <OpenCL/cl.hpp>
#include <CL/cl.hpp>
eyalroz / proxy.hpp
Created November 8, 2021 22:17
A generic proxy class for replacing getters and setters
View proxy.hpp
#include <type_traits>
#include <utility>
# if __cplusplus >= 201402L
# define CONSTEXPR_SINCE_CPP14 constexpr
# else
# endif
eyalroz / benchmark.cpp
Last active April 5, 2020 23:24
benchmarks for stackoverflow question 61047308
View benchmark.cpp
#include <geiger/geiger.h>
#include <cmath>
#include <cstdlib>
#include <string>
#include <iostream>
#include <random>
namespace aliberro {
eyalroz /
Last active July 23, 2019 08:37
Better column abstraction in cudf - rejoinder 1

Rejoinder to the initial design document / proposal

These comments and questions follow this gist by Jacob Hemstad. They appear in order of the text in Jacob's gist. Please excuse the somewhat argumentative/critical tone - I'm actually very pleased that we are hammering this out.

We want to write an algorithm once and allow it to work on a variety of columns.

Well, yes, but aren't we doing that now already?

eyalroz / limits.cuh
Created October 21, 2017 10:57
CUDA-compatible version of C++ <limits>
View limits.cuh
// CUDA-device-accessible version of gcc 4.9.3's <limits>. -*- C++ -*-
* The C++ standard library's numeric_limits classes cannot currently be used
* in device code, since their methods are not marked __host__ __device__, and
* even though they're constexpr - CUDA 7.5 and earlier does not properly support
* using __host__ constpexr's on the device (there's experimental support but
* it causes trouble in different places).
eyalroz /
Created April 15, 2017 20:28
Shell script for determining the SM value for your (single) GPU
# Prints the compute capability of the first CUDA device installed
# on the system, or alternatively the device whose index is the
# first command-line argument
timestamp=$(date +%s.%N)
gcc_binary=${CMAKE_CXX_COMPILER:-$(which c++)}
eyalroz / sgn2pdf
Last active December 27, 2016 10:43
View sgn2pdf
# sgn2pdf
# by Eyal Rozenberg <>
# version: 2016-12-27
# Extracts a PDF file from an Israeli courts' .sgn PDF document envelope
# This program is free software: you can redistribute it and/or modify
View memory_region.h
* memory_region.h
* Definition of the gsl::span-like memory_region class
#pragma once
#if ( __cplusplus < 201103L )
View Factory.h
* Implementation of the factory pattern, based on suggestions here:
* and on the suggestions for corrections here:
View Parsing the unparsed program_options options
static void add_unrecognized_options(TestConfiguration& config, const std::vector<string>& unrecognized_options)
// TODO: make sure all unrecognized options are of the form --option=value
// I'm sure the following can be made more elegant...
enum { OptionName, OptionValue } now_expecting = OptionName;
std::string option_name;
for(auto it = unrecognized_options.begin(); it != unrecognized_options.end(); it++) {
std::string option_value;