Comments (2)
I would propose that we unify all algorithms in traccc
under a standard interface, something like:
template<typename I, typename O>
class algorithm {
void operator(const I & i, O & o);
};
Then, our algorithms can inherit from this class to provide us a consistent API:
namespace traccc::cuda {
class component_connection : public algorithm<cell_container, cluster_container> {
...
};
}
This would allow us to define compile-type types for composition, while allowing algorithm selection at runtime:
template<typename I, typename P, typename O>
class composition : public algorithm<I, O> {
composition(algorithm<I, P> & a1, algorithm<P, O> & a2);
};
If we want to extend this concept, we can additionally define data location at compile time:
enum class storage {
HOST,
DEVICE,
AGNOSTIC
};
template<typename I, typename O, storage Is=AGNOSTIC, storage Os=AGNOSTIC>
class algorithm {
void operator(const I & i, O & o);
};
namespace traccc::cuda {
class component_connection : public algorithm<cell_container, cluster_container, DEVICE, DEVICE> {
...
};
template<typename T>
class host_to_device : public algorithm<T, T, HOST, DEVICE> {
...
};
}
I think, in general, it is a good idea now to discuss how much we want to fix at compile time (giving us the security of having the type checker check our code for us), and how much we want to leave until runtime (so we can be more flexible at execution time).
from traccc.
I do like your suggestion.
Since even single algorithm may require various types of containers, can input and output type contain more than one container? For example:
template< typename I, typename O >
class algorithm{
public:
virtual void operator()(const I& i, O& o){
}
};
struct input_t{
host_cell_container a;
host_measurement_container b;
};
struct output_t{
host_spacepoint_container b;
};
class test: public algorithm<input_t, output_t>{
public:
void operator()(const input_t& I, output_t& O) override {
...
}
};
Of course the above code will force us to apply get_data()
to every members of structure so it may not be a good solution.:p
from traccc.
Related Issues (20)
- Detector file configuration is ambiguously defined HOT 2
- Improve CCA Unit Test
- Add a docker for clang-format
- Racing condition in Kalman Filter Tests
- Device Clusterization Crashes on ODD Cells (2024.03.13.) HOT 5
- GitLab GPU CI keeps failing HOT 1
- Compilation with Double Precision Blocked HOT 2
- Ambiguity Resolution Errors on ODD ttbar Simulation (2024.05.04.) HOT 3
- (Asynchronous) Error in CUDA Clusterization, main branch (2024.05.04.) HOT 3
- Increase robustness of clustering partitioning
- Runge-Kutta Stepper Assertion, main branch (2024.05.04.) HOT 2
- CUDA Reconstruction Stuck (2024.05.04.) HOT 23
- TrackML reconstruction fails to produce track parameters
- Add support for the AdaptiveCpp SYCL compiler
- `traccc_simulate` qop assertion failure
- `traccc_simulate` navigation cache size assertion failure
- CI builds ignore CUDA C++ standard argument HOT 1
- GPU CI machine appears to be broken HOT 3
- SYCL telescope Kalman fitter tests fail in SYCL with OneAPI 2024.2
- #656 should be reverted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from traccc.