Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export API #1824

Merged
merged 30 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
43479df
export API
boeschf Feb 1, 2022
6a2cf5d
Merge remote-tracking branch 'upstream/master' into export
boeschf Feb 1, 2022
1e7e681
absolute paths in cmake
boeschf Feb 1, 2022
aa0bc09
cleanup
boeschf Feb 1, 2022
dd710df
more exports
boeschf Feb 1, 2022
6ce00da
some more exports
boeschf Feb 2, 2022
c9b0e9e
mpi exports
boeschf Feb 2, 2022
f1077e9
export backends
boeschf Feb 2, 2022
634b84f
unit tests, and other exports
boeschf Feb 2, 2022
1bdcab7
reverted inclusion of mpi headers
boeschf Feb 2, 2022
feddd05
proper installation
boeschf Feb 2, 2022
ccce912
compiler/platform
boeschf Feb 3, 2022
b109fe0
cmake cleanup
boeschf Feb 3, 2022
f578fe4
typo
boeschf Feb 3, 2022
5a02548
ci + shared libs
boeschf Feb 8, 2022
a8c4042
Merge remote-tracking branch 'upstream/master' into export
boeschf Feb 8, 2022
f2e3917
load shared lib
boeschf Feb 8, 2022
98d9966
export friend function test_invariants
boeschf Feb 8, 2022
988e58f
export friend print operator
boeschf Feb 10, 2022
6784f1e
tests without macos
boeschf Feb 10, 2022
f38aece
tests without macos
boeschf Feb 10, 2022
7946024
removed extra declarations
boeschf Feb 10, 2022
c979596
visibility for tests
boeschf Feb 16, 2022
86c1f15
cpp examples
boeschf Feb 16, 2022
c23fe96
test only shared variant
boeschf Feb 16, 2022
e58d435
yaml typo
boeschf Feb 16, 2022
ff39071
yaml typo
boeschf Feb 16, 2022
ec94c00
Merge remote-tracking branch 'upsteam/master' into export
boeschf Feb 16, 2022
4919245
test all variants
boeschf Feb 16, 2022
ff79a0c
comments
boeschf Feb 24, 2022
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
40 changes: 20 additions & 20 deletions .github/workflows/test-everything.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ jobs:
mpi: "ON",
simd: "OFF"
}
#- {
# name: "MacOS Min",
# os: "macos-10.15",
# cc: "clang",
# cxx: "clang++",
# py: "3.6",
# cmake: "3.18.x",
# mpi: "ON",
# simd: "OFF"
# }
- {
name: "MacOS Min",
os: "macos-10.15",
cc: "clang",
cxx: "clang++",
py: "3.6",
cmake: "3.18.x",
mpi: "ON",
simd: "OFF"
}
- {
name: "Linux Max GCC",
os: "ubuntu-20.04",
Expand Down Expand Up @@ -73,16 +73,16 @@ jobs:
mpi: "ON",
simd: "OFF"
}
#- {
# name: "MacOS Max",
# os: "macos-11",
# cc: "clang",
# cxx: "clang++",
# py: "3.9",
# cmake: "3.22.x",
# mpi: "ON",
# simd: "OFF"
# }
- {
name: "MacOS Max",
os: "macos-11",
cc: "clang",
cxx: "clang++",
py: "3.9",
cmake: "3.22.x",
mpi: "ON",
simd: "OFF"
}
variant: [static, shared]
env:
CC: ${{ matrix.config.cc }}
Expand Down
2 changes: 1 addition & 1 deletion arbor/cell_group_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cell_group_ptr make_cell_group(Args&&... args) {
return cell_group_ptr(new Impl(std::forward<Args>(args)...));
}

