Skip to content

Instantly share code, notes, and snippets.

@szellmann
szellmann / parallel_for.h
Created November 23, 2021 18:00
parallel_for implementation in C++
// This file is distributed under the MIT license.
// See the LICENSE file for details.
#pragma once
#include <algorithm>
#include "range.h"
#include "thread_pool.h"
@szellmann
szellmann / Makefile
Last active September 13, 2017 23:21
BVH traversal with Visionaray (https://github.com/szellmann/visionaray) and AMD ROCm hcc
CC=/opt/rocm/hcc/bin/hcc
CC_CONFIG=/opt/rocm/hcc/bin/hcc-config
CFLAGS=-g
GNC_ISA=
all:
$(CC) `$(CC_CONFIG) --cxxflags --ldflags` $(GNC_ISA) raytracing_hcc.cpp -I.. -I/opt/rocm/include -I/home/zellmans/visionaray/include -L/opt/rocm/lib -lhc_am -lm -o raytracing_hcc -g
@szellmann
szellmann / Makefile
Last active May 9, 2017 15:33
Demonstrate AMD ROCm 1.5 hcc issue with stack-based binary tree traversal routine
CC=/opt/rocm/hcc/bin/hcc
CC_CONFIG=/opt/rocm/hcc/bin/hcc-config
GNC_ISA=--amdgpu-target=AMD:AMDGPU:7:0:1 # Hawaii
all:
$(CC) `$(CC_CONFIG) --cxxflags --ldflags` $(GNC_ISA) test.cpp -I.. -I/opt/rocm/include -L/opt/rocm/lib -lhc_am -lm -o test -g
@szellmann
szellmann / main.cu
Last active December 28, 2023 02:44
(Minimal) OpenGL to CUDA PBO example, purpose of this example is to evaluate why depth transfer is so slow
// (Minimal) OpenGL to CUDA PBO example
// Maps the default OpenGL depth buffer to CUDA using GL_PIXEL_PACK_BUFFER_ARB
// Purpose of this example is to evaluate why depth transfer is so slow
// Play around with the example by commenting/uncommenting code in lines 77 ff. and in lines 110/112
//
// In order to reproduce the issue, you require:
// - CUDA (tested with CUDA toolkit 7.5)
// - GLEW (a version with support for GL_KHR_debug)
// - (e.g.) freeglut (we need an OpenGL Debug context!)
//