You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 9, 2024. It is now read-only.
This is because the module and pixel maps are global variables, and I could not find a way to calculate the sizes at runtime and make the relevant arrays on the GPU using Alpaka. CUDA is much more relaxed about this, so this was not an issue before we moved to Alpaka. The downside of having the sizes stored in the Constants.h is that if you change the pixel maps in /data/ and the number of connections changes then it would throw a runtime error. To make this clear and avoid future issues, I put warnings in the code to check that the sizes in Constants.h were the sizes calculated at runtime. See the below
std::cerr << "Please change pix_tot in Constants.h to make it equal to connectedPix_size.\n";
throwstd::runtime_error("Mismatched sizes");
}
The best solution here is to remove these variables as globals (probably initialize them in sdl.cc and pass their pointer to each Event object that is created), calculate their sizes at runtime when they are initialized, and then allocate the relevant arrays with these computed sizes. @slava77's recent PR fixed a lot of the issues I ran into when I attempted to do this when moving the code over to Alpaka, so I think this can be done now.
The text was updated successfully, but these errors were encountered:
See this conversation for more details: #374 (comment)
Also discussed in @slava77's recent PR: #377
When the code was moved from CUDA to Alpaka, I had to put the sizes of the maps as constants in Constants.h here:
TrackLooper/SDL/Constants.h
Lines 143 to 148 in ad8ed39
This is because the module and pixel maps are global variables, and I could not find a way to calculate the sizes at runtime and make the relevant arrays on the GPU using Alpaka. CUDA is much more relaxed about this, so this was not an issue before we moved to Alpaka. The downside of having the sizes stored in the Constants.h is that if you change the pixel maps in /data/ and the number of connections changes then it would throw a runtime error. To make this clear and avoid future issues, I put warnings in the code to check that the sizes in Constants.h were the sizes calculated at runtime. See the below
TrackLooper/SDL/EndcapGeometry.cc
Lines 41 to 47 in ad8ed39
TrackLooper/SDL/ModuleMethods.h
Lines 80 to 86 in ad8ed39
The best solution here is to remove these variables as globals (probably initialize them in sdl.cc and pass their pointer to each Event object that is created), calculate their sizes at runtime when they are initialized, and then allocate the relevant arrays with these computed sizes. @slava77's recent PR fixed a lot of the issues I ran into when I attempted to do this when moving the code over to Alpaka, so I think this can be done now.
The text was updated successfully, but these errors were encountered: