-
Notifications
You must be signed in to change notification settings - Fork 751
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
[SYCL][Fusion][NoSTL] Reimplement Indices
class without std::array
#12340
Conversation
…d::array`. Signed-off-by: Julian Oppermann <julian.oppermann@codeplay.com>
Signed-off-by: Julian Oppermann <julian.oppermann@codeplay.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just nits.
@@ -92,7 +92,7 @@ Expected<std::unique_ptr<Module>> helper::FusionHelper::addFusedKernel( | |||
{ | |||
const auto MDFromND = [&LLVMCtx](const auto &ND) { | |||
auto MDFromIndices = [&LLVMCtx](const auto &Ind) -> Metadata * { | |||
std::array<Metadata *, jit_compiler::Indices{}.size()> MD{nullptr}; | |||
std::array<Metadata *, 3> MD{nullptr}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a static constexpr
function to Indices
, so we do not have to use the magic number 3
, but instead can use Indices::size()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::array<Metadata *, 3> MD{nullptr}; | |
std::array<Metadata *, jit_compiler::Indices::size()> MD{nullptr}; |
Signed-off-by: Julian Oppermann <julian.oppermann@codeplay.com>
Signed-off-by: Julian Oppermann <julian.oppermann@codeplay.com>
Signed-off-by: Julian Oppermann <julian.oppermann@codeplay.com>
Signed-off-by: Julian Oppermann <julian.oppermann@codeplay.com>
@@ -92,7 +92,7 @@ Expected<std::unique_ptr<Module>> helper::FusionHelper::addFusedKernel( | |||
{ | |||
const auto MDFromND = [&LLVMCtx](const auto &ND) { | |||
auto MDFromIndices = [&LLVMCtx](const auto &Ind) -> Metadata * { | |||
std::array<Metadata *, jit_compiler::Indices{}.size()> MD{nullptr}; | |||
std::array<Metadata *, 3> MD{nullptr}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::array<Metadata *, 3> MD{nullptr}; | |
std::array<Metadata *, jit_compiler::Indices::size()> MD{nullptr}; |
… with it. Signed-off-by: Julian Oppermann <julian.oppermann@codeplay.com>
Signed-off-by: Julian Oppermann <julian.oppermann@codeplay.com>
Signed-off-by: Julian Oppermann <julian.oppermann@codeplay.com>
The
jit_compiler::NDRange
class stores global/local sizes and an offset as instances ofjit_compiler::Indices
, which previously was just an alias tostd::array<size_t, 3>
. To elide this use of the STL class, I implemented a drop-in replacement which is backed by a C array and provides a minimal set of accessors and operators.This PR is part of a series of changes to remove uses of STL classes in the kernel fusion interface to prevent ABI issues in the future.