-
Notifications
You must be signed in to change notification settings - Fork 52
Move alpaka vecmem logic to functions #857
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
base: main
Are you sure you want to change the base?
Conversation
… utils. Built on work by Ryan Cross
…into alpaka_separation
|
No, not really... I'm imagining a "simple" class like the following: namespace traccc::alpaka::details {
class vecmem_objects {
public:
...
vecmem::memory_resource& host_mr() const;
vecmem::memory_resource& device_mr() const;
vecmem::memory_resource& shared_mr() const;
vecmem::copy& copy() const;
private:
struct impl;
std::unique_ptr<impl> m_impl;
};
} // namespace traccc::alpaka::details I.e. make an opaque class (using Pimpl) that creates (and owns) some vecmem objects, and gives access to these through their generic interfaces. Then clients would just instantiate such an object themselves. Like: traccc::alpaka::details::vecmem_objects vo{};
...
vecmem::vector<float> foo(&(vo.host_mr()));
... The goal is to remove all Alpaka related preprocessor statements from the public interface of this library. 🤔 |
Templated functions returning shared_ptrs that create
vecmem::hip::device_memory_resource
etc. Note that because of the casting to a derived class this has to be done via pointers.@krasznaa think this might be along the lines of what you were thinking of?
Waiting for a substantial PR from @CrossR first