Sync fft interfaces#235
Conversation
…ync_fft_interfaces
| namespace dft { | ||
| namespace detail { | ||
|
|
||
| class descriptor_impl { |
There was a problem hiding this comment.
Everything in this impl class is general (not backend specific). So, it does not need to be in descriptor_impl, but can be in the descriptor class. We only need pimpl for backend-specific parts (factorizations, twiddle tables etc) and these can only be initialized in the commit call, not in descriptor constructor.
Implementations will need to be backend specific (so one in every backend) and for now you can leave them empty. They will only be initialized in commit implementation for each backend.
Maybe we dont even need pimpl, just a pointer that each backend can set to point to its internal data it needs to store in the descriptor (just thinking out loud).
There was a problem hiding this comment.
Hey Tadej, thank you for the review, I have a few options to move forward
- impliment the constructor and the
set_value+get_valuein thedescriptor.hpp, use pimpl only for commit - if we prefer to separate implimentation and declaration then I would have to explicitly specialize consturctors + pre-commit member functinos, which would bloat the implimentation code (e.g.
src/dft/backend/descriptor.cxx) - could use
detail::create_descriptor(pointer to class impl) for general implimentation, and detail::create_commit(pointer to different commit class ?) along withmklcpu::create_commit(...mklgpu::create_commit`), this would avoid some bloating as create_descriptor can be templated and passed on to the impl class.
for now I can work on option 1 as the prefered way, let me know your thoughts on this.
There was a problem hiding this comment.
Yeah, I like 1 the best as well. Other options sound like unnecessary complications.
There was a problem hiding this comment.
710a4e1, should enable you to work on gpu commit.
| template <oneapi::mkl::dft::precision prec, oneapi::mkl::dft::domain dom> | ||
| oneapi::mkl::dft::detail::descriptor_impl* create_descriptor(std::size_t length); | ||
|
|
||
| template <oneapi::mkl::dft::precision prec, oneapi::mkl::dft::domain dom> | ||
| oneapi::mkl::dft::detail::descriptor_impl* create_descriptor(std::vector<std::int64_t> dimensions); |
There was a problem hiding this comment.
We won't need these after everything from descriptor_impl is moved to descriptor.
t4c1
left a comment
There was a problem hiding this comment.
I added multiple comments, but I think only the first one actually blocks any further implementations.
| #ifdef ENABLE_MKLCPU_BACKEND | ||
| : pimpl_(mklcpu::create_descriptor(length)) {} | ||
| #endif | ||
| #ifdef ENABLE_MKLGPU_BACKEND | ||
| : pimpl_(mklgpu::create_descriptor(length)) {} | ||
| #endif |
There was a problem hiding this comment.
This will prevent us from compiling for multiple backends. pimpl_ should be initialized in commit, where we know which backend is used (from the queue).
| descriptor(std::vector<std::int64_t> dimensions); | ||
|
|
||
| ~descriptor(); | ||
| // ~descriptor(); |
There was a problem hiding this comment.
Why comment out destructor? I think this should be reverted.
There was a problem hiding this comment.
Also, destructor should free pimpl if commit was called before descriptor is destroyed.
There was a problem hiding this comment.
pimpl is casted as unique_ptr, it will free itself as it goes out of scope.
There was a problem hiding this comment.
Makes sense. This is fine as it is.
| } | ||
|
|
||
| protected: | ||
| sycl::queue queue_; |
There was a problem hiding this comment.
I think we don't need queue in the descriptor_impl, as it is part of the descriptor.
|
|
||
| namespace mklcpu { | ||
|
|
||
| ONEMKL_EXPORT oneapi::mkl::dft::detail::descriptor_impl* create_descriptor(std::size_t length); |
There was a problem hiding this comment.
We do not need those anymore. In fact, this whole file can be removed.
I think you reviewed old code, there have been a few commits after the one you reviewed. |
|
Right. Nothing in this should block us now, but the comment about not needing queue in |
|
@anantsrivastava30 Can you modify the PR to target the develop branch in your fork and then we should be able to work on top of that. |
@KumudhaN thanks for pointing out opend a local PR! and merging it to local anantsrivastava30#1 |
|
@anantsrivastava30 I think this can be closed right? |
Description
Please include a summary of the change. Please also include relevant
motivation and context. See
contribution guidelines
for more details. If the change fixes an issue not documented in the project's
Github issue tracker, please document all steps necessary to reproduce it.
Fixes # (GitHub issue)
Checklist
All Submissions
New interfaces
it was accepted? # (RFC)
New features
Bug fixes
GitHub issue or in this PR)?