-
Notifications
You must be signed in to change notification settings - Fork 75
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
Decrease need for template arguments #1035
Comments
During a VC today, we also briefly discussed this topic and the idea was raised to lock the type of |
This index type in buffer is for linear index, so can't be derived from the extent. So can't be easily removed. However, I am with you that perhaps it can somehow have a default value, and it is not most natural anyways as I also first thought it's multidimensional. Was just documented in #1026 . |
Hmm. Then I think that many examples are missleading, because the same alias |
A general question, is mixing different |
Mixing may be supported but might not be very useful and is also not tested. So deriving it should by a viable option in this case. |
@bernhardmgruber I think you are right, examples are misleading in this regard. I will make a PR to fix. |
@SimeonEhrig: I am very much in favor of a global value! @BenjaminW3: I can hardly believe that type conversions significantly contribute to the programs runtime. Furthermore, alpaka is intended to write portable code, so the same program, whatever I noticed a further issue with the index type: it is the same on host and device code. |
@bernhardmgruber A global variable would be the best approach for easy development, but maybe not for the best performance. I think we should start to think about what a global variable means for the performance (which we already did) and then, which should "split" the variable and make it more depend for certain parts of the code, e.g. the accelerator or memory buffer. using Acc = alpaka::acc::AccCpuSerial<Dim, Idx>;
//...
// internal code
Acc::get_idx_type(); In this case, we just need to define the |
@SimeonEhrig I am not saying your suggestion is somehow bad or anything. However, to me it feels to somewhat contradict the portability idea. Namely, imposing thread indexing on accelerators on internal indexing of buffers. I feel these two should never be tightly related, and e.g. using thread incides as buffer indices directly is also not the best (although very commonly done). |
Sounds, that reducing the usage of |
Can't we introduce |
I gave an introduction to alpaka to a group of people from the EP-SFT group at CERN and while presenting an example there was feedback that alpaka requires specifying too many template arguments. Especially the
Idx
needs to be specified in many places.Example:
Here the
Idx
as argument toalloc
should not be necesary, since it should be carried over from the type ofsizeVec
or from the type ofdev
, which is created using an accelerator where the type ofIdx
is also specified.If possible please try to derive more types from the argument lists of functions and types!
The text was updated successfully, but these errors were encountered: