Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,20 @@ find_package(
target
passes
native
mc # <--- Added for TargetRegistry/Triple
instcombine # <--- Added for InstCombinePass
scalaropts # <--- Added for SimplifyCFG/GVN/Reassociate
ipo # <--- Added for AlwaysInliner / RelLookupTable
# The components below are used directly by src/CodeGen (TargetRegistry,
# Triple, getDefaultTargetTriple, the AlwaysInliner, and the individual
# passes named in optimize_module). They resolve transitively through the
# monolithic LLVM dylib on macOS, but must be requested explicitly when
# LLVM is built as separate component libraries (e.g. a Linux
# BUILD_SHARED_LIBS install).
mc
targetparser
codegen
transformutils
instcombine
scalaropts
ipo
# irbuilder
orcjit
executionengine # Required for LLJIT
runtimeDyld # Required for JIT execution
Expand All @@ -77,6 +87,18 @@ add_library(bonsai_library STATIC)
add_library(bonsai::library ALIAS bonsai_library)

target_compile_features(bonsai_library PUBLIC cxx_std_20)

# include/Error.h trims this prefix off __FILE__, so that the "[internal]
# Error: <file>:<line>" lines checked in under tests/bonsai/error/*.expect do
# not depend on the name of the directory the repository was cloned into.
# PUBLIC because bonsai_compiler and bonsai_test_runner include Error.h too;
# BUILD_INTERFACE keeps a local absolute path out of anything installed.
target_compile_definitions(
bonsai_library
PUBLIC
"$<BUILD_INTERFACE:BONSAI_SOURCE_DIR=\"${PROJECT_SOURCE_DIR}\">"
)

target_link_libraries(bonsai_library PUBLIC ModernLLVM::LLVM)

target_sources(
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# bonsai

**Click [here for the PLDI 2026 Bonsai branch](https://github.com/rootjalex/bonsai/tree/ajr/pldi-benchmarks) and [here for the PLDI 2026 Scion branch](https://github.com/rootjalex/bonsai/tree/cpg/pldi-artifact).**

DSL for Recursive Geometric Queries

### Setup.
Expand Down
13 changes: 7 additions & 6 deletions apps/cd/cpu/fcl/cd.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <cstdint>
#include "runtime/bonsai_cpp.h"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'runtime/bonsai_cpp.h' file not found [clang-diagnostic-error]

#include "runtime/bonsai_cpp.h"
         ^

#include <cstdint>

using float3 = vector<float, 3>;
struct Triangle {
Expand All @@ -17,9 +17,9 @@ struct _tree_layout1 {
} __attribute__((packed));
struct _tree_layout0 {
uint32_t pCount;
Triangle* prims;
Triangle *prims;
uint32_t nCount;
_tree_layout1* group0_index;
_tree_layout1 *group0_index;
} __attribute__((packed));
struct _tree_layout2 {
} __attribute__((packed));
Expand All @@ -33,11 +33,12 @@ struct _tree_layout5 {
} __attribute__((packed));
struct _tree_layout4 {
uint32_t pCount;
Triangle* prims;
Triangle *prims;
uint32_t nCount;
_tree_layout5* group0_index;
_tree_layout5 *group0_index;
} __attribute__((packed));
struct _tree_layout6 {
} __attribute__((packed));

set<std::tuple<Triangle, Triangle>> collisions(const _tree_layout0& triangles1, const _tree_layout4& triangles2);
set<std::tuple<Triangle, Triangle>> collisions(const _tree_layout0 &triangles1,
const _tree_layout4 &triangles2);
Loading
Loading