Brett 2025-04-06 21:27:44 -04:00
parent 0dadfb73a7
commit 51eb1711b9
6 changed files with 89 additions and 3 deletions

View File

@ -37,7 +37,8 @@ option(ENABLE_TSAN "Enable the thread data race sanitizer" OFF)
option(BUILD_EXAMPLES "Build example programs. This will build with CTest" OFF)
option(BUILD_GP_TESTS "Build test programs." OFF)
option(DEBUG_LEVEL "Enable debug features which prints extra information to the console, might slow processing down. [0, 3)" 0)
option(TRACK_ALLOCATIONS "Track total allocations. Can be accessed with blt::gp::tracker" OFF)
option(BLT_GP_DEBUG_CHECK_TREES "Enable checking of trees after every operation" OFF)
option(BLT_GP_DEBUG_TRACK_ALLOCATIONS "Track total allocations. Can be accessed with blt::gp::tracker" OFF)
set(CMAKE_CXX_STANDARD 17)

36
default.nix Normal file
View File

@ -0,0 +1,36 @@
{ pkgs ? (import <nixpkgs> {
config.allowUnfree = true;
config.segger-jlink.acceptLicense = true;
}), ... }:
pkgs.mkShell
{
buildInputs = with pkgs; [
cmake
gcc
clang
emscripten
ninja
renderdoc
valgrind
opentelemetry-cpp
opentelemetry-cpp.dev
];
nativeBuildInputs = with pkgs; [
pkg-config
abseil-cpp
opentelemetry-cpp
opentelemetry-cpp.dev
];
propagatedBuildInputs = with pkgs; [
gtest
gtest.dev
grpc
protobuf
curl
abseil-cpp
opentelemetry-cpp
opentelemetry-cpp.dev
opentelemetry-collector
];
LD_LIBRARY_PATH="/run/opengl-driver/lib:/run/opengl-driver-32/lib";
}

48
include/blt/gp/defines.h Normal file
View File

@ -0,0 +1,48 @@
#pragma once
/*
* Copyright (C) 2024 Brett Terpstra
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef BLT_GP_DEFINES_H
#define BLT_GP_DEFINES_H
#include <blt/std/defines.h>
#if BLT_DEBUG_LEVEL > 0
#if defined(__has_include) &&__has_include(<opentelemetry/version.h>)
#define BLT_DEBUG_OTEL_ENABLED 1
#endif
#endif
#if BLT_DEBUG_LEVEL > 1
#define BLT_GP_DEBUG_TRACK_ALLOCATIONS
#endif
#if BLT_DEBUG_LEVEL > 2
#define BLT_GP_DEBUG_CHECK_TREES
#endif
#ifdef BLT_GP_DEBUG_TRACK_ALLOCATIONS
#undef BLT_GP_DEBUG_TRACK_ALLOCATIONS
#define BLT_GP_DEBUG_TRACK_ALLOCATIONS
#endif
#ifdef BLT_GP_DEBUG_CHECK_TREES
#undef BLT_GP_DEBUG_CHECK_TREES
#define BLT_GP_DEBUG_CHECK_TREES 1
#endif
#endif //BLT_GP_DEFINES_H

View File

@ -20,7 +20,7 @@
#define BLT_GP_FWDECL_H
#include <functional>
#include <blt/std/logging.h>
#include <blt/logging/logging.h>
#include <blt/std/types.h>
#include <ostream>
#include <cstdlib>

@ -1 +1 @@
Subproject commit baa5952666594ce0d07a2b013e46c4bc343ba164
Subproject commit 3cdceda227883bfd1bf8c41b466ef94c8271b501

View File

@ -24,6 +24,7 @@
#include <blt/profiling/profiler_v2.h>
#include <random>
namespace blt::gp
{
#if BLT_DEBUG_LEVEL >= 2 || defined(BLT_TRACK_ALLOCATIONS)