cell_group_factory cell_kind_implementation(
ARB_ARBOR_API cell_group_factory cell_kind_implementation(
cell_kind ck, backend_kind bk, const execution_context& ctx)
{
using gid_vector = std::vector<cell_gid_type>;
Expand Down
3 changes: 2 additions & 1 deletion arbor/cell_group_factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <vector>

#include <arbor/common_types.hpp>
#include <arbor/export.hpp>
#include <arbor/recipe.hpp>

#include "cell_group.hpp"
Expand All @@ -20,7 +21,7 @@ namespace arb {
using cell_group_factory = std::function<
cell_group_ptr(const std::vector<cell_gid_type>&, const recipe&, cell_label_range& cg_sources, cell_label_range& cg_targets)>;

cell_group_factory cell_kind_implementation(
ARB_ARBOR_API cell_group_factory cell_kind_implementation(
cell_kind, backend_kind, const execution_context&);

inline bool cell_kind_supported(
Expand Down
52 changes: 26 additions & 26 deletions arbor/include/arbor/arbexcept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace arb {
// Arbor internal logic error (if these are thrown,
// there is a bug in the library.)

struct ARB_ARBOR_API arbor_internal_error: std::logic_error {
struct ARB_SYMBOL_VISIBLE arbor_internal_error: std::logic_error {
arbor_internal_error(const std::string& what_arg):
std::logic_error(what_arg)
{}
Expand All @@ -23,7 +23,7 @@ struct ARB_ARBOR_API arbor_internal_error: std::logic_error {

// Common base-class for arbor run-time errors.

struct ARB_ARBOR_API arbor_exception: std::runtime_error {
struct ARB_SYMBOL_VISIBLE arbor_exception: std::runtime_error {
arbor_exception(const std::string& what_arg):
std::runtime_error(what_arg)
{}
Expand All @@ -32,103 +32,103 @@ struct ARB_ARBOR_API arbor_exception: std::runtime_error {
// Logic errors

// Argument violates domain constraints, eg ln(-1)
struct ARB_ARBOR_API domain_error: arbor_exception {
struct ARB_SYMBOL_VISIBLE domain_error: arbor_exception {
domain_error(const std::string&);
};

// Recipe errors:

struct ARB_ARBOR_API bad_cell_probe: arbor_exception {
struct ARB_SYMBOL_VISIBLE bad_cell_probe: arbor_exception {
bad_cell_probe(cell_kind kind, cell_gid_type gid);
cell_gid_type gid;
cell_kind kind;
};

struct ARB_ARBOR_API bad_cell_description: arbor_exception {
struct ARB_SYMBOL_VISIBLE bad_cell_description: arbor_exception {
bad_cell_description(cell_kind kind, cell_gid_type gid);
cell_gid_type gid;
cell_kind kind;
};

struct ARB_ARBOR_API bad_connection_source_gid: arbor_exception {
struct ARB_SYMBOL_VISIBLE bad_connection_source_gid: arbor_exception {
bad_connection_source_gid(cell_gid_type gid, cell_gid_type src_gid, cell_size_type num_cells);
cell_gid_type gid, src_gid;
cell_size_type num_cells;
};

struct ARB_ARBOR_API bad_connection_label: arbor_exception {
struct ARB_SYMBOL_VISIBLE bad_connection_label: arbor_exception {
bad_connection_label(cell_gid_type gid, const cell_tag_type& label, const std::string& msg);
cell_gid_type gid;
cell_tag_type label;
};

struct ARB_ARBOR_API bad_global_property: arbor_exception {
struct ARB_SYMBOL_VISIBLE bad_global_property: arbor_exception {
explicit bad_global_property(cell_kind kind);
cell_kind kind;
};

struct ARB_ARBOR_API bad_probe_id: arbor_exception {
struct ARB_SYMBOL_VISIBLE bad_probe_id: arbor_exception {
explicit bad_probe_id(cell_member_type id);
cell_member_type probe_id;
};

struct ARB_ARBOR_API gj_kind_mismatch: arbor_exception {
struct ARB_SYMBOL_VISIBLE gj_kind_mismatch: arbor_exception {
gj_kind_mismatch(cell_gid_type gid_0, cell_gid_type gid_1);
cell_gid_type gid_0, gid_1;
};

struct ARB_ARBOR_API gj_unsupported_lid_selection_policy: arbor_exception {
struct ARB_SYMBOL_VISIBLE gj_unsupported_lid_selection_policy: arbor_exception {
gj_unsupported_lid_selection_policy(cell_gid_type gid, cell_tag_type label);
cell_gid_type gid;
cell_tag_type label;
};

// Context errors:

struct ARB_ARBOR_API zero_thread_requested_error: arbor_exception {
struct ARB_SYMBOL_VISIBLE zero_thread_requested_error: arbor_exception {
zero_thread_requested_error(unsigned nbt);
unsigned nbt;
};

// Domain decomposition errors:

struct ARB_ARBOR_API gj_unsupported_domain_decomposition: arbor_exception {
struct ARB_SYMBOL_VISIBLE gj_unsupported_domain_decomposition: arbor_exception {
gj_unsupported_domain_decomposition(cell_gid_type gid_0, cell_gid_type gid_1);
cell_gid_type gid_0, gid_1;
};

// Simulation errors:

struct ARB_ARBOR_API bad_event_time: arbor_exception {
struct ARB_SYMBOL_VISIBLE bad_event_time: arbor_exception {
explicit bad_event_time(time_type event_time, time_type sim_time);
time_type event_time;
time_type sim_time;
};

// Mechanism catalogue errors:

struct ARB_ARBOR_API no_such_mechanism: arbor_exception {
struct ARB_SYMBOL_VISIBLE no_such_mechanism: arbor_exception {
explicit no_such_mechanism(const std::string& mech_name);
std::string mech_name;
};

struct ARB_ARBOR_API duplicate_mechanism: arbor_exception {
struct ARB_SYMBOL_VISIBLE duplicate_mechanism: arbor_exception {
explicit duplicate_mechanism(const std::string& mech_name);
std::string mech_name;
};

struct ARB_ARBOR_API fingerprint_mismatch: arbor_exception {
struct ARB_SYMBOL_VISIBLE fingerprint_mismatch: arbor_exception {
explicit fingerprint_mismatch(const std::string& mech_name);
std::string mech_name;
};

struct ARB_ARBOR_API no_such_parameter: arbor_exception {
struct ARB_SYMBOL_VISIBLE no_such_parameter: arbor_exception {
no_such_parameter(const std::string& mech_name, const std::string& param_name);
std::string mech_name;
std::string param_name;
};

struct ARB_ARBOR_API invalid_parameter_value: arbor_exception {
struct ARB_SYMBOL_VISIBLE invalid_parameter_value: arbor_exception {
invalid_parameter_value(const std::string& mech_name, const std::string& param_name, const std::string& value_str);
invalid_parameter_value(const std::string& mech_name, const std::string& param_name, double value);
std::string mech_name;
Expand All @@ -137,45 +137,45 @@ struct ARB_ARBOR_API invalid_parameter_value: arbor_exception {
double value;
};

struct ARB_ARBOR_API invalid_ion_remap: arbor_exception {
struct ARB_SYMBOL_VISIBLE invalid_ion_remap: arbor_exception {
explicit invalid_ion_remap(const std::string& mech_name);
invalid_ion_remap(const std::string& mech_name, const std::string& from_ion, const std::string& to_ion);
std::string from_ion;
std::string to_ion;
};

struct ARB_ARBOR_API no_such_implementation: arbor_exception {
struct ARB_SYMBOL_VISIBLE no_such_implementation: arbor_exception {
explicit no_such_implementation(const std::string& mech_name);
std::string mech_name;
};

// Run-time value bounds check:

struct ARB_ARBOR_API range_check_failure: arbor_exception {
struct ARB_SYMBOL_VISIBLE range_check_failure: arbor_exception {
explicit range_check_failure(const std::string& whatstr, double value);
double value;
};

struct ARB_ARBOR_API file_not_found_error: arbor_exception {
struct ARB_SYMBOL_VISIBLE file_not_found_error: arbor_exception {
file_not_found_error(const std::string& fn);
std::string filename;
};

//
struct ARB_ARBOR_API bad_catalogue_error: arbor_exception {
struct ARB_SYMBOL_VISIBLE bad_catalogue_error: arbor_exception {
bad_catalogue_error(const std::string&);
bad_catalogue_error(const std::string&, const std::any&);
std::any platform_error;
};

// ABI errors

struct ARB_ARBOR_API bad_alignment: arbor_exception {
struct ARB_SYMBOL_VISIBLE bad_alignment: arbor_exception {
bad_alignment(size_t);
size_t alignment;
};

struct ARB_ARBOR_API unsupported_abi_error: arbor_exception {
struct ARB_SYMBOL_VISIBLE unsupported_abi_error: arbor_exception {
unsupported_abi_error(size_t);
size_t version;
};
Expand Down
3 changes: 2 additions & 1 deletion arbor/include/arbor/benchmark_cell.hpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#pragma once

#include <arbor/export.hpp>
#include <arbor/schedule.hpp>

namespace arb {

// Cell description returned by recipe::cell_description(gid) for cells with
// recipe::cell_kind(gid) returning cell_kind::benchmark

struct benchmark_cell {
struct ARB_SYMBOL_VISIBLE benchmark_cell {
cell_tag_type source; // Label of source.
cell_tag_type target; // Label of target.

Expand Down
Loading