Skip to content

Commit

Permalink
Add BUILD files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldhulipala authored and Laxman Dhulipala committed Nov 14, 2024
1 parent 2e55a03 commit 533a94c
Show file tree
Hide file tree
Showing 19 changed files with 668 additions and 12 deletions.
3 changes: 3 additions & 0 deletions include/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load("@bazel_tools//tools/cpp:cc_configure.bzl", "cc_configure")

cc_configure()
191 changes: 191 additions & 0 deletions include/parlay/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
licenses(["notice"])

package(
default_visibility = ["//visibility:public"],
)

cc_library(
name = "alloc",
hdrs = ["alloc.h"],
deps = [
":type_traits",
":utilities",
"//parlay/internal:block_allocator",
"//parlay/internal:memory_size",
"//parlay/internal:pool_allocator",
],
)

cc_library(
name = "delayed",
hdrs = ["delayed.h"],
deps = [
":delayed_sequence",
":range",
":type_traits",
"//parlay/internal/delayed:filter",
"//parlay/internal/delayed:filter_op",
"//parlay/internal/delayed:flatten",
"//parlay/internal/delayed:map",
"//parlay/internal/delayed:scan",
"//parlay/internal/delayed:terminal",
"//parlay/internal/delayed:zip",
"//parlay/internal:sequence_ops",
],
)

cc_library(
name = "delayed_sequence",
hdrs = ["delayed_sequence.h"],
deps = [
":utilities",
],
)

cc_library(
name = "hash_table",
hdrs = ["hash_table.h"],
deps = [
":delayed_sequence",
":monoid",
":parallel",
":primitives",
":sequence",
":slice",
":utilities",
"//parlay/internal:sequence_ops",
],
)

cc_library(
name = "io",
hdrs = ["io.h"],
deps = [
":primitives",
":sequence",
":slice",
"//parlay/internal:file_map",
],
)

cc_library(
name = "monoid",
hdrs = ["monoid.h"],
deps = [
":portability",
":type_traits",
]
)

cc_library(
name = "parallel",
hdrs = ["parallel.h"],
deps = [
":scheduler",
"//parlay/internal/scheduler_plugins:sequential",
],
)

cc_library(
name = "portability",
hdrs = ["portability.h"],
)

cc_library(
name = "primitives",
hdrs = ["primitives.h"],
deps = [
":delayed",
":delayed_sequence",
":monoid",
":parallel",
":random",
":range",
":sequence",
":slice",
":type_traits",
":utilities",
"//parlay/internal:block_delayed",
"//parlay/internal:collect_reduce",
"//parlay/internal:counting_sort",
"//parlay/internal:group_by",
"//parlay/internal:integer_sort",
"//parlay/internal:heap_tree",
"//parlay/internal:merge",
"//parlay/internal:merge_sort",
"//parlay/internal:sample_sort",
"//parlay/internal:sequence_ops",
],
)

cc_library(
name = "random",
hdrs = ["random.h"],
deps = [
":delayed_sequence",
":parallel",
":range",
":sequence",
":slice",
":utilities",
"//parlay/internal:counting_sort",
],
)

cc_library(
name = "range",
hdrs = ["range.h"],
deps = [
":type_traits",
]
)

cc_library(
name = "scheduler",
hdrs = ["scheduler.h"],
deps = [
"//parlay/internal:atomic_wait",
"//parlay/internal:work_stealing_deque",
"//parlay/internal:work_stealing_job",
],
)

cc_library(
name = "sequence",
hdrs = ["sequence.h"],
deps = [
":alloc",
":parallel",
":range",
":slice",
":type_traits",
":utilities",
"//parlay/internal:debug_uninitialized",
"//parlay/internal:sequence_base",
],
)

cc_library(
name = "slice",
hdrs = ["slice.h"],
deps = [
":range",
],
)

cc_library(
name = "type_traits",
hdrs = ["type_traits.h"],
)

cc_library(
name = "utilities",
hdrs = ["utilities.h"],
deps = [
":parallel",
":portability",
":range",
":type_traits",
"//parlay/internal:debug_uninitialized",
],
)
5 changes: 3 additions & 2 deletions include/parlay/delayed_sequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,12 @@ class delayed_sequence {
// Subscript access with bounds checking
T at(size_t i) const {
if (i < first || i >= last) {
throw std::out_of_range("Delayed sequence access out of"
std::cerr << "Delayed sequence access out of"
"range at " + std::to_string(i) +
"for a sequence with bounds [" +
std::to_string(first) + ", " +
std::to_string(last) + ")");
std::to_string(last) + ")" << std::endl;
exit(-1);
}
return f(i);
}
Expand Down
Loading

0 comments on commit 533a94c

Please sign in to comment.