-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
bugSomething isn't workingSomething isn't working
Description
In the babelstream benchmark kernel, all IMdSpan objects in the SimdForEachKernel kernel are annotate with const. Therefore they should be not writable.
alpaka3/benchmark/babelstream/src/babelStreamMainTest.cpp
Lines 62 to 77 in 66540b9
| struct SimdForEachKernel | |
| { | |
| //! \param acc The accelerator to be executed on. | |
| //! \param func functor applied to each SIMD package. | |
| //! \param arg0 MdSpan from which the problem size is derived | |
| //! \param args MdSpan other spans | |
| ALPAKA_FN_ACC void operator()( | |
| auto const& acc, | |
| auto const& func, | |
| alpaka::concepts::MdSpan auto const& arg0, | |
| alpaka::concepts::MdSpan auto const&... args) const | |
| { | |
| auto simdGrid = onAcc::SimdAlgo{onAcc::worker::threadsInGrid}; | |
| simdGrid.concurrent(acc, arg0.getExtents(), func, arg0, args...); | |
| } | |
| }; |
The kernel is called with the functor SimdCopyOp functor, which writes to a buffer, which should be forbidden.
alpaka3/benchmark/babelstream/src/babelStreamMainTest.cpp
Lines 90 to 96 in 66540b9
| struct SimdCopyOp | |
| { | |
| constexpr void operator()(auto const&, auto const a, auto c) const | |
| { | |
| c = a.load(); | |
| } | |
| }; |
alpaka3/benchmark/babelstream/src/babelStreamMainTest.cpp
Lines 291 to 299 in 66540b9
| measureKernelExec( | |
| [&]() | |
| { | |
| queue.enqueue( | |
| exec, | |
| dataBlocking, | |
| KernelBundle{SimdForEachKernel{}, SimdCopyOp{}, bufAccInputA, bufAccOutputC}); | |
| }, | |
| "CopyKernel"); |
I didn't check the code, but I think we lost the const information when access to memory pointer to create the simd types.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